asmlinkage()
from = ulong_arg(1)
num = ulong_arg(2)
- turn_on = int_arg(3)
- argstr = sprintf("%d, %d, %d", from, num, turn_on)
+ turn_on = uint_arg(3)
+ argstr = sprintf("%#x, %#x, %#x", from, num, turn_on)
}
probe nd_syscall.ioperm.return = kprobe.function("sys_ioperm").return ?
{
probe syscall.ioperm = kernel.function("sys_ioperm").call ?
{
name = "ioperm"
- from = $from
- num = $num
- turn_on = $turn_on
- argstr = sprintf("%d, %d, %d", $from, $num, $turn_on)
+ from = __ulong($from)
+ num = __ulong($num)
+ turn_on = __uint32($turn_on)
+ argstr = sprintf("%#x, %#x, %#x", from, num, turn_on)
}
probe syscall.ioperm.return = kernel.function("sys_ioperm").return ?
{
--- /dev/null
+/* COVERAGE: ioperm */
+
+#define _GNU_SOURCE
+#include <unistd.h>
+#include <sys/syscall.h>
+
+// ENOSYS expected on s390 (31-on-64) and on powerpc
+
+int main() {
+
+#ifdef __NR_ioperm
+ syscall(__NR_ioperm, 1060, 1, 1);
+#if defined(__powerpc__) || defined(__s390__)
+ //staptest// ni_syscall () = -38 (ENOSYS)
+#else
+ //staptest// ioperm (0x424, 0x1, 0x1) = 0
+#endif
+
+ syscall(__NR_ioperm, (unsigned long)-1, 1, 1);
+#if defined(__powerpc__) || defined(__s390__)
+ //staptest// ni_syscall () = -38 (ENOSYS)
+#else
+#if __WORDSIZE == 64
+ //staptest// ioperm (0xffffffffffffffff, 0x1, 0x1) = NNNN
+#else
+ //staptest// ioperm (0xffffffff, 0x1, 0x1) = NNNN
+#endif
+#endif
+
+ syscall(__NR_ioperm, 1060, (unsigned long)-1, 1);
+#if defined(__powerpc__) || defined(__s390__)
+ //staptest// ni_syscall () = -38 (ENOSYS)
+#else
+#if __WORDSIZE == 64
+ //staptest// ioperm (0x424, 0xffffffffffffffff, 0x1) = NNNN
+#else
+ //staptest// ioperm (0x424, 0xffffffff, 0x1) = NNNN
+#endif
+#endif
+
+ syscall(__NR_ioperm, 1060, 1, (int)-1);
+#if defined(__powerpc__) || defined(__s390__)
+ //staptest// ni_syscall () = -38 (ENOSYS)
+#else
+ //staptest// ioperm (0x424, 0x1, 0xffffffff) = NNNN
+#endif
+#endif /* __NR_ioperm */
+
+ return 0;
+}