tools lib traceevent: Honor operator priority
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 <5c915a589b3ddf58cebf14bec41bcc143b37ac3c@kernel.org>
Acked-by: Steven Rostedt <43232e92d70cc7aa53504ad0397085ee47bad87f@goodmis.org>
Cc: David Ahern <b80c1600f604d3b0d768f26f90a76757e76005dd@gmail.com>
Cc: Jiri Olsa <2c6594f608aa3d41e98d48846a6328831f7084ad@redhat.com>
Cc: Joonsoo Kim <d91a346a9a76eb1627d34d097d6cb4c8e5067100@gmail.com>
Cc: Minchan Kim <eee62f459f15dcddf87a8df69e8328e2a2562028@kernel.org>
Cc: Peter Zijlstra <645ca7d3a8d3d4f60557176cd361ea8351edc32b@chello.nl>
Cc: eb778157e2286fdb10f8995701208f41dd1c36dc@kvack.org
Link: http://lkml.kernel.org/r/1428298576-9785-10-git-send-email-5c915a589b3ddf58cebf14bec41bcc143b37ac3c@kernel.org
[ Replaced 'swap' with 'rotate' in a comment as requested by Steve and agreed by Namhyung ]
Signed-off-by: Arnaldo Carvalho de Melo <293abb6b76d7791c0732cc517d38c4b5c734b87f@redhat.com>
Signed-off-by: Steven Rostedt <43232e92d70cc7aa53504ad0397085ee47bad87f@goodmis.org>

bigzz/trace-cmd,bigzz/trace-cmd