This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
probe alias (tapset) question
- From: Kevin Stafford <kevinrs at us dot ibm dot com>
- To: systemtap at sources dot redhat dot com
- Date: Tue, 13 Sep 2005 09:53:51 -0700
- Subject: probe alias (tapset) question
I am doing some work on defining system call probe aliases which might
be useful to a SystemTap end user.
I have defined some elementary tapsets and placed them in the SystemTap
search path. Consider the following:
[root@localhost]# cat /usr/local/share/systemtap/tapset/ts_send*
# ts_sendmsg.stp
probe kernel.syscall.sendmsg =
kernel.function("sys_sendmsg")
{
fd = $fd
# this value cannot be exported
# systemtap does not like void *
# msg_name = $msg->msg_name
msg_namelen = $msg->msg_namelen
msq_iovlen = $msg->msg_iovlen
# this value cannot be exported
# systemtap does not like void *
# msg_control = $msg->msg_control
flags = $flags
}
# ts_send.stp
probe kernel.syscall.send =
kernel.function("sys_sendto")
{
fd = $fd
len = $len
flags = $flags
sa_family = $addr->sa_family
sa_data = $addr->sa_data
addrlen = $addr_len
}
# ts_sendto.stp
probe kernel.syscall.sendto =
kernel.function("sys_sendto")
{
fd = $fd
len = $len
flags = $flags
sa_family = $addr->sa_family
sa_data = $addr->sa_data
addrlen = $addr_len
}
So now I am able to access my predefined tapsets:
[root@localhost]# stap -ve 'probe kernel.syscall.send{ }'
...
Running /usr/bin/sudo /usr/local/libexec/systemtap/stpd -r
/tmp/stapMvXUlE/stap_5102.ko
Works great, however what if a user wants to use more than a single tapset:
[root@localhost]# stap -ve 'probe kernel.syscall.send*{ }'
Created temporary directory "/tmp/stapp3gZvF"
parse error: expected '.' or ',' or '(' or '{' or '='
saw: operator '*' at <input>:1:26
Or maybe they even want to use all of the system call tapsets:
[root@localhost tapsets]# stap -ve 'probe kernel.syscall.*{ }'
Created temporary directory "/tmp/stapl1w2Ry"
parse error: expected identifier
saw: operator '*' at <input>:1:22
When defining probe points (ex. kernel.function([M]PATTERN)),
PATTERN/MPATTERN may
include "*" and "?" wildcards. This functionality is not available for
referencing
probe aliases. Is this an intended limitation of tapsets, or should
my_alias.my_probes.* {}
be supported as well?
--
Kevin Stafford
DES 2 | MS 2M3
Beaverton - OR
Linux Technology Center
IBM Systems & Technology
Phone: 1-503-578-3039
Email: kevinrs@us.ibm.com