]> granicus.if.org Git - strace/commitdiff
s390: simplify s390_runtime_instr command printing
authorEugene Syromyatnikov <evgsyr@gmail.com>
Sun, 15 Apr 2018 23:14:02 +0000 (01:14 +0200)
committerDmitry V. Levin <ldv@altlinux.org>
Tue, 8 May 2018 14:25:27 +0000 (14:25 +0000)
As the header with command definitions is now a part of UAPI (since
Linux commit v4.16-rc1~21^2~11), there's no need for a very special
printing routine for command names.

* s390.c (SYS_FUNC(s390_runtime_instr)): Use printxval_d to print
the command argument.
* tests/s390_runtime_instr.c: Update expected output.

s390.c
tests/gen_tests.in
tests/s390_runtime_instr.c

diff --git a/s390.c b/s390.c
index 39377ea49d1c6ea871a7a6abeb35dc2bd9f7f0eb..422c08d3b8977539b2d2668fb82a2f4975b3ba6a 100644 (file)
--- a/s390.c
+++ b/s390.c
@@ -1205,9 +1205,8 @@ SYS_FUNC(s390_runtime_instr)
        int signum = (int) tcp->u_arg[1];
 
 
-       printxvals_ex(command, "S390_RUNTIME_INSTR_???",
-                     XLAT_STYLE_VERBOSE | XLAT_STYLE_FMT_D,
-                     s390_runtime_instr_commands, NULL);
+       printxval_d(s390_runtime_instr_commands, command,
+                   "S390_RUNTIME_INSTR_???");
 
        /*
         * signum is ignored since Linux 4.4, but let's print it for start
index 9814a7ba4fa30f2ad2c2d8f5ddf10d4044e4d297..2e1b8479f577ff9dfb9ec2ab453f4383bc19b0ed 100644 (file)
@@ -353,7 +353,7 @@ rt_tgsigqueueinfo   -esignal=none
 s390_guarded_storage   -a32
 s390_guarded_storage-v -e trace=s390_guarded_storage -a32 -v
 s390_pci_mmio_read_write       -e trace=s390_pci_mmio_read,s390_pci_mmio_write -a30
-s390_runtime_instr     -a50
+s390_runtime_instr     -a44
 s390_sthyi     -a47
 s390_sthyi-v   -e trace=s390_sthyi -a47 -v
 sched  test_trace_expr times -e/sched
index 861bbd4a5ee0bbddaae7f455a2a81521527e4aa2..5d368a1a27ee6a50b702ac0378c5eb97f859a3a3 100644 (file)
@@ -44,10 +44,11 @@ main(void)
                kernel_ulong_t cmd;
                const char * cmd_str;
        } cmd_args[] = {
-               { 0, "???" },
-               { 4, "???" },
-               { (kernel_ulong_t) 0xdeafbeefdeadc0deULL, "???" },
-               { 2, "STOP",  },
+               { 0, "0 /* S390_RUNTIME_INSTR_??? */" },
+               { 4, "4 /* S390_RUNTIME_INSTR_??? */" },
+               { (kernel_ulong_t) 0xdeafbeefdeadc0deULL,
+                       "-559038242 /* S390_RUNTIME_INSTR_??? */" },
+               { 2, "S390_RUNTIME_INSTR_STOP"  },
        };
 
        static struct {
@@ -66,10 +67,8 @@ main(void)
 
        for (i = 0; i < ARRAY_SIZE(cmd_args); i++) {
                rc = syscall(__NR_s390_runtime_instr, cmd_args[i].cmd, 0xdead);
-               printf("s390_runtime_instr(%d /* S390_RUNTIME_INSTR_%s */) = "
-                      "%s\n",
-                      (int) cmd_args[i].cmd, cmd_args[i].cmd_str,
-                      sprintrc(rc));
+               printf("s390_runtime_instr(%s) = %s\n",
+                      cmd_args[i].cmd_str, sprintrc(rc));
        }
 
        for (i = 0; i < ARRAY_SIZE(start_sig_args); i++) {
@@ -77,7 +76,7 @@ main(void)
 
                rc = syscall(__NR_s390_runtime_instr, 1, start_sig_args[i].sig);
                saved_errno = errno;
-               printf("s390_runtime_instr(1 /* S390_RUNTIME_INSTR_START */, ");
+               printf("s390_runtime_instr(S390_RUNTIME_INSTR_START, ");
 
                if (start_sig_args[i].sig_str)
                        printf("%s", start_sig_args[i].sig_str);