* Simple(?) question
@ 2007-03-23 20:32 Alan D. Brunelle
2007-03-23 20:51 ` Roland McGrath
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Alan D. Brunelle @ 2007-03-23 20:32 UTC (permalink / raw)
To: systemtap
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:
%{
#include <linux/blkdev.h>
%}
global rd_hist
probe kernel.function("__generic_unplug_device") {
rd_hist <<< $q->rq.count[READ]
}
probe end {
// print(@hist_log(rd_hist))
exit()
}
(Note: the commented out print line.) If I put the commented line back
in, I get:
%{
#include <linux/blkdev.h>
%}
global rd_hist
probe kernel.function("__generic_unplug_device") {
rd_hist <<< $q->rq.count[READ]
}
probe end {
print(@hist_log(rd_hist))
exit()
}
# stap -vvvg adb-timo-hist.stp
SystemTap translator/driver (version 0.5.12 built 2007-01-01)
(Using Red Hat elfutils 0.125 libraries.)
Copyright (C) 2005-2006 Red Hat, Inc. and others
This is free software; see the source for copying conditions.
Created temporary directory "/tmp/stapWwILsB"
Searched '/usr/share/systemtap/tapset/2.6.18-8.1.1.el5/ia64/*.stp',
match count 0
Searched '/usr/share/systemtap/tapset/2.6.18-8.1.1.el5/*.stp', match count 0
Searched '/usr/share/systemtap/tapset/2.6.18/ia64/*.stp', match count 0
Searched '/usr/share/systemtap/tapset/2.6.18/*.stp', match count 0
Searched '/usr/share/systemtap/tapset/2.6/ia64/*.stp', match count 0
Searched '/usr/share/systemtap/tapset/2.6/*.stp', match count 0
Searched '/usr/share/systemtap/tapset/ia64/*.stp', match count 0
Searched '/usr/share/systemtap/tapset/*.stp', match count 33
Searched '/usr/share/systemtap/tapset/LKET/2.6.18-8.1.1.el5/ia64/*.stp',
match count 0
Searched '/usr/share/systemtap/tapset/LKET/2.6.18-8.1.1.el5/*.stp',
match count 0
Searched '/usr/share/systemtap/tapset/LKET/2.6.18/ia64/*.stp', match count 0
Searched '/usr/share/systemtap/tapset/LKET/2.6.18/*.stp', match count 0
Searched '/usr/share/systemtap/tapset/LKET/2.6/ia64/*.stp', match count 0
Searched '/usr/share/systemtap/tapset/LKET/2.6/*.stp', match count 0
Searched '/usr/share/systemtap/tapset/LKET/ia64/*.stp', match count 0
Searched '/usr/share/systemtap/tapset/LKET/*.stp', match count 19
Pass 1: parsed user script and 52 library script(s) in
290usr/22sys/313real ms.
parsed '__generic_unplug_device' -> func '__generic_unplug_device'
pattern 'kernel' matches module 'kernel'
focused on module 'kernel = [a000000100000000-a000000100d54c28, bias 0]
file /usr/lib/debug/lib/modules/2.6.18-8.1.1.el5/vmlinux ELF machine
ia64 (code 50)
pattern '__generic_unplug_device' matches function '__generic_unplug_device'
selected function __generic_unplug_device
prologue searching function '__generic_unplug_device'
0xa000000100281ac0-0xa000000100281b80@block/ll_rw_blk.c:1660
checking line record 0xa000000100281ac0@block/ll_rw_blk.c:1660
checking line record 0xa000000100281ad0@block/ll_rw_blk.c:1664
prologue found function '__generic_unplug_device' = 0xa000000100281ad0
probe __generic_unplug_device@block/ll_rw_blk.c:1660 kernel
section=.text pc=0xa000000100281ac0
finding location for local 'q' near address a000000100281ac0, module bias 0
pattern 'kernel' matches module 'kernel'
Eliding unused function log
Eliding unused function warn
Eliding unused function error
Eliding unused function stp_print_binary
semantic error: unsupported type tag 19: identifier '$q' at
adb-timo-hist.stp:7:14
semantic error: probe_1462 with invalid type long for operator '.' at
adb-timo-hist.stp:7:20
Pass 2: analyzed script: 2 probe(s), 1 function(s), 1 embed(s), 1
global(s) in 459usr/178sys/652real ms.
Pass 2: analysis failed. Try again with more '-v' (verbose) options.
Running rm -rf /tmp/stapWwILsB
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Simple(?) question
2007-03-23 20:32 Simple(?) question Alan D. Brunelle
@ 2007-03-23 20:51 ` Roland McGrath
2007-03-23 23:43 ` Frank Ch. Eigler
2007-03-26 14:15 ` David Smith
2 siblings, 0 replies; 6+ messages in thread
From: Roland McGrath @ 2007-03-23 20:51 UTC (permalink / raw)
To: Alan D. Brunelle; +Cc: systemtap
> semantic error: unsupported type tag 19: identifier '$q' at
> adb-timo-hist.stp:7:14
> semantic error: probe_1462 with invalid type long for operator '.' at
> adb-timo-hist.stp:7:20
I think this is systemtap's unhelpful way of saying that $q was being used
in a fetch, but it thinks it has a struct type. I thought this might be a
syntactical precedence issue, so "<<< ($q->...)" would work. But $q is
actually a pointer type, so I'm not sure that's what's going on.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Simple(?) question
2007-03-23 20:32 Simple(?) question Alan D. Brunelle
2007-03-23 20:51 ` Roland McGrath
@ 2007-03-23 23:43 ` Frank Ch. Eigler
2007-03-23 23:56 ` Alan D. Brunelle
2007-03-26 14:15 ` David Smith
2 siblings, 1 reply; 6+ messages in thread
From: Frank Ch. Eigler @ 2007-03-23 23:43 UTC (permalink / raw)
To: Alan D. Brunelle; +Cc: systemtap
"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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Simple(?) question
2007-03-23 23:43 ` Frank Ch. Eigler
@ 2007-03-23 23:56 ` Alan D. Brunelle
2007-03-24 15:20 ` Frank Ch. Eigler
0 siblings, 1 reply; 6+ messages in thread
From: Alan D. Brunelle @ 2007-03-23 23:56 UTC (permalink / raw)
To: systemtap
Thanks Frank! This worked:
# cat adb-timo-hist.stp
%{
#include <linux/blkdev.h>
%}
global rd_hist, wr_hist
probe kernel.function("__generic_unplug_device") {
rd_hist <<< $q->rq->count[0]
wr_hist <<< $q->rq->count[1]
}
probe end {
printf("Read counts\n");
print(@hist_linear(rd_hist, 0, 64, 1))
printf("Write counts\n");
print(@hist_linear(wr_hist, 0, 64, 1))
exit()
}
(changed to a linear output - result:
# stap -g adb-timo-hist.stp
^C
Read counts
value |-------------------------------------------------- count
0 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 7968042
1 | 136986
2 | 1943
3 | 66
4 | 0
5 | 0
Write counts
value |-------------------------------------------------- count
0 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 5252766
1 |@@@@@@@@@@@ 1160848
2 |@@@@@@@@@@ 1129149
3 |@@ 273890
4 |@ 181819
5 | 53176
6 | 32574
7 | 11529
8 | 6342
9 | 2432
10 | 1300
11 | 542
12 | 311
13 | 118
14 | 71
15 | 35
16 | 37
17 | 23
18 | 18
19 | 16
20 | 12
21 | 12
22 | 3
23 | 2
24 | 1
25 | 0
26 | 1
27 | 0
28 | 0
29 | 0
30 | 1
31 | 0
32 | 0
33 | 0
34 | 1
35 | 0
36 | 0
37 | 0
38 | 1
39 | 0
40 | 0
41 | 0
42 | 1
43 | 0
44 | 0
45 | 0
46 | 1
47 | 0
48 | 0
49 | 0
50 | 1
51 | 0
52 | 0
53 | 0
54 | 1
55 | 0
56 | 0
57 | 0
58 | 1
59 | 0
60 | 0
61 | 0
62 | 1
63 | 1
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Simple(?) question
2007-03-23 23:56 ` Alan D. Brunelle
@ 2007-03-24 15:20 ` Frank Ch. Eigler
0 siblings, 0 replies; 6+ messages in thread
From: Frank Ch. Eigler @ 2007-03-24 15:20 UTC (permalink / raw)
To: Alan D. Brunelle; +Cc: systemtap
"Alan D. Brunelle" <alan.brunelle@hp.com> writes:
> Thanks Frank! This worked:
I'm glad.
> %{
> #include <linux/blkdev.h>
> %}
> [...]
This part is not necessary, and removing it would also remove
the need for the stap -g (guru-mode) flag.
- FChE
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Simple(?) question
2007-03-23 20:32 Simple(?) question Alan D. Brunelle
2007-03-23 20:51 ` Roland McGrath
2007-03-23 23:43 ` Frank Ch. Eigler
@ 2007-03-26 14:15 ` David Smith
2 siblings, 0 replies; 6+ messages in thread
From: David Smith @ 2007-03-26 14:15 UTC (permalink / raw)
To: Alan D. Brunelle; +Cc: systemtap
Alan D. Brunelle wrote:
> 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:
>
> %{
> #include <linux/blkdev.h>
> %}
> global rd_hist
>
> probe kernel.function("__generic_unplug_device") {
> rd_hist <<< $q->rq.count[READ]
> }
...
> semantic error: unsupported type tag 19: identifier '$q' at
> adb-timo-hist.stp:7:14
> semantic error: probe_1462 with invalid type long for operator '.' at
> adb-timo-hist.stp:7:20
Strangely enough I was looking into this area of systemtap on Friday,
and I decided I didn't like those error messages. So, I worked on
improving them a bit. Here's what the new messages will look like for
your original code when I check my changes in:
====
semantic error: struct/union 'rq' is being accessed instead of a member
of the struct/union: identifier '$q' at ../struct3.stp:3:23
semantic error: probe_1525 uses invalid operator '.' at ../struct3.stp:3:29
====
--
David Smith
dsmith@redhat.com
Red Hat
http://www.redhat.com
256.217.0141 (direct)
256.837.0057 (fax)
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2007-03-26 14:15 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-03-23 20:32 Simple(?) question Alan D. Brunelle
2007-03-23 20:51 ` Roland McGrath
2007-03-23 23:43 ` Frank Ch. Eigler
2007-03-23 23:56 ` Alan D. Brunelle
2007-03-24 15:20 ` Frank Ch. Eigler
2007-03-26 14:15 ` David Smith
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).