ioctl: print ioctl number in accordance with xlat verbosity setting
* ioctl.c (SYS_FUNC(ioctl)): Print ioctl command name in accordance with the current xlat_verbosity setting. * tests/btrfs.c (sprint_xlat_): New function. (ioc): New macro, a wrapper for sprint_xlat_. Update expected output.
This commit is contained in:
parent
a2b07d60d7
commit
9f1a22244f
32
ioctl.c
32
ioctl.c
@ -339,19 +339,29 @@ SYS_FUNC(ioctl)
|
||||
if (entering(tcp)) {
|
||||
printfd(tcp, tcp->u_arg[0]);
|
||||
tprints(", ");
|
||||
ret = ioctl_decode_command_number(tcp);
|
||||
if (!(ret & IOCTL_NUMBER_STOP_LOOKUP)) {
|
||||
iop = ioctl_lookup(tcp->u_arg[1]);
|
||||
if (iop) {
|
||||
if (ret)
|
||||
tprints(" or ");
|
||||
tprints(iop->symbol);
|
||||
while ((iop = ioctl_next_match(iop)))
|
||||
tprintf(" or %s", iop->symbol);
|
||||
} else if (!ret) {
|
||||
ioctl_print_code(tcp->u_arg[1]);
|
||||
|
||||
if (xlat_verbosity != XLAT_STYLE_ABBREV)
|
||||
tprintf("%#x", (unsigned int) tcp->u_arg[1]);
|
||||
if (xlat_verbosity == XLAT_STYLE_VERBOSE)
|
||||
tprints(" /* ");
|
||||
if (xlat_verbosity != XLAT_STYLE_RAW) {
|
||||
ret = ioctl_decode_command_number(tcp);
|
||||
if (!(ret & IOCTL_NUMBER_STOP_LOOKUP)) {
|
||||
iop = ioctl_lookup(tcp->u_arg[1]);
|
||||
if (iop) {
|
||||
if (ret)
|
||||
tprints(" or ");
|
||||
tprints(iop->symbol);
|
||||
while ((iop = ioctl_next_match(iop)))
|
||||
tprintf(" or %s", iop->symbol);
|
||||
} else if (!ret) {
|
||||
ioctl_print_code(tcp->u_arg[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (xlat_verbosity == XLAT_STYLE_VERBOSE)
|
||||
tprints(" */");
|
||||
|
||||
ret = ioctl_decode(tcp);
|
||||
} else {
|
||||
ret = ioctl_decode(tcp) | RVAL_DECODED;
|
||||
|
469
tests/btrfs.c
469
tests/btrfs.c
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user