s390: simplify s390_runtime_instr command printing

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.
This commit is contained in:
Eugene Syromyatnikov 2018-04-16 01:14:02 +02:00 committed by Dmitry V. Levin
parent 5b4317dcc8
commit e77cec74e0
3 changed files with 11 additions and 13 deletions

5
s390.c
View File

@ -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

View 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

View 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);