linux-stable/tools/lib/traceevent
Namhyung Kim 3201f0dc42 tools lib traceevent: Honor operator priority
Currently it ignores operator priority and just sets processed args as a
right operand.  But it could result in priority inversion in case that
the right operand is also a operator arg and its priority is lower.

For example, following print format is from new kmem events.

  "page=%p", REC->pfn != -1UL ? (((struct page *)(0xffffea0000000000UL)) + (REC->pfn)) : ((void *)0)

But this was treated as below:

  REC->pfn != ((null - 1UL) ? ((struct page *)0xffffea0000000000UL + REC->pfn) : (void *) 0)

In this case, the right arg was '?' operator which has lower priority.
But it just sets the whole arg so making the output confusing - page was
always 0 or 1 since that's the result of logical operation.

With this patch, it can handle it properly like following:

  ((REC->pfn != (null - 1UL)) ? ((struct page *)0xffffea0000000000UL + REC->pfn) : (void *) 0)

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Acked-by: Steven Rostedt <rostedt@goodmis.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Joonsoo Kim <js1304@gmail.com>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: linux-mm@kvack.org
Link: http://lkml.kernel.org/r/1428298576-9785-10-git-send-email-namhyung@kernel.org
[ Replaced 'swap' with 'rotate' in a comment as requested by Steve and agreed by Namhyung ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2015-04-08 09:07:09 -03:00
..
.gitignore tools lib traceevent: Ignore TRACEEVENT-CFLAGS file 2012-07-25 11:54:44 -03:00
Build tools lib traceevent: Use tools build framework 2015-02-12 17:55:38 -03:00
event-parse.c tools lib traceevent: Honor operator priority 2015-04-08 09:07:09 -03:00
event-parse.h tools lib traceevent: Add support for __print_array() 2015-03-24 12:46:39 -03:00
event-plugin.c tools lib traceevent: Make plugin options either string or boolean 2015-03-24 12:20:09 -03:00
event-utils.h tools lib traceevent: Get rid of die() finally!! 2014-01-15 15:10:36 -03:00
kbuffer-parse.c tools lib traceevent: Add way to find sub buffer boundary 2015-03-24 12:22:09 -03:00
kbuffer.h tools lib traceevent: Add way to find sub buffer boundary 2015-03-24 12:22:09 -03:00
Makefile tools lib traceevent: Use tools build framework 2015-02-12 17:55:38 -03:00
parse-filter.c tools lib traceevent: Free filter tokens in process_filter() 2015-03-24 12:23:03 -03:00
parse-utils.c tools lib traceevent: Get rid of die() finally!! 2014-01-15 15:10:36 -03:00
plugin_cfg80211.c tools lib traceevent: Clean up format of args in cfg80211 plugin 2014-06-19 18:18:36 +02:00
plugin_function.c tools lib traceevent: Add options to function plugin 2014-06-07 23:33:37 +02:00
plugin_hrtimer.c tools lib traceevent: Unregister handler when hrtimer plugin is unloaded 2014-01-16 16:26:24 -03:00
plugin_jbd2.c tools lib traceevent: Clean up format of args in jbd2 plugin 2014-06-19 18:18:37 +02:00
plugin_kmem.c tools lib traceevent: Unregister handler when kmem plugin is unloaded 2014-01-16 16:26:24 -03:00
plugin_kvm.c tools lib traceevent: Fix format in plugin_kvm 2014-06-19 18:18:33 +02:00
plugin_mac80211.c tools lib traceevent: Unregister handler when mac80211 plugin is unloaded 2014-01-16 16:26:25 -03:00
plugin_sched_switch.c tools lib traceevent: Unregister handler when sched_switch plugin is unloaded 2014-01-16 16:26:25 -03:00
plugin_scsi.c scsi: add SPC-3 command definitions 2014-11-24 20:01:44 +01:00
plugin_xen.c tools lib traceevent: Unregister handler when xen plugin is unloaded 2014-01-16 16:26:25 -03:00
trace-seq.c tools lib traceevent: Introduce trace_seq_do_fprintf function 2015-02-06 11:46:37 +01:00