public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* [Fwd: Re: [Bug translator/3534] New: support wildcarded linenumber  probe syntax]
@ 2006-11-17 12:35 Vara Prasad
  2006-11-19 11:12 ` Frank Ch. Eigler
  0 siblings, 1 reply; 2+ messages in thread
From: Vara Prasad @ 2006-11-17 12:35 UTC (permalink / raw)
  To: fche, SystemTAP

Sorry earlier posting expanded line no's to html links, please ignore 
that, here is a more readable version.


fche at redhat dot com wrote:

>Idea: probe kernel.function("function@*:*") would put a probe at
>every ~instruction (line record) boundary within the function.
>This would allow a script to collect detailed profile/coverage
>information (albeit at a considerable trapping overhead cost).
>
>  
>
I am not sure i followed your idea. For example if I have the following 
function If i specify probe kernel.statement("get_symbol_offset@kernel.kallsyms.c:*"), the above 
feature will place probes for every instruction of an executable 
statement in this case line nos 139, 145,146 and 148. 
Did i get your proposal correct?

If i got your above idea correct, is this proposal is to support tracing 
of a function without tracing other functions it calls.  In other words 
i am trying to understand what is the underlying motivation for this 
proposal.

132 static unsigned int get_symbol_offset(unsigned long pos)
133 {
134 u8 *name;
135 int i;
136 
137 /* use the closest marker we have. We have markers every 256 positions,
138 * so that should be close enough */
139 name = &kallsyms_names[ kallsyms_markers[pos>>8] ];
140 
141 /* sequentially scan all the symbols up to the point we're searching for.
142 * Every symbol is stored in a [<len>][<len> bytes of data] format, so we
143 * just need to add the len to the current pointer for every symbol we
144 * wish to skip */
145 for(i = 0; i < (pos&0xFF); i++)
146 name = name + (*name) + 1;
147 
148 return name - kallsyms_names;
149 }

bye,
Vara Prasad



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Fwd: Re: [Bug translator/3534] New: support wildcarded linenumber  probe syntax]
  2006-11-17 12:35 [Fwd: Re: [Bug translator/3534] New: support wildcarded linenumber probe syntax] Vara Prasad
@ 2006-11-19 11:12 ` Frank Ch. Eigler
  0 siblings, 0 replies; 2+ messages in thread
From: Frank Ch. Eigler @ 2006-11-19 11:12 UTC (permalink / raw)
  To: Vara Prasad; +Cc: SystemTAP


varap wrote:

> [...]  If i got your above idea correct, is this proposal is to
> support tracing of a function without tracing other functions it
> calls. [...]

Yes, that would be one use.  Or one could monitor a variable for
change that is suspected to occur someplace within the function: a
manual version of a watchpoint.  One might get basic-block coverage or
branch probability profiles:

probe kernel.statements("the_function@*:*") {
  hits[lineno()] ++  # lineno() in future, or pc() now
}
global hits
probe end {
  foreach (l+ in lineno)
    printf ("%d %d\n", l, hits[l]);
}

- FChE

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-11-18 18:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-11-17 12:35 [Fwd: Re: [Bug translator/3534] New: support wildcarded linenumber probe syntax] Vara Prasad
2006-11-19 11:12 ` Frank Ch. Eigler

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).