23 */ 24 25 #ifndef SHARE_VM_TRACE_TRACESTREAM_HPP 26 #define SHARE_VM_TRACE_TRACESTREAM_HPP 27 28 #include "utilities/macros.hpp" 29 #if INCLUDE_TRACE 30 #include "oops/klass.hpp" 31 #include "oops/method.hpp" 32 #include "oops/symbol.hpp" 33 #include "utilities/ostream.hpp" 34 35 class TraceStream : public StackObj { 36 private: 37 outputStream& _st; 38 39 public: 40 TraceStream(outputStream& stream): _st(stream) {} 41 42 void print_val(const char* label, u1 val) { 43 _st.print("%s = "UINT32_FORMAT, label, val); 44 } 45 46 void print_val(const char* label, u2 val) { 47 _st.print("%s = "UINT32_FORMAT, label, val); 48 } 49 50 void print_val(const char* label, s2 val) { 51 _st.print("%s = "INT32_FORMAT, label, val); 52 } 53 54 void print_val(const char* label, u4 val) { 55 _st.print("%s = "UINT32_FORMAT, label, val); 56 } 57 58 void print_val(const char* label, s4 val) { 59 _st.print("%s = "INT32_FORMAT, label, val); 60 } 61 62 void print_val(const char* label, u8 val) { 63 _st.print("%s = "UINT64_FORMAT, label, val); 64 } 65 66 void print_val(const char* label, s8 val) { 67 _st.print("%s = "INT64_FORMAT, label, (int64_t) val); 68 } 69 70 void print_val(const char* label, bool val) { 71 _st.print("%s = %s", label, val ? "true" : "false"); 72 } 73 74 void print_val(const char* label, float val) { 75 _st.print("%s = %f", label, val); 76 } 77 78 void print_val(const char* label, double val) { 79 _st.print("%s = %f", label, val); 80 } 81 82 // Caller is machine generated code located in traceEventClasses.hpp 83 // Event<TraceId>::writeEvent() (pseudocode) contains the 84 // necessary ResourceMark for the resource allocations below. 85 // See traceEventClasses.xsl for details. 86 void print_val(const char* label, const Klass* const val) { 87 const char* description = "NULL"; | 23 */ 24 25 #ifndef SHARE_VM_TRACE_TRACESTREAM_HPP 26 #define SHARE_VM_TRACE_TRACESTREAM_HPP 27 28 #include "utilities/macros.hpp" 29 #if INCLUDE_TRACE 30 #include "oops/klass.hpp" 31 #include "oops/method.hpp" 32 #include "oops/symbol.hpp" 33 #include "utilities/ostream.hpp" 34 35 class TraceStream : public StackObj { 36 private: 37 outputStream& _st; 38 39 public: 40 TraceStream(outputStream& stream): _st(stream) {} 41 42 void print_val(const char* label, u1 val) { 43 _st.print("%s = " UINT32_FORMAT, label, val); 44 } 45 46 void print_val(const char* label, u2 val) { 47 _st.print("%s = " UINT32_FORMAT, label, val); 48 } 49 50 void print_val(const char* label, s2 val) { 51 _st.print("%s = " INT32_FORMAT, label, val); 52 } 53 54 void print_val(const char* label, u4 val) { 55 _st.print("%s = " UINT32_FORMAT, label, val); 56 } 57 58 void print_val(const char* label, s4 val) { 59 _st.print("%s = " INT32_FORMAT, label, val); 60 } 61 62 void print_val(const char* label, u8 val) { 63 _st.print("%s = " UINT64_FORMAT, label, val); 64 } 65 66 void print_val(const char* label, s8 val) { 67 _st.print("%s = " INT64_FORMAT, label, (int64_t) val); 68 } 69 70 void print_val(const char* label, bool val) { 71 _st.print("%s = %s", label, val ? "true" : "false"); 72 } 73 74 void print_val(const char* label, float val) { 75 _st.print("%s = %f", label, val); 76 } 77 78 void print_val(const char* label, double val) { 79 _st.print("%s = %f", label, val); 80 } 81 82 // Caller is machine generated code located in traceEventClasses.hpp 83 // Event<TraceId>::writeEvent() (pseudocode) contains the 84 // necessary ResourceMark for the resource allocations below. 85 // See traceEventClasses.xsl for details. 86 void print_val(const char* label, const Klass* const val) { 87 const char* description = "NULL"; |