]> sourceware.org Git - systemtap.git/commitdiff
PR20333/shmat
authorMartin Cermak <mcermak@redhat.com>
Tue, 3 Jan 2017 08:06:03 +0000 (09:06 +0100)
committerMartin Cermak <mcermak@redhat.com>
Tue, 3 Jan 2017 08:06:03 +0000 (09:06 +0100)
tapset/linux/nd_syscalls2.stp
tapset/linux/sysc_shmat.stp [new file with mode: 0644]
tapset/linux/syscalls2.stp

index 2c4b276d38c287c9110420902219f0753937fd6a..5390636fc59d8d1d8376ac7dc950d814cf5484d2 100644 (file)
@@ -1,23 +1,4 @@
 
-# shmat ______________________________________________________
-#
-# long sys_shmat(int shmid, char __user *shmaddr, int shmflg)
-#
-probe nd_syscall.shmat = kprobe.function("sys_shmat") ?
-{
-       name = "shmat"
-       asmlinkage()
-       shmid = int_arg(1)
-       shmaddr_uaddr = pointer_arg(2)
-       shmflg = int_arg(3)
-       argstr = sprintf("%d, %p, %s", shmid, shmaddr_uaddr, _shmat_flags_str(shmflg))
-}
-probe nd_syscall.shmat.return = kprobe.function("sys_shmat").return ?
-{
-       name = "shmat"
-       retstr = returnstr(1)
-}
-
 # compat_sys_shmat ________________________________________
 #
 # long compat_sys_shmat(int first, int second, compat_uptr_t third,
diff --git a/tapset/linux/sysc_shmat.stp b/tapset/linux/sysc_shmat.stp
new file mode 100644 (file)
index 0000000..e9f7988
--- /dev/null
@@ -0,0 +1,52 @@
+# shmat ______________________________________________________
+#
+# long sys_shmat(int shmid, char __user *shmaddr, int shmflg)
+#
+
+@define _SYSCALL_SHMAT_NAME
+%(
+       name = "shmat"
+%)
+
+@define _SYSCALL_SHMAT_ARGSTR
+%(
+       argstr = sprintf("%d, %p, %s", shmid, shmaddr_uaddr, shmflg_str)
+%)
+
+probe syscall.shmat = dw_syscall.shmat !, nd_syscall.shmat {}
+probe syscall.shmat.return = dw_syscall.shmat.return !, nd_syscall.shmat.return {}
+
+# dw_shmat _____________________________________________________
+
+probe dw_syscall.shmat = kernel.function("sys_shmat").call ?
+{
+       @_SYSCALL_SHMAT_NAME
+       shmid = $shmid
+       shmaddr_uaddr = $shmaddr
+       shmflg = $shmflg
+       shmflg_str = _shmat_flags_str(shmflg)
+       @_SYSCALL_SHMAT_ARGSTR
+}
+probe dw_syscall.shmat.return = kernel.function("sys_shmat").return ?
+{
+       @_SYSCALL_SHMAT_NAME
+       retstr = return_str(1, $return)
+}
+
+# nd_shmat _____________________________________________________
+
+probe nd_syscall.shmat = kprobe.function("sys_shmat") ?
+{
+       @_SYSCALL_SHMAT_NAME
+       asmlinkage()
+       shmid = int_arg(1)
+       shmaddr_uaddr = pointer_arg(2)
+       shmflg = int_arg(3)
+       shmflg_str = _shmat_flags_str(shmflg)
+       @_SYSCALL_SHMAT_ARGSTR
+}
+probe nd_syscall.shmat.return = kprobe.function("sys_shmat").return ?
+{
+       @_SYSCALL_SHMAT_NAME
+       retstr = returnstr(1)
+}
index 0b136e3649e0f67770896e5ac06de07be97b980a..3b6b08a69ae4b24d8f5b8a0ed8160e251e49022a 100644 (file)
@@ -1,21 +1,3 @@
-
-# shmat ______________________________________________________
-#
-# long sys_shmat(int shmid, char __user *shmaddr, int shmflg)
-#
-probe syscall.shmat = kernel.function("sys_shmat").call ?
-{
-       name = "shmat"
-       shmid = $shmid
-       shmaddr_uaddr = $shmaddr
-       shmflg = $shmflg
-       argstr = sprintf("%d, %p, %s", $shmid, $shmaddr, _shmat_flags_str($shmflg))
-}
-probe syscall.shmat.return = kernel.function("sys_shmat").return ?
-{
-       name = "shmat"
-       retstr = return_str(1, $return)
-}
 # compat_sys_shmat ________________________________________
 #
 # long compat_sys_shmat(int first, int second, compat_uptr_t third,
This page took 0.036613 seconds and 5 git commands to generate.