hotspot/src/share/vm/utilities/events.hpp
changeset 24424 2658d7834c6e
parent 17376 4ee999c3c007
child 28163 322d55d167be
--- a/hotspot/src/share/vm/utilities/events.hpp	Fri May 09 08:34:22 2014 -0700
+++ b/hotspot/src/share/vm/utilities/events.hpp	Fri May 09 16:50:54 2014 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -128,7 +128,7 @@
   void print(outputStream* out, EventRecord<T>& e) {
     out->print("Event: %.3f ", e.timestamp);
     if (e.thread != NULL) {
-      out->print("Thread " INTPTR_FORMAT " ", e.thread);
+      out->print("Thread " INTPTR_FORMAT " ", p2i(e.thread));
     }
     print(out, e.data);
   }
@@ -148,7 +148,7 @@
  public:
   StringEventLog(const char* name, int count = LogEventsBufferEntries) : EventLogBase<StringLogMessage>(name, count) {}
 
-  void logv(Thread* thread, const char* format, va_list ap) {
+  void logv(Thread* thread, const char* format, va_list ap) ATTRIBUTE_PRINTF(3, 0) {
     if (!should_log()) return;
 
     double timestamp = fetch_timestamp();
@@ -159,7 +159,7 @@
     _records[index].data.printv(format, ap);
   }
 
-  void log(Thread* thread, const char* format, ...) {
+  void log(Thread* thread, const char* format, ...) ATTRIBUTE_PRINTF(3, 4) {
     va_list ap;
     va_start(ap, format);
     logv(thread, format, ap);
@@ -193,18 +193,17 @@
   static void print();
 
   // Logs a generic message with timestamp and format as printf.
-  static void log(Thread* thread, const char* format, ...);
+  static void log(Thread* thread, const char* format, ...) ATTRIBUTE_PRINTF(2, 3);
 
   // Log exception related message
-  static void log_exception(Thread* thread, const char* format, ...);
+  static void log_exception(Thread* thread, const char* format, ...) ATTRIBUTE_PRINTF(2, 3);
 
-  static void log_deopt_message(Thread* thread, const char* format, ...);
+  static void log_deopt_message(Thread* thread, const char* format, ...) ATTRIBUTE_PRINTF(2, 3);
 
   // Register default loggers
   static void init();
 };
 
-
 inline void Events::log(Thread* thread, const char* format, ...) {
   if (LogEvents) {
     va_list ap;
@@ -283,7 +282,7 @@
 
  public:
   // log a begin event, format as printf
-  EventMark(const char* format, ...);
+  EventMark(const char* format, ...) ATTRIBUTE_PRINTF(2, 3);
   // log an end event
   ~EventMark();
 };