]> granicus.if.org Git - strace/commitdiff
Introduce s390_runtime_instr system call decoder
authorEugene Syromyatnikov <evgsyr@gmail.com>
Sun, 14 Jan 2018 08:37:43 +0000 (09:37 +0100)
committerEugene Syromyatnikov <evgsyr@gmail.com>
Mon, 29 Jan 2018 13:10:10 +0000 (14:10 +0100)
* linux/s390/syscallent.h ([342]): Change decoder to s390_runtime_instr.
* linux/s390x/syscallent.h: Likewise.
* s390.c (SYS_FUNC(s390_runtime_instr)): New function.
* xlat/s390_runtime_instr_commands.in: New file.

linux/s390/syscallent.h
linux/s390x/syscallent.h
s390.c
xlat/s390_runtime_instr_commands.in [new file with mode: 0644]

index 522c64154749823903bb6d3dfdab97d4258801f5..a807c958bb81a28491181b127464305c7461f642 100644 (file)
 [339] = { 2,   TD,             SEN(setns),                     "setns"                 },
 [340] = { 6,   0,              SEN(process_vm_readv),          "process_vm_readv"      },
 [341] = { 6,   0,              SEN(process_vm_writev),         "process_vm_writev"     },
-[342] = { 2,   0,              SEN(printargs),                 "s390_runtime_instr"    },
+[342] = { 2,   0,              SEN(s390_runtime_instr),        "s390_runtime_instr"    },
 [343] = { 5,   0,              SEN(kcmp),                      "kcmp"                  },
 [344] = { 3,   TD,             SEN(finit_module),              "finit_module"          },
 [345] = { 3,   0,              SEN(sched_setattr),             "sched_setattr"         },
index 8e068c9907f7eb7ae30359837b2f45cb8eff805a..c4a770d077165d82a39e49ed2583a7c4799c9c0b 100644 (file)
 [339] = { 2,   TD,             SEN(setns),                     "setns"                 },
 [340] = { 6,   0,              SEN(process_vm_readv),          "process_vm_readv"      },
 [341] = { 6,   0,              SEN(process_vm_writev),         "process_vm_writev"     },
-[342] = { 2,   0,              SEN(printargs),                 "s390_runtime_instr"    },
+[342] = { 2,   0,              SEN(s390_runtime_instr),        "s390_runtime_instr"    },
 [343] = { 5,   0,              SEN(kcmp),                      "kcmp"                  },
 [344] = { 3,   TD,             SEN(finit_module),              "finit_module"          },
 [345] = { 3,   0,              SEN(sched_setattr),             "sched_setattr"         },
diff --git a/s390.c b/s390.c
index 2358adb4a08b15ebac4d32a973e3621bd9112a7f..c562382d85bf52e3df70ce28ed2c3e70c7e69960 100644 (file)
--- a/s390.c
+++ b/s390.c
@@ -36,6 +36,7 @@
 #include "print_fields.h"
 
 #include "xlat/s390_guarded_storage_commands.h"
+#include "xlat/s390_runtime_instr_commands.h"
 #include "xlat/s390_sthyi_function_codes.h"
 
 /*
@@ -1210,4 +1211,34 @@ SYS_FUNC(s390_guarded_storage)
        return RVAL_DECODED;
 }
 
+SYS_FUNC(s390_runtime_instr)
+{
+       int command = (int) tcp->u_arg[0];
+       int signum = (int) tcp->u_arg[1];
+
+       const char *command_descr =
+               xlookup(s390_runtime_instr_commands, command);
+
+       tprintf("%d", command);
+       tprints_comment(command_descr ? command_descr :
+                       "S390_RUNTIME_INSTR_???");
+
+       /*
+        * signum is ignored since Linux 4.4, but let's print it for start
+        * command anyway.
+        */
+       switch (command) {
+       case S390_RUNTIME_INSTR_START:
+               tprints(", ");
+               tprints(signame(signum));
+               break;
+
+       case S390_RUNTIME_INSTR_STOP:
+       default:
+               break;
+       }
+
+       return RVAL_DECODED;
+}
+
 #endif /* defined S390 || defined S390X */
diff --git a/xlat/s390_runtime_instr_commands.in b/xlat/s390_runtime_instr_commands.in
new file mode 100644 (file)
index 0000000..395afc4
--- /dev/null
@@ -0,0 +1,2 @@
+S390_RUNTIME_INSTR_START       0x1
+S390_RUNTIME_INSTR_STOP                0x2