linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Sharp <dhsharp@google.com>
To: Frederic Weisbecker <fweisbec@gmail.com>
Cc: linux-kernel@vger.kernel.org, mrubin@google.com,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	Steven Rostedt <rostedt@goodmis.org>, Ingo Molnar <mingo@elte.hu>,
	Stephane Eranian <eranian@google.com>
Subject: Re: [PATCH perf 0/2] perf: trace-event-parse: support more operators and print formats
Date: Thu, 7 Apr 2011 13:25:04 -0700	[thread overview]
Message-ID: <BANLkTin43CY46KTb2WOTK0hgm2bN1VbP4w@mail.gmail.com> (raw)
In-Reply-To: <20110407142605.GC1798@nowhere>

On Thu, Apr 7, 2011 at 7:26 AM, Frederic Weisbecker <fweisbec@gmail.com> 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@google.com> wrote:
>> > These patches correspond to similar patches recently applied to trace-cmd
>> >
>> > [ Re-sending with more Cc's ]
>> >
>> > Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
>> > Cc: Frederic Weisbecker <fweisbec@gmail.com>
>> > Cc: Steven Rostedt <rostedt@goodmis.org>
>> > Cc: Ingo Molnar <mingo@elte.hu>
>> > Cc: Stephane Eranian <eranian@google.com>
>> >
>> >
>> > 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#

  reply	other threads:[~2011-04-07 20:25 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-21 22:34 [PATCH perf 0/2] perf: trace-event-parse: support more operators and print formats David Sharp
2011-03-21 22:34 ` [PATCH perf 1/2] perf: trace-event-parse: support additional operators: '!', '~', and '!=' David Sharp
2011-03-21 22:34 ` [PATCH perf 2/2] perf: trace-event-parse: support printing short fields David Sharp
2011-04-07  2:01 ` [PATCH perf 0/2] perf: trace-event-parse: support more operators and print formats David Sharp
2011-04-07 14:26   ` Frederic Weisbecker
2011-04-07 20:25     ` David Sharp [this message]
2011-04-07 21:57       ` Frederic Weisbecker
  -- strict thread matches above, loose matches on Subject: below --
2011-03-10 22:55 David Sharp
2011-03-10 23:17 ` Steven Rostedt

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=BANLkTin43CY46KTb2WOTK0hgm2bN1VbP4w@mail.gmail.com \
    --to=dhsharp@google.com \
    --cc=acme@redhat.com \
    --cc=eranian@google.com \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=mrubin@google.com \
    --cc=rostedt@goodmis.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;
as well as URLs for NNTP newsgroup(s).