]> granicus.if.org Git - strace/commitdiff
2007-07-23 Ulrich Drepper <drepper@redhat.com>
authorRoland McGrath <roland@redhat.com>
Thu, 2 Aug 2007 01:37:55 +0000 (01:37 +0000)
committerRoland McGrath <roland@redhat.com>
Thu, 2 Aug 2007 01:37:55 +0000 (01:37 +0000)
* process.c (sys_getcpu): New function.
* linux/syscall.h: Declare sys_getcpu.
* linux/syscallent.h: Add entry for getcpu.

linux/syscall.h
linux/syscallent.h
process.c

index 783dad5c1d2856bbf8f263c786d40792f5481045..d7a7281f3f313559f24515c54495c05397eb76a8 100644 (file)
@@ -103,6 +103,7 @@ int sys_mbind(), sys_get_mempolicy(), sys_set_mempolicy(), sys_move_pages();
 int sys_arch_prctl();
 int sys_io_setup(), sys_io_submit(), sys_io_cancel(), sys_io_getevents(), sys_io_destroy();
 int sys_utimensat(), sys_epoll_pwait(), sys_signalfd(), sys_timerfd(), sys_eventfd();
+int sys_getcpu();
 
 /* sys_socketcall subcalls */
 
index ba9e117837ed342739884eaf010ce7da7b5ebc5e..eecef168b38a3411f215d12e9dc82ac20924705a 100644 (file)
        { 4,    TD,     printargs,              "tee"           }, /* 315 */
        { 4,    TD,     printargs,              "vmsplice"      }, /* 316 */
        { 6,    0,      sys_move_pages,         "move_pages"    }, /* 317 */
-       { 5,    0,      printargs,              "SYS_318"       }, /* 318 */
+       { 3,    0,      sys_getcpu,             "getcpu"        }, /* 318 */
        { 5,    TD,     sys_epoll_pwait,        "epoll_pwait"   }, /* 319 */
        { 4,    TD|TF,  sys_utimensat,          "utimensat"     }, /* 320 */
        { 3,    TD|TS,  sys_signalfd,           "signalfd"      }, /* 321 */
index 45f42b5193c4de7c4c31760356cb4de79f328ce8..12d643bba6698c62baac4fb6ebab635e03ec3ed9 100644 (file)
--- a/process.c
+++ b/process.c
@@ -3325,4 +3325,28 @@ struct tcb *tcp;
 }
 #endif
 
+
+int
+sys_getcpu(tcp)
+struct tcb *tcp;
+{
+       if (exiting(tcp)) {
+               unsigned u;
+               if (tcp->u_arg[0] == 0)
+                       tprintf("NULL, ");
+               else if (umove(tcp, tcp->u_arg[0], &u) < 0)
+                       tprintf("%#lx, ", tcp->u_arg[0]);
+               else
+                       tprintf("[%u], ", u);
+               if (tcp->u_arg[1] == 0)
+                       tprintf("NULL, ");
+               else if (umove(tcp, tcp->u_arg[1], &u) < 0)
+                       tprintf("%#lx, ", tcp->u_arg[1]);
+               else
+                       tprintf("[%u], ", u);
+               tprintf("%#lx", tcp->u_arg[2]);
+       }
+       return 0;
+}
+
 #endif