mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Cornelia Huck <cornelia.huck@de.ibm.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Christian Borntraeger <borntraeger@de.ibm.com>,
	David Hildenbrand <dahi@linux.vnet.ibm.com>,
	Marcelo Tosatti <mtosatti@redhat.com>,
	Xenia Ragiadakou <burzalodowa@gmail.com>,
	Sarah Sharp <sarah.a.sharp@linux.intel.com>,
	Mark Brown <broonie@linaro.org>
Subject: Re: [RFC][PATCH] tracing: Replace '-' with '_' in event system names
Date: Wed, 1 Apr 2015 13:06:35 -0400	[thread overview]
Message-ID: <20150401130635.357579fe@gandalf.local.home> (raw)
In-Reply-To: <20150401123657.29d01802.cornelia.huck@de.ibm.com>

On Wed, 1 Apr 2015 12:36:57 +0200
Cornelia Huck <cornelia.huck@de.ibm.com> wrote:


> The only direct dependency for kvm-s390 I'm aware of is in
> perf/tests/parse-events.c, added because parsing an event with '-' in
> the name was broken.
> 
> Otherwise, I'm not aware of things that should break, excluding local
> scripts and so on of course.

I don't like the fact that this changes what userspace sees. This is
the work around that I'm leaning towards:

-- Steve

diff --git a/arch/s390/kvm/trace-s390.h b/arch/s390/kvm/trace-s390.h
index 653a7ec09ef5..707a3e08639f 100644
--- a/arch/s390/kvm/trace-s390.h
+++ b/arch/s390/kvm/trace-s390.h
@@ -10,6 +10,13 @@
 #define TRACE_INCLUDE_FILE trace-s390
 
 /*
+ * The TRACE_SYSTEM_VAR defaults to TRACE_SYSTEM, but must be a
+ * legitimate C variable. It is not exported to user space.
+ */
+#undef TRACE_SYSTEM_VAR
+#define TRACE_SYSTEM_VAR trace_s390
+
+/*
  * Trace point for the creation of the kvm instance.
  */
 TRACE_EVENT(kvm_s390_create_vm,
diff --git a/drivers/usb/host/xhci-trace.h b/drivers/usb/host/xhci-trace.h
index dde3959b7a33..f44be8293217 100644
--- a/drivers/usb/host/xhci-trace.h
+++ b/drivers/usb/host/xhci-trace.h
@@ -14,6 +14,13 @@
 #undef TRACE_SYSTEM
 #define TRACE_SYSTEM xhci-hcd
 
+/*
+ * The TRACE_SYSTEM_VAR defaults to TRACE_SYSTEM, but must be a
+ * legitimate C variable. It is not exported to user space.
+ */
+#undef TRACE_SYSTEM_VAR
+#define TRACE_SYSTEM_VAR xhci_hcd
+
 #if !defined(__XHCI_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
 #define __XHCI_TRACE_H
 
diff --git a/include/trace/events/intel-sst.h b/include/trace/events/intel-sst.h
index 76c72d3f1902..a4705d7e549c 100644
--- a/include/trace/events/intel-sst.h
+++ b/include/trace/events/intel-sst.h
@@ -1,6 +1,13 @@
 #undef TRACE_SYSTEM
 #define TRACE_SYSTEM intel-sst
 
+/*
+ * The TRACE_SYSTEM_VAR defaults to TRACE_SYSTEM, but must be a
+ * legitimate C variable. It is not exported to user space.
+ */
+#undef TRACE_SYSTEM_VAR
+#define TRACE_SYSTEM_VAR intel_sst
+
 #if !defined(_TRACE_INTEL_SST_H) || defined(TRACE_HEADER_MULTI_READ)
 #define _TRACE_INTEL_SST_H
 
diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h
index 708e2caf8a36..e6c8ed5f6a0c 100644
--- a/include/trace/ftrace.h
+++ b/include/trace/ftrace.h
@@ -18,11 +18,17 @@
 
 #include <linux/ftrace_event.h>
 
+#ifndef TRACE_SYSTEM_VAR
+#define TRACE_SYSTEM_VAR TRACE_SYSTEM
+#endif
+
 #define __app__(x, y) str__##x##y
 #define __app(x, y) __app__(x, y)
 
+#define TRACE_SYSTEM_STRING __app(TRACE_SYSTEM_VAR,__trace_system_name)
+
 #define TRACE_MAKE_SYSTEM_STR()					      \
-	static const char __app(TRACE_SYSTEM,__trace_system_name)[] = \
+	static const char TRACE_SYSTEM_STRING[] = \
 		__stringify(TRACE_SYSTEM)
 
 TRACE_MAKE_SYSTEM_STR();
@@ -32,7 +38,7 @@ TRACE_MAKE_SYSTEM_STR();
 	static struct trace_enum_map __used __initdata			\
 	__##TRACE_SYSTEM##_##a =					\
 	{								\
-		.system = __app(TRACE_SYSTEM,__trace_system_name),	\
+		.system = TRACE_SYSTEM_STRING,				\
 		.enum_string = #a,					\
 		.enum_value = a						\
 	};								\
@@ -127,7 +133,6 @@ TRACE_MAKE_SYSTEM_STR();
 
 #include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
 
-
 /*
  * Stage 2 of the trace events.
  *
@@ -717,7 +722,7 @@ static inline void ftrace_test_probe_##call(void)			\
 _TRACE_PERF_PROTO(call, PARAMS(proto));					\
 static char print_fmt_##call[] = print;					\
 static struct ftrace_event_class __used __refdata event_class_##call = { \
-	.system			= __app(TRACE_SYSTEM,__trace_system_name), \
+	.system			= TRACE_SYSTEM_STRING,			\
 	.define_fields		= ftrace_define_fields_##call,		\
 	.fields			= LIST_HEAD_INIT(event_class_##call.fields),\
 	.raw_init		= trace_event_raw_init,			\
@@ -760,6 +765,7 @@ __attribute__((section("_ftrace_events"))) *__event_##call = &event_##call
 
 #include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
 
+#undef TRACE_SYSTEM_VAR
 
 #ifdef CONFIG_PERF_EVENTS
 

      reply	other threads:[~2015-04-01 17:06 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-01  3:18 Steven Rostedt
2015-04-01  9:20 ` Xenia Ragiadakou
2015-04-01 10:36 ` Cornelia Huck
2015-04-01 17:06   ` Steven Rostedt [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150401130635.357579fe@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=borntraeger@de.ibm.com \
    --cc=broonie@linaro.org \
    --cc=burzalodowa@gmail.com \
    --cc=cornelia.huck@de.ibm.com \
    --cc=dahi@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    --cc=sarah.a.sharp@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®