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: new static user probe types


On 07/15/2009 09:19 AM, Stan Cox wrote:
> The guard statements this experiments is using look like:
> kprobe:
> if ((task_tid(task_current())) != (_utrace_syscall_arg(1))) next   # 
> current task?

task_tid(task_current()) == tid(), and the latter should be faster.  But
anyway, it's not clear to me what this is guarding against.

> if ((pointer_arg(1)) != (_stp_probe_name_test)) {      # probe name ptr 
> differs from saved?
> if ((user_int(pointer_arg(1))) != (1953719668)) next  # check first word 
> of probe name
> if ((user_string(pointer_arg(1))) != ("test")) next       # check string 
> if all else fails
> }
> (_stp_probe_name_test) = (pointer_arg(1))               # remember saved 
> probe name ptr

Beware that the 1953719668 constant is little-endian specific.

I'm also nervous about saving _stp_probe_name_XXX -- murphy's law may
eventually produce a mark in one app that happens to have the same
pointer address as a different mark in a different app.


Josh


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