This is the mail archive of the systemtap@sources.redhat.com 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: corrected: tapset/script information template


On Fri, Apr 29, 2005 at 03:07:34PM -0700, Vara Prasad wrote:

> trying to achieve here is let us say with other means you narrowed down 
> the problem to sys_open function now you want to know what are all the 
> functions sys_open calls. User could then write a script like the following
> 
> probe.kernel.sys_open.entry()
> {
>   $dynamic_call_graph =1;
> }

Thanks, this is clearer.

> The above probe could be customized to a particular process as well, 
> like in the following
> probe.kernel.sys_open.entry()
> {
> if ($PID == 1234)
>     $dynamic_call_graph =1;
> }

I'm a bit confused by the semantics here. Is $dynamic_call_graph always
thread local? If not, does that mean that the above will turn on call
graphs for *everything* ? If so, how does the second example differ from
the first?

I'm reading through CVS docs, and I don't see a description of
thread-local variables. How do I say "I want to see the control flow of
this thread when it enters sys_open(), but skip all the details of
kmalloc(), since I don't care about it?" Or "I want to see the control
flow, plus the actual return value from function X when it's called?"
Could I do something like:

probe.kernel.function("kmalloc").entry {
	$thisthread->saved_cg = $dynamic_call_graph;
	$dynamic_call_graph = 0;
}

probe.kernel.function("kmalloc").return {
	$dynamic_call_graph = $thisthread->saved_cg;
}

In general I need a way to test a thread-local condition so that I can
only print out certain data under certain conditions, and I didn't find
such in language.tex (yet).

thanks,
john


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