Re: [PATCH perf 0/2] perf: trace-event-parse: support more operatorsand print formats

From: David Sharp
Date: Thu Apr 07 2011 - 16:25:32 EST


On Thu, Apr 7, 2011 at 7:26 AM, Frederic Weisbecker <fweisbec@xxxxxxxxx> wrote:
> On Wed, Apr 06, 2011 at 07:01:40PM -0700, David Sharp wrote:
>> Hi, any feedback on these patches? I think it's important that perf
>> and trace-cmd don't drift in the syntax they accept.
>>
>> d#
>
> Sorry, I forgot these.
>
>> On Mon, Mar 21, 2011 at 3:34 PM, David Sharp <dhsharp@xxxxxxxxxx> wrote:
>> > These patches correspond to similar patches recently applied to trace-cmd
>> >
>> > [ Re-sending with more Cc's ]
>> >
>> > Cc: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
>> > Cc: Frederic Weisbecker <fweisbec@xxxxxxxxx>
>> > Cc: Steven Rostedt <rostedt@xxxxxxxxxxx>
>> > Cc: Ingo Molnar <mingo@xxxxxxx>
>> > Cc: Stephane Eranian <eranian@xxxxxxxxxx>
>> >
>> >
>> > David Sharp (2):
>> > Âperf: trace-event-parse: support additional operators: '!', '~', Âand
>> > Â Â'!='
>> > Âperf: trace-event-parse: support printing short fields
>
> So we now have trace events that use these new operations? Which ones?
> A quick grep on "TP_printk" and "!" doesn't give me any result, probably
> because TP_printk is often multiline.
>

We (google) have some events that use '~' and '!', and I threw in '!='
mostly because it needed to be differentiated from '!' during
tokenizing.

We set the MSB of the syscall number in raw_syscalls events to
indicate a compat syscall, and use '~' and '!' (and '&' and '>>') to
extract the bit. eg, for sys_exit:
print fmt: "NR %ld = %ld isCompat: %d", REC->id & (~0UL>>1), REC->ret,
!!(REC->id & ~(~0UL>>1))
Patches for this will be forthcoming, but, you know: time.

If our internally-added events are not sufficient reason, I think it
still makes sense to support as much of the C expression syntax as
reasonable. Leaving holes in the syntax mostly just causes frustration
when these operators would be useful. And since they do work with the
in-kernel output (which has the whole compiler to leverage), use of
unsupported operators can go unnoticed for quite a while.

Thanks,
d#
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/