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

index 837717280d31cf131a05de675bbda0191774c513..9d2f82c3696721584c7fd4518df51317d858f242 100644 (file)
@@ -1,27 +1,4 @@
 
-# setpriority ________________________________________________
-#
-# asmlinkage long
-# sys_setpriority(int which,
-#                   int who,
-#                   int niceval)
-#
-probe nd_syscall.setpriority = kprobe.function("sys_setpriority") ?
-{
-       name = "setpriority"
-       asmlinkage()
-       which = int_arg(1)
-       which_str = _priority_which_str(which)
-       who = int_arg(2)
-       prio = int_arg(3)
-       argstr = sprintf("%s, %d, %d", which_str, who, prio)
-}
-probe nd_syscall.setpriority.return = kprobe.function("sys_setpriority").return ?
-{
-       name = "setpriority"
-       retstr = returnstr(1)
-}
-
 # setregid ___________________________________________________
 # long sys_setregid(gid_t rgid, gid_t egid)
 #
diff --git a/tapset/linux/sysc_setpriority.stp b/tapset/linux/sysc_setpriority.stp
new file mode 100644 (file)
index 0000000..00ab123
--- /dev/null
@@ -0,0 +1,55 @@
+# setpriority ________________________________________________
+#
+# asmlinkage long
+# sys_setpriority(int which,
+#                   int who,
+#                   int niceval)
+#
+
+@define _SYSCALL_SETPRIORITY_NAME
+%(
+       name = "setpriority"
+%)
+
+@define _SYSCALL_SETPRIORITY_ARGSTR
+%(
+       argstr = sprintf("%s, %d, %d", which_str, who, prio)
+%)
+
+probe syscall.setpriority = dw_syscall.setpriority !, nd_syscall.setpriority {}
+probe syscall.setpriority.return = dw_syscall.setpriority.return !, nd_syscall.setpriority.return {}
+
+# dw_setpriority _____________________________________________________
+
+probe dw_syscall.setpriority = kernel.function("sys_setpriority").call
+{
+       @_SYSCALL_SETPRIORITY_NAME
+       which = __int32($which)
+       which_str = _priority_which_str(__int32($which))
+       who = __int32($who)
+       prio = __int32($niceval)
+       @_SYSCALL_SETPRIORITY_ARGSTR
+}
+probe dw_syscall.setpriority.return = kernel.function("sys_setpriority").return
+{
+       @_SYSCALL_SETPRIORITY_NAME
+       retstr = return_str(1, $return)
+}
+
+# nd_setpriority _____________________________________________________
+
+probe nd_syscall.setpriority = kprobe.function("sys_setpriority") ?
+{
+       @_SYSCALL_SETPRIORITY_NAME
+       asmlinkage()
+       which = int_arg(1)
+       which_str = _priority_which_str(which)
+       who = int_arg(2)
+       prio = int_arg(3)
+       @_SYSCALL_SETPRIORITY_ARGSTR
+}
+probe nd_syscall.setpriority.return = kprobe.function("sys_setpriority").return ?
+{
+       @_SYSCALL_SETPRIORITY_NAME
+       retstr = returnstr(1)
+}
index 9de57ccd7c1c5550c12265170e713dae5ebd3cfb..af86a194879e6f99cfdface91df965eba1231a5c 100644 (file)
@@ -1,25 +1,3 @@
-# setpriority ________________________________________________
-#
-# asmlinkage long
-# sys_setpriority(int which,
-#                   int who,
-#                   int niceval)
-#
-probe syscall.setpriority = kernel.function("sys_setpriority").call
-{
-       name = "setpriority"
-       which = __int32($which)
-       which_str = _priority_which_str(__int32($which))
-       who = __int32($who)
-       prio = __int32($niceval)
-       argstr = sprintf("%s, %d, %d", which_str, __int32($who),
-                        __int32($niceval))
-}
-probe syscall.setpriority.return = kernel.function("sys_setpriority").return
-{
-       name = "setpriority"
-       retstr = return_str(1, $return)
-}
 
 # setregid ___________________________________________________
 # long sys_setregid(gid_t rgid, gid_t egid)
This page took 0.033572 seconds and 5 git commands to generate.