This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Why is the same log printed twice when using probe alias?


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]