public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
From: "joshua dot i dot stone at intel dot com" <sourceware-bugzilla@sourceware.org>
To: systemtap@sources.redhat.com
Subject: [Bug translator/3887] Need a syntax to specify probes alternatives
Date: Thu, 18 Jan 2007 22:15:00 -0000	[thread overview]
Message-ID: <20070118221506.32721.qmail@sourceware.org> (raw)
In-Reply-To: <20070118195513.3887.joshua.i.stone@intel.com>


------- Additional Comments From joshua dot i dot stone at intel dot com  2007-01-18 22:15 -------
(In reply to comment #1)
> One thing to consider though is that the different probe points are unlikely
> to be completely interchangeable.  Specifically $target variables available at
> each variant may be quite different, requiring different handlers.

True, but aliases come to the rescue in that case.

> So how about associating the handlers with the alternatives?
> 
> probe kernel.mark("foo") { $arg1 ; $arg2 } ||
>       kernel.function("bar") { $var1 ; $var2 }

Aliases give you a way to split the necessary parts, and still share a common body:

probe my_foo || my_bar {
    printf("this is important: %d %s\n", var1, var2)
}
probe my_foo = kernel.mark("foo") { var1=$arg1->var1 ; var2=$arg2->var2 }
probe my_bar = kernel.function("bar") { var1=$var1 ; var2=$var2 }

> or even with less punctuation:
> 
> probe kernel.mark(....) { }
> else kernel.function(....) { }

Hmm... you've turned '||' into 'else'?  I suppose if you prefer using keywords
over punctuation, that would be fine.  I'm not sure that 'else' makes sense if
there's more that two alternatives though -- perhaps 'or' as a keyword?

> Another issue to consider is what to do with aliases.

Well, using this for tapset aliases was exactly what I intended, so lets hash it
out.  It seems consistent to just expand aliases as normal.

  probe a = b || c {}
  probe b = w || x {}
  probe c = y, z {}

An instance of alias 'a' would expand to the probepoints 'w' OR 'x' OR ('y' AND
'z').  The comma is effectively 'AND', and the alias levels act as grouping for
operator precedence.  The precedence can get tricky though -- consider:

  probe a, b || c {}

If the comma is just 'AND' then traditionally this would be read '(a AND b) OR
c', but visually the comma seems like a lower precedence, which would make it 'a
AND (b OR c)'.

I'm still uncertain about how the 'optional' flags should behave in this
boolean-like probe resolution...

-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=3887

------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

  parent reply	other threads:[~2007-01-18 22:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-18 19:55 [Bug translator/3887] New: " joshua dot i dot stone at intel dot com
2007-01-18 20:24 ` [Bug translator/3887] " fche at redhat dot com
2007-01-18 22:15 ` joshua dot i dot stone at intel dot com [this message]
2007-10-15 19:46 ` fche at redhat dot com
2007-11-19 19:55 ` fche at redhat dot com

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=20070118221506.32721.qmail@sourceware.org \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=systemtap@sources.redhat.com \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).