* Re: Probing symbols that are not EXPORT()ed
@ 2006-06-08 19:40 Alan David Brunelle
0 siblings, 0 replies; 5+ messages in thread
From: Alan David Brunelle @ 2006-06-08 19:40 UTC (permalink / raw)
To: systemtap
> Figured it out - this works.
>
> global rqs
>
> probe module("*scsi_mod*").function("scsi_dispatch_cmd")
> {
> rqs <<< ($cmd->request_bufflen / 512)
> }
>
> probe end
> {
> print(@hist_log(rqs))
> exit()
> }
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Probing symbols that are not EXPORT()ed
2006-06-08 19:03 Alan David Brunelle
2006-06-08 19:31 ` Martin Hunt
2006-06-08 19:32 ` William Cohen
@ 2006-06-08 23:26 ` Li Guanglei
2 siblings, 0 replies; 5+ messages in thread
From: Li Guanglei @ 2006-06-08 23:26 UTC (permalink / raw)
To: Alan David Brunelle; +Cc: systemtap
Alan David Brunelle ??:
> global rqs
>
> probe kernel.function("scsi_dispatch_cmd")
> {
> rqs <<< $cmd->request_bufflen
> }
>
> Alan
There is already a probe alias defined in Systemtap for this.
/usr/share/systemtap/tapsets/scsi.stp:
...
/* Dispatch a command to the low-level driver. */
probe scsi.iodispatching
= module("*").function("scsi_dispatch_cmd@drivers/scsi/scsi.c")
{
host_no = $cmd->device->host->host_no
channel = $cmd->device->channel
lun = $cmd->device->lun
dev_id = $cmd->device->id
device_state = $cmd->device->sdev_state
data_direction = $cmd->sc_data_direction
request_buffer = $cmd->request_buffer
req_bufflen = $cmd->request_bufflen
}
...
And this alias also have some predefined variables for you to use.
- Guanglei
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Probing symbols that are not EXPORT()ed
2006-06-08 19:03 Alan David Brunelle
2006-06-08 19:31 ` Martin Hunt
@ 2006-06-08 19:32 ` William Cohen
2006-06-08 23:26 ` Li Guanglei
2 siblings, 0 replies; 5+ messages in thread
From: William Cohen @ 2006-06-08 19:32 UTC (permalink / raw)
To: Alan David Brunelle; +Cc: systemtap
Alan David Brunelle wrote:
> [Sorry for this newbie question...]
>
> How does one probe on a kernel function that does not have an
>
> EXPORT_SYMBOL()
>
> invocation?
>
> For example the following fails:
>
> global rqs
>
> probe kernel.function("scsi_dispatch_cmd")
> {
> rqs <<< $cmd->request_bufflen
> }
>
> probe end
> {
> print(@hist_linear(rqs, 0, 512000, 4000))
> exit()
> }
>
> with:
>
> [root@bl25p1 06_08]# stap -v scwrite.stp
> Pass 1: parsed user script and 11 library script(s) in 40usr/0sys/51real
> ms.
> semantic error: no match for probe point
> while: resolving probe point kernel.function("scsi_dispatch_cmd")
> Pass 2: analyzed script: 1 probe(s), 4 function(s), 1 global(s) in
> 150usr/20sys/163real ms.
> Pass 2: analysis failed.
>
> Thanks,
> Alan
Is this in the scsi module?
Shouldn't it be something like:
probe kernel.module("scsi_mod").function("scsi_dispatch_cmd")
{
rqs <<< $cmd->request_bufflen
}
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Probing symbols that are not EXPORT()ed
2006-06-08 19:03 Alan David Brunelle
@ 2006-06-08 19:31 ` Martin Hunt
2006-06-08 19:32 ` William Cohen
2006-06-08 23:26 ` Li Guanglei
2 siblings, 0 replies; 5+ messages in thread
From: Martin Hunt @ 2006-06-08 19:31 UTC (permalink / raw)
To: Alan David Brunelle; +Cc: systemtap
On Thu, 2006-06-08 at 13:15 -0400, Alan David Brunelle wrote:
> [Sorry for this newbie question...]
>
> How does one probe on a kernel function that does not have an
> EXPORT_SYMBOL()
There is no requirement to have functions exported before they can be
probed.
> For example the following fails:
> probe kernel.function("scsi_dispatch_cmd")
> {
> rqs <<< $cmd->request_bufflen
> }
That function is normally in a module, not in the kernel. So you have to
do either:
probe module("scsi_mod").function("scsi_dispatch_cmd")
OR
probe module("*").function("scsi_dispatch_cmd")
Martin
^ permalink raw reply [flat|nested] 5+ messages in thread
* Probing symbols that are not EXPORT()ed
@ 2006-06-08 19:03 Alan David Brunelle
2006-06-08 19:31 ` Martin Hunt
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Alan David Brunelle @ 2006-06-08 19:03 UTC (permalink / raw)
To: systemtap
[Sorry for this newbie question...]
How does one probe on a kernel function that does not have an
EXPORT_SYMBOL()
invocation?
For example the following fails:
global rqs
probe kernel.function("scsi_dispatch_cmd")
{
rqs <<< $cmd->request_bufflen
}
probe end
{
print(@hist_linear(rqs, 0, 512000, 4000))
exit()
}
with:
[root@bl25p1 06_08]# stap -v scwrite.stp
Pass 1: parsed user script and 11 library script(s) in 40usr/0sys/51real ms.
semantic error: no match for probe point
while: resolving probe point kernel.function("scsi_dispatch_cmd")
Pass 2: analyzed script: 1 probe(s), 4 function(s), 1 global(s) in
150usr/20sys/163real ms.
Pass 2: analysis failed.
Thanks,
Alan
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2006-06-08 23:26 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-06-08 19:40 Probing symbols that are not EXPORT()ed Alan David Brunelle
-- strict thread matches above, loose matches on Subject: below --
2006-06-08 19:03 Alan David Brunelle
2006-06-08 19:31 ` Martin Hunt
2006-06-08 19:32 ` William Cohen
2006-06-08 23:26 ` Li Guanglei
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).