]> sourceware.org Git - systemtap.git/commitdiff
PR16716 partial fix: Fix types in syscall.ioperm
authorMartin Cermak <mcermak@redhat.com>
Wed, 10 Dec 2014 05:36:10 +0000 (06:36 +0100)
committerMartin Cermak <mcermak@redhat.com>
Wed, 10 Dec 2014 05:36:10 +0000 (06:36 +0100)
* tapset/linux/nd_syscalls.stp: Fix types
* tapset/linux/syscalls.stp: Fix types
* testsuite/systemtap.syscall/ioperm.c: New testcase
* testsuite/systemtap.syscall/getdents.c: Fix coverage

tapset/linux/nd_syscalls.stp
tapset/linux/syscalls.stp
testsuite/systemtap.syscall/getdents.c
testsuite/systemtap.syscall/ioperm.c [new file with mode: 0644]

index eb3d8951c834cea67143336d1324af6c95861571..ef3206318806a68e52dff97eb89c2af7d8ee2142 100644 (file)
@@ -2643,8 +2643,8 @@ probe nd_syscall.ioperm = kprobe.function("sys_ioperm") ?
        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 ?
 {
index d071e683dc125616cd7ebeb243d8a3f3856e0328..1531144d2a003018afaa336b3e6ef689706546cc 100644 (file)
@@ -2500,10 +2500,10 @@ probe __syscall.io_getevents.return = kernel.function("sys_io_getevents").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 ?
 {
index 064e860d32e813bd0c6239c94a0ead8b79b89a74..ee4ae2b18a1deeac2b19d0f165ac6e5f0f6f1886 100644 (file)
@@ -1,4 +1,4 @@
-/* COVERAGE: getdents */
+/* COVERAGE: getdents getdents64 */
 #include <unistd.h>
 #include <sys/syscall.h>
 #include <sys/types.h>
diff --git a/testsuite/systemtap.syscall/ioperm.c b/testsuite/systemtap.syscall/ioperm.c
new file mode 100644 (file)
index 0000000..07094d5
--- /dev/null
@@ -0,0 +1,50 @@
+/* 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;
+}
This page took 0.040393 seconds and 5 git commands to generate.