]> sourceware.org Git - systemtap.git/commitdiff
PR20333/kill
authorMartin Cermak <mcermak@redhat.com>
Fri, 23 Dec 2016 16:33:23 +0000 (17:33 +0100)
committerMartin Cermak <mcermak@redhat.com>
Fri, 23 Dec 2016 16:33:23 +0000 (17:33 +0100)
tapset/linux/nd_syscalls.stp
tapset/linux/sysc_kill.stp [new file with mode: 0644]
tapset/linux/syscalls.stp

index fc1ebc118d3ec53d300741d4c058024265aea542..1f5a94e27131f7e3945b53d60c0f666c5266e57e 100644 (file)
@@ -1,20 +1,4 @@
 
-# kill _______________________________________________________
-# long sys_kill(int pid, int sig)
-probe nd_syscall.kill = kprobe.function("sys_kill") ?
-{
-       name = "kill"
-       asmlinkage()
-       pid = int_arg(1)
-       sig = int_arg(2)
-       argstr = sprintf("%d, %s", pid, _signal_name(sig))
-}
-probe nd_syscall.kill.return = kprobe.function("sys_kill").return ?
-{
-       name = "kill"
-       retstr = returnstr(1)
-}
-
 # lchown _____________________________________________________
 # long sys_lchown(const char __user * filename, uid_t user, gid_t group)
 #
diff --git a/tapset/linux/sysc_kill.stp b/tapset/linux/sysc_kill.stp
new file mode 100644 (file)
index 0000000..ec7804f
--- /dev/null
@@ -0,0 +1,48 @@
+# kill _______________________________________________________
+# long sys_kill(int pid, int sig)
+
+@define _SYSCALL_KILL_NAME
+%(
+       name = "kill"
+%)
+
+@define _SYSCALL_KILL_ARGSTR
+%(
+       argstr = sprintf("%d, %s", pid, sig_name)
+%)
+
+probe syscall.kill = dw_syscall.kill !, nd_syscall.kill {}
+probe syscall.kill.return = dw_syscall.kill.return !, nd_syscall.kill.return {}
+
+# dw_kill _____________________________________________________
+
+probe dw_syscall.kill = kernel.function("sys_kill").call
+{
+       @_SYSCALL_KILL_NAME
+       pid = __int32($pid)
+       sig = __int32($sig)
+       sig_name = _signal_name(sig)
+       @_SYSCALL_KILL_ARGSTR
+}
+probe dw_syscall.kill.return = kernel.function("sys_kill").return
+{
+       @_SYSCALL_KILL_NAME
+       retstr = return_str(1, $return)
+}
+
+# nd_kill _____________________________________________________
+
+probe nd_syscall.kill = kprobe.function("sys_kill") ?
+{
+       @_SYSCALL_KILL_NAME
+       asmlinkage()
+       pid = int_arg(1)
+       sig = int_arg(2)
+       sig_name = _signal_name(sig)
+       @_SYSCALL_KILL_ARGSTR
+}
+probe nd_syscall.kill.return = kprobe.function("sys_kill").return ?
+{
+       @_SYSCALL_KILL_NAME
+       retstr = returnstr(1)
+}
index 6eecddb18c7785f383a44b8def026f29b5fff17c..230c42d90785568988e144524ca8c864ab1d319b 100644 (file)
@@ -1,19 +1,4 @@
 
-# kill _______________________________________________________
-# long sys_kill(int pid, int sig)
-probe syscall.kill = kernel.function("sys_kill").call
-{
-       name = "kill"
-       pid = __int32($pid)
-       sig = __int32($sig)
-       argstr = sprintf("%d, %s", __int32($pid), _signal_name(__int32($sig)))
-}
-probe syscall.kill.return = kernel.function("sys_kill").return
-{
-       name = "kill"
-       retstr = return_str(1, $return)
-}
-
 # lchown _____________________________________________________
 # long sys_lchown(const char __user * filename, uid_t user, gid_t group)
 #
This page took 0.034923 seconds and 5 git commands to generate.