mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Ingo Molnar <mingo@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Luiz Capitulino <lcapitulino@redhat.com>
Subject: [GIT PULL][PATCH] tracing: Fix tick_stop tracepoint symbols for user export
Date: Tue, 9 Aug 2016 09:55:45 -0400	[thread overview]
Message-ID: <20160809095545.0076b511@gandalf.local.home> (raw)


Linus,

Luiz Capitulino noticed that the tick_stop tracepoint wasn't being parsed
properly by the tracing user space tools. This was due to the
TRACE_DEFINE_ENUM() being set to a define, when it should have been set
to the enum itself. The define was of the MASK that used the BIT to shift.
The BIT was the enum and by adding that, everything gets converted nicely.
The MASK is still kept just in case it gets converted to an enum in the
future.


Please pull the latest trace-v4.8-2 tree, which can be found at:


  git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git
trace-v4.8-2

Tag SHA1: a57eb193097d7dc3a02fe032bdf70e34b768a17b
Head SHA1: c87edb36118664f1fa275107c1138b6f47793240


Steven Rostedt (Red Hat) (1):
      tracing: Fix tick_stop tracepoint symbols for user export

----
 include/trace/events/timer.h | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)
---------------------------
commit c87edb36118664f1fa275107c1138b6f47793240
Author: Steven Rostedt (Red Hat) <rostedt@goodmis.org>
Date:   Fri Aug 5 12:41:52 2016 -0400

    tracing: Fix tick_stop tracepoint symbols for user export
    
    The symbols used in the tick_stop tracepoint were not being converted
    properly into integers in the trace_stop format file. Instead we had this:
    
    print fmt: "success=%d dependency=%s", REC->success,
        __print_symbolic(REC->dependency, { 0, "NONE" },
         { (1 << TICK_DEP_BIT_POSIX_TIMER), "POSIX_TIMER" },
         { (1 << TICK_DEP_BIT_PERF_EVENTS), "PERF_EVENTS" },
         { (1 << TICK_DEP_BIT_SCHED), "SCHED" },
         { (1 << TICK_DEP_BIT_CLOCK_UNSTABLE), "CLOCK_UNSTABLE" })
    
    User space tools have no idea how to parse "TICK_DEP_BIT_SCHED" or the other
    symbols used to do the bit shifting. The reason is that the conversion was
    done with using the TICK_DEP_MASK_* symbols which are just macros that
    convert to the BIT shift itself (with the exception of NONE, which was
    converted properly, because it doesn't use bits, and is defined as zero).
    
    The TICK_DEP_BIT_* needs to be denoted by TRACE_DEFINE_ENUM() in order to
    have this properly converted for user space tools to parse this event.
    
    Cc: stable@vger.kernel.org
    Cc: Frederic Weisbecker <fweisbec@gmail.com>
    Fixes: e6e6cc22e067 ("nohz: Use enum code for tick stop failure tracing message")
    Reported-by: Luiz Capitulino <lcapitulino@redhat.com>
    Tested-by: Luiz Capitulino <lcapitulino@redhat.com>
    Signed-off-by: Steven Rostedt <rostedt@goodmis.org>

diff --git a/include/trace/events/timer.h b/include/trace/events/timer.h
index 51440131d337..28c5da6fdfac 100644
--- a/include/trace/events/timer.h
+++ b/include/trace/events/timer.h
@@ -330,24 +330,32 @@ TRACE_EVENT(itimer_expire,
 #ifdef CONFIG_NO_HZ_COMMON
 
 #define TICK_DEP_NAMES					\
-		tick_dep_name(NONE)			\
+		tick_dep_mask_name(NONE)		\
 		tick_dep_name(POSIX_TIMER)		\
 		tick_dep_name(PERF_EVENTS)		\
 		tick_dep_name(SCHED)			\
 		tick_dep_name_end(CLOCK_UNSTABLE)
 
 #undef tick_dep_name
+#undef tick_dep_mask_name
 #undef tick_dep_name_end
 
-#define tick_dep_name(sdep) TRACE_DEFINE_ENUM(TICK_DEP_MASK_##sdep);
-#define tick_dep_name_end(sdep)  TRACE_DEFINE_ENUM(TICK_DEP_MASK_##sdep);
+/* The MASK will convert to their bits and they need to be processed too */
+#define tick_dep_name(sdep) TRACE_DEFINE_ENUM(TICK_DEP_BIT_##sdep); \
+	TRACE_DEFINE_ENUM(TICK_DEP_MASK_##sdep);
+#define tick_dep_name_end(sdep)  TRACE_DEFINE_ENUM(TICK_DEP_BIT_##sdep); \
+	TRACE_DEFINE_ENUM(TICK_DEP_MASK_##sdep);
+/* NONE only has a mask defined for it */
+#define tick_dep_mask_name(sdep) TRACE_DEFINE_ENUM(TICK_DEP_MASK_##sdep);
 
 TICK_DEP_NAMES
 
 #undef tick_dep_name
+#undef tick_dep_mask_name
 #undef tick_dep_name_end
 
 #define tick_dep_name(sdep) { TICK_DEP_MASK_##sdep, #sdep },
+#define tick_dep_mask_name(sdep) { TICK_DEP_MASK_##sdep, #sdep },
 #define tick_dep_name_end(sdep) { TICK_DEP_MASK_##sdep, #sdep }
 
 #define show_tick_dep_name(val)				\

                 reply	other threads:[~2016-08-09 13:55 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20160809095545.0076b511@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=akpm@linux-foundation.org \
    --cc=fweisbec@gmail.com \
    --cc=lcapitulino@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=torvalds@linux-foundation.org \
    /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®