lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20160809095545.0076b511@gandalf.local.home>
Date:	Tue, 9 Aug 2016 09:55:45 -0400
From:	Steven Rostedt <rostedt@...dmis.org>
To:	Linus Torvalds <torvalds@...ux-foundation.org>
Cc:	LKML <linux-kernel@...r.kernel.org>,
	Ingo Molnar <mingo@...nel.org>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Frederic Weisbecker <fweisbec@...il.com>,
	Luiz Capitulino <lcapitulino@...hat.com>
Subject: [GIT PULL][PATCH] tracing: Fix tick_stop tracepoint symbols for
 user export


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@...dmis.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@...r.kernel.org
    Cc: Frederic Weisbecker <fweisbec@...il.com>
    Fixes: e6e6cc22e067 ("nohz: Use enum code for tick stop failure tracing message")
    Reported-by: Luiz Capitulino <lcapitulino@...hat.com>
    Tested-by: Luiz Capitulino <lcapitulino@...hat.com>
    Signed-off-by: Steven Rostedt <rostedt@...dmis.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)				\

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ