This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: Simple(?) question
- From: fche at redhat dot com (Frank Ch. Eigler)
- To: "Alan D. Brunelle" <alan dot brunelle at hp dot com>
- Cc: systemtap at sourceware dot org
- Date: 23 Mar 2007 19:43:17 -0400
- Subject: Re: Simple(?) question
- References: <46043959.9070308@hp.com>
"Alan D. Brunelle" <alan.brunelle@hp.com> writes:
> I'm trying to analyze something on RHEL5 GA (errata kernel), and I'm
> having problems getting a simple piece of histogram code to work. The
> following compiles & runs:
> [...]
> probe kernel.function("__generic_unplug_device") {
> rd_hist <<< $q->rq.count[READ]
> }
The problem here is that our syntax for following pointer chains is
more limited than C. Try "$q->rq->count[0]", yes, arrow instead
of dot, and you need a literal number for the index.
> probe end {
> // print(@hist_log(rd_hist))
> exit()
> }
>
> (Note: the commented out print line.) If I put the commented line back
> in, I get:
> [...]
The reason this could make a difference is because this was the sole
*read* of the rd_hist statistical value. With it commented out, an
optimization pass within systemtap removes the whole rd_hist <<<
expression in the other probe handler, and with it, any analysis of
the actual problem.
- FChE