This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: conditional probe semantics
- From: Masami Hiramatsu <mhiramat at redhat dot com>
- To: Dave Nomura <dcnltc at us dot ibm dot com>
- Cc: "Frank Ch. Eigler" <fche at redhat dot com>, systemtap at sourceware dot org
- Date: Sat, 14 Jun 2008 00:33:00 -0400
- Subject: Re: conditional probe semantics
- References: <485317A2.3030201@us.ibm.com>
Hi,
Dave Nomura wrote:
> what is the semantic difference between:
> probe process(...)..... if (condition) { ... }
> and
> probe process(...).... { if (condition) { ... } }
>
Currently, the difference appears when using it with aliases.
ex.)
probe probe1 = process(...) ... if (condition) {...}
probe probe2 = process(...) ... {if (condition) {...}}
'probe probe1 {A}' is expanded as
probe process(...) ... {
if (condition) {
...
A
}
}
On the other hand, 'probe probe2 {B}' is expanded as
probe process(...) ... {
if (condition) {...}
B /* always executed */
}
This means, a condition statement following a probe point
or an alias effects all expanded probe points.
So,
probe probe3 = process(...) ... {...}
'probe probe3 if (condition) {A}' is expanded as
probe process(...) ... {
if (condition) {
...
A
}
}
And, 'probe probe3 { if (condition) {B}}' is expanded as
probe process(...) ... {
... /* always executed */
if (condition) {
B
}
}
So, I recommend you to use 'probe ... if (condition) {...}'
for on-the-fly switching.
Thank you,
--
Masami Hiramatsu
Software Engineer
Hitachi Computer Products (America) Inc.
Software Solutions Division
e-mail: mhiramat@redhat.com