This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: Why is the same log printed twice when using probe alias?
- From: fche at redhat dot com (Frank Ch. Eigler)
- To: Nan Xiao <xiaonan830818 at gmail dot com>
- Cc: systemtap at sourceware dot org
- Date: Tue, 01 Dec 2015 10:57:33 -0500
- Subject: Re: Why is the same log printed twice when using probe alias?
- Authentication-results: sourceware.org; auth=none
- References: <CA+MhoaO6C9u_Bqh55Fe0-pzBy2V5qdZACH=-GKk-exivPmsRvw at mail dot gmail dot com>
Nan Xiao <xiaonan830818@gmail.com> writes:
> [...]
> probe timer_alias = timer.s(3) {printf("Entering timer\n")}
> probe timer_alias += timer.s(3) {printf("Leaving timer\n")}
> probe timer_alias {printf("In timer\n")}
> # ./test.stp
> Entering timer
> In timer
> In timer
> Leaving timer
> [...]
This is correct. Each probe alias definition is independent of the
others, so in this case, timer_alias expands to two separate
timer.s(3) probes. The += just means that the {} block associated
with the latter is supposed to be executed -after- the user's handler
rather than before. (It is not an addition to the other alias's
probe handler or something like that.)
- FChE