This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
attempt to code LKST sysv ipc events in systemtap
- From: William Cohen <wcohen at redhat dot com>
- To: SystemTAP <systemtap at sources dot redhat dot com>
- Date: Thu, 01 Sep 2005 17:21:46 -0400
- Subject: attempt to code LKST sysv ipc events in systemtap
As a part of the exercise that everyone is doing to code instrumentation
using the systemtap translator I coded up the ones in the LKST for sysv
ipc events. They are instrument the function entry so should be fairly
straight forward for system tap. I was just trying to log the same set
of arguments that LKST was using.
I was trying to do this on a FC4 machine running the 2.6.12-1.1447_FC4
kernel. I built a local 0.3.1-1 SystemTap RPM created from a cvs
snapshot earlier today.
Is there a problem with the debugging information in this particular FC4
kernel, e.g. missing information about arguments? The arguments are
definitely in the source code. When trying to install the ipc_lkst.stp
instrumentation I got the following errors.
$ stap ipc_lkst.stp
semantic error: unsupported type tag 23: identifier '$arg' at
ipc_lkst.stp:25:17semantic error: no match for probe point
while: resolving probe point kernel.function("sys_semctl")
semantic error: unable to find local 'key' near pc 0xc01e3bc8:
identifier '$key' at ipc_lkst.stp:46:11
semantic error: no match for probe point
while: resolving probe point kernel.function("sys_msgget")
semantic error: unable to find local 'raddr' near pc 0xc01e78fe:
identifier '$raddr' at ipc_lkst.stp:63:20
semantic error: no match for probe point
while: resolving probe point kernel.function("sys_shmat")
semantic error: unable to find local 'shmaddr' near pc 0xc01e791d:
identifier '$shmaddr' at ipc_lkst.stp:70:15
semantic error: no match for probe point
while: resolving probe point kernel.function("sys_shmdt")
semantic error: unable to find local 'key' near pc 0xc01e6c1e:
identifier '$key' at ipc_lkst.stp:77:11
semantic error: no match for probe point
while: resolving probe point kernel.function("sys_shmget")
Pass 2: analysis failed. Try again with '-v' (verbose) option.
An oddity with the stap translator is that it is only flagging one
unresolved reference per log statement. For example if I comment out
line 46, line 47 in the same statement is flagged with an unresolved
reference. Shouldn't the translator flag all the unresolved references
in the statement, not just the first one?
-Will
/* Implement the Linux Kernel State Tracer SYSV IPC events with SystemTap
ipc_lkst.stp
Will Cohen
20050901
*/
probe kernel.function("sys_semop")
{
log("sys_semop semid,tsops,nsops="
. string($semid) . "," . hexstring($tsops) . "," . hexstring($nsops))
}
probe kernel.function("sys_semget")
{
log("sys_semget key,nsems,semflg="
. string($key) . "," . string($nsems) . "," . string($semflg))
}
probe kernel.function("sys_semctl")
{
log("sys_semctl semid,semnum,cmd,arg="
. string($semid) . "," . string($semnum) . "," . string($cmd)
. "," . string($arg)
)
}
probe kernel.function("sys_msgsnd")
{
log("sys_msgsnd msqid,msgp,msgsz,msgflg="
. string($msqid) . "," . hexstring($msgp) . ","
. string($msgsz) . "," . string($msgflg))
}
probe kernel.function("sys_msgrcv")
{
log("sys_msgrcv msqid,*msgp,msgsz,msgtyp,msgflg="
. string($msqid) . "," . string($msgp) . "," . string($msgsz)
. "," . string($msgtyp) . "," . string($msgflg))
}
probe kernel.function("sys_msgget")
{
log("sys_msgget key,msgflg="
. string($key)
. "," . string($msgflg)
)
}
probe kernel.function("sys_msgctl")
{
log("sys_msgctl msqid,cmd,buf="
. string($msqid) . "," . string($cmd) . "," . hexstring($buf))
}
probe kernel.function("sys_shmat")
{
log("sys_shmat shmid,shmaddr,shmflg,raddr="
. string($shmid)
. "," . hexstring($shmaddr)
. "," . string($shmflg)
. "," . hexstring($raddr)
)
}
probe kernel.function("sys_shmdt")
{
log("sys_shmdt shmaddr="
. hexstring($shmaddr)
)
}
probe kernel.function("sys_shmget")
{
log("sys_shmget key,size,shmflg="
. string($key)
. "," . string($size)
. "," . string($shmflg)
)
}
probe kernel.function("sys_shmctl")
{
log("sys_shmctl shmid,cmd,buf="
. string($shmid)
. "," . string($cmd)
. "," . hexstring($buf)
)
}
probe begin { log("starting probe") }
probe end { log("stopping probe") }