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: Tracking the Program Counter


Hi,

> I do get an output that shows the task was in certain library code
> such as select() or mutex calls.
> The questions I have are:
> (1) Is this the valid way of obtaining information about switched out
> task?

Yes, uaddr() gives the user space address of the "current" user task.
And print_ubracktrace() will try
You can also see with something like pid() or execname() which process
is "current" (note that to give you the whole user backtrace stap has
to know about all the libraries of the process beforehand, if possible
you should invoke stap with -d /path/to/executable --ldd to provide it
all that information).

> (2) How does systemtap know that the uaddr() is for the task that has
> been switched out and perhaps not for the stap call itself?

I don't know this particular kernel code exactly, but these stap
functions report the information of the "current" task. The "current"
task is whatever happens to be executing at the moment the probe hits.
See also this description:
https://www.kernel.org/doc/htmldocs/kernel-hacking.html#routines-current

Cheers,

Mark


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