src/share/vm/trace/traceStream.hpp

Thu, 14 Jun 2018 09:15:08 -0700

author
kevinw
date
Thu, 14 Jun 2018 09:15:08 -0700
changeset 9327
f96fcd9e1e1b
parent 7367
82d3e7b5277a
child 9448
73d689add964
child 9482
80ee2541504e
permissions
-rw-r--r--

8081202: Hotspot compile warning: "Invalid suffix on literal; C++11 requires a space between literal and identifier"
Summary: Need to add a space between macro identifier and string literal
Reviewed-by: bpittore, stefank, dholmes, kbarrett

sla@5237 1 /*
drchase@6680 2 * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
sla@5237 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
sla@5237 4 *
sla@5237 5 * This code is free software; you can redistribute it and/or modify it
sla@5237 6 * under the terms of the GNU General Public License version 2 only, as
sla@5237 7 * published by the Free Software Foundation.
sla@5237 8 *
sla@5237 9 * This code is distributed in the hope that it will be useful, but WITHOUT
sla@5237 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
sla@5237 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
sla@5237 12 * version 2 for more details (a copy is included in the LICENSE file that
sla@5237 13 * accompanied this code).
sla@5237 14 *
sla@5237 15 * You should have received a copy of the GNU General Public License version
sla@5237 16 * 2 along with this work; if not, write to the Free Software Foundation,
sla@5237 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
sla@5237 18 *
sla@5237 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
sla@5237 20 * or visit www.oracle.com if you need additional information or have any
sla@5237 21 * questions.
sla@5237 22 *
sla@5237 23 */
sla@5237 24
sla@5237 25 #ifndef SHARE_VM_TRACE_TRACESTREAM_HPP
sla@5237 26 #define SHARE_VM_TRACE_TRACESTREAM_HPP
sla@5237 27
sla@5237 28 #include "utilities/macros.hpp"
sla@5237 29 #if INCLUDE_TRACE
sla@5237 30 #include "oops/klass.hpp"
sla@5237 31 #include "oops/method.hpp"
sla@5237 32 #include "oops/symbol.hpp"
sla@5237 33 #include "utilities/ostream.hpp"
sla@5237 34
sla@5237 35 class TraceStream : public StackObj {
sla@5237 36 private:
sla@5237 37 outputStream& _st;
sla@5237 38
sla@5237 39 public:
sla@5237 40 TraceStream(outputStream& stream): _st(stream) {}
sla@5237 41
sla@5237 42 void print_val(const char* label, u1 val) {
kevinw@9327 43 _st.print("%s = " UINT32_FORMAT, label, val);
sla@5237 44 }
sla@5237 45
sla@5237 46 void print_val(const char* label, u2 val) {
kevinw@9327 47 _st.print("%s = " UINT32_FORMAT, label, val);
sla@5237 48 }
sla@5237 49
sla@5237 50 void print_val(const char* label, s2 val) {
kevinw@9327 51 _st.print("%s = " INT32_FORMAT, label, val);
sla@5237 52 }
sla@5237 53
sla@5237 54 void print_val(const char* label, u4 val) {
kevinw@9327 55 _st.print("%s = " UINT32_FORMAT, label, val);
sla@5237 56 }
sla@5237 57
sla@5237 58 void print_val(const char* label, s4 val) {
kevinw@9327 59 _st.print("%s = " INT32_FORMAT, label, val);
sla@5237 60 }
sla@5237 61
sla@5237 62 void print_val(const char* label, u8 val) {
kevinw@9327 63 _st.print("%s = " UINT64_FORMAT, label, val);
sla@5237 64 }
sla@5237 65
sla@5237 66 void print_val(const char* label, s8 val) {
kevinw@9327 67 _st.print("%s = " INT64_FORMAT, label, (int64_t) val);
sla@5237 68 }
sla@5237 69
sla@5237 70 void print_val(const char* label, bool val) {
sla@5237 71 _st.print("%s = %s", label, val ? "true" : "false");
sla@5237 72 }
sla@5237 73
sla@5237 74 void print_val(const char* label, float val) {
sla@5237 75 _st.print("%s = %f", label, val);
sla@5237 76 }
sla@5237 77
sla@5237 78 void print_val(const char* label, double val) {
sla@5237 79 _st.print("%s = %f", label, val);
sla@5237 80 }
sla@5237 81
sla@5237 82 // Caller is machine generated code located in traceEventClasses.hpp
sla@5237 83 // Event<TraceId>::writeEvent() (pseudocode) contains the
sla@5237 84 // necessary ResourceMark for the resource allocations below.
sla@5237 85 // See traceEventClasses.xsl for details.
sla@5237 86 void print_val(const char* label, const Klass* const val) {
sla@5237 87 const char* description = "NULL";
sla@5237 88 if (val != NULL) {
sla@5237 89 Symbol* name = val->name();
sla@5237 90 if (name != NULL) {
sla@5237 91 description = name->as_C_string();
sla@5237 92 }
sla@5237 93 }
sla@5237 94 _st.print("%s = %s", label, description);
sla@5237 95 }
sla@5237 96
sla@5237 97 // Caller is machine generated code located in traceEventClasses.hpp
sla@5237 98 // Event<TraceId>::writeEvent() (pseudocode) contains the
sla@5237 99 // necessary ResourceMark for the resource allocations below.
sla@5237 100 // See traceEventClasses.xsl for details.
sla@5237 101 void print_val(const char* label, const Method* const val) {
sla@5237 102 const char* description = "NULL";
sla@5237 103 if (val != NULL) {
sla@5237 104 description = val->name_and_sig_as_C_string();
sla@5237 105 }
sla@5237 106 _st.print("%s = %s", label, description);
sla@5237 107 }
sla@5237 108
sla@5237 109 void print_val(const char* label, const char* val) {
sla@5237 110 _st.print("%s = '%s'", label, val);
sla@5237 111 }
sla@5237 112
sla@5237 113 void print(const char* val) {
drchase@6680 114 _st.print("%s", val);
sla@5237 115 }
sla@5237 116 };
sla@5237 117
mgronlun@7367 118 #endif // INCLUDE_TRACE
mgronlun@7367 119 #endif // SHARE_VM_TRACE_TRACESTREAM_HPP

mercurial