]> sourceware.org Git - systemtap.git/commitdiff
fixed support for pread and pwrite for s390x. Added tests for pread and pwrite.
authordwilder <dwilder>
Mon, 30 Jul 2007 22:29:12 +0000 (22:29 +0000)
committerdwilder <dwilder>
Mon, 30 Jul 2007 22:29:12 +0000 (22:29 +0000)
tapset/ChangeLog
tapset/syscalls2.stp
testsuite/systemtap.syscall/ChangeLog
testsuite/systemtap.syscall/readwrite.c

index 4aedbfc53318585e30a67cbb3868c1d38ae1fd2b..b9462633f9b665955a23e3d6529403c3641bf4f8 100644 (file)
@@ -1,3 +1,10 @@
+2007-07-30 Dave Wilder <dwilder@us.ibm.com>
+       PR 4794
+       * syscalls2.stp (syscall.pread and syscall.pread32)
+       For s390x only changed the $buf argument to $ubuf.
+       Change the format for count and position from %p to %d
+       to make it consistant with sys_read and sys_write.
+
 2007-07-25  Mike Mason <mmlnx@us.ibm.com>
 
        PR 4386
index 7c5b4854e3c4f71d9f39791bbba7aa75e58b8f0d..0554f3cfe7f9515ec00240d8a3e2363546993489 100644 (file)
@@ -396,7 +396,7 @@ probe syscall.pread = kernel.function("sys_pread64") {
        buf_uaddr = $buf
        count = $count
        offset = $pos
-       argstr = sprintf("%d, %p, %p, %p", $fd, $buf, $count, $pos)
+       argstr = sprintf("%d, %p, %d, %d", $fd, $buf, $count, $pos)
 }
 probe syscall.pread.return = kernel.function("sys_pread64").return {
        name = "pread"
@@ -410,7 +410,13 @@ probe syscall.pread32 = kernel.function("sys32_pread64") ? {
        buf_uaddr = $buf
        count = $count
        offset = ($poshi << 32) + $poslo
-       argstr = sprintf("%d, %p, %p, %p", $fd, $buf, $count, ($poshi << 32) + $poslo)
+%( arch == "s390x" %?
+       buf_uaddr = $ubuf
+       argstr = sprintf("%d, %p, %d, %d", $fd, $ubuf, $count, ($poshi << 32) + $poslo)
+%:
+       buf_uaddr = $buf
+        argstr = sprintf("%d, %p, %d, %d", $fd, $buf, $count, ($poshi << 32) + $poslo)
+%)
 }
 probe syscall.pread32.return = kernel.function("sys32_pread64").return ? {
        name = "pread"
@@ -517,9 +523,17 @@ probe syscall.pwrite32 = kernel.function("sys32_pwrite64") ? {
        buf_uaddr = $buf
        count = $count
        offset = ($poshi << 32) + $poslo
+%( arch == "s390x" %?
+        buf_uaddr = $ubuf
+        argstr = sprintf("%d, %s, %d, %d", $fd,
+                        text_strn(user_string($ubuf),syscall_string_trunc,1),
+                                $count, ($poshi << 32) + $poslo)
+%:
+       buf_uaddr = $buf
        argstr = sprintf("%d, %s, %d, %d", $fd, 
                        text_strn(user_string($buf),syscall_string_trunc,1),
                                $count, ($poshi << 32) + $poslo)
+%)
 }
 probe syscall.pwrite32.return = kernel.function("sys32_pwrite64").return ? {
        name = "pwrite"
index 848bafae032217ab0381f72cee9ca70bb364d5d6..1070cde6913fd80c54ba04569d9ecb9ded0f9625 100644 (file)
@@ -1,3 +1,7 @@
+2007-07-30 David Wilder <dwilder@us.ibm.com>
+
+       * readdwrite.c: Added pwrite and pread test
+
 2007-07-17  Martin Hunt  <hunt@redhat.com>
 
        * poll.c (main): Don't hardcode fd.
index 71d8d774d6c40951941154e5ba97def1c8bb65bc..b0e964b6d8fa5a1f3257b0e27f804a82beab06bd 100644 (file)
@@ -33,6 +33,9 @@ int main()
   write(fd,"Hello world abcdefghijklmnopqrstuvwxyz 01234567890123456789", 59);
   // write (NNNN, "Hello world abcdefghijklmnopqrstuvwxyz 012345"..., 59) = 59
 
+  pwrite(fd,"Hello Again",11,12);
+  // pwrite (NNNN, "Hello Again", 11, 12) = 11
+
   writev(fd, v, 3);
   // writev (NNNN, XXXX, 3) = 15
 
@@ -70,6 +73,9 @@ int main()
   read(fd, buf, 50);
   // read (NNNN, XXXX, 50) = 50
 
+  pread(fd, buf, 11, 10);
+  // pread (NNNN, XXXX, 11, 10) = 11
+
   x[0].iov_base = buf1;
   x[0].iov_len = sizeof(STRING1);
   x[1].iov_base = buf2;
This page took 0.034609 seconds and 5 git commands to generate.