summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Syromyatnikov <evgsyr@gmail.com>2022-08-24 19:16:07 +0200
committerEugene Syromyatnikov <evgsyr@gmail.com>2022-09-02 17:55:13 +0200
commitdc9fcb045dfb9a360076eb3777bf3405105ccfe9 (patch)
treec597416e7b91f6f67ceb18a5503132f0eb832e4c
parentf5634327bcd0604da126821938d4bb67af25f3b7 (diff)
downloadstrace-dc9fcb045dfb9a360076eb3777bf3405105ccfe9.tar.gz
src: use print_xlat for printing of named constants where possible
-rw-r--r--src/ioctl.c12
-rw-r--r--src/sockaddr.c4
2 files changed, 11 insertions, 5 deletions
diff --git a/src/ioctl.c b/src/ioctl.c
index 60dffa7aa..90355ed35 100644
--- a/src/ioctl.c
+++ b/src/ioctl.c
@@ -247,7 +247,9 @@ ioctl_decode_command_number(struct tcb *tcp)
switch (_IOC_TYPE(code)) {
case '!': /* 0x21 */
if (code == _IOC(_IOC_READ, '!', 2, sizeof(uint64_t))) {
- tprints("SECCOMP_IOCTL_NOTIF_ID_VALID_WRONG_DIR");
+ print_xlat_ex(code,
+ "SECCOMP_IOCTL_NOTIF_ID_VALID_WRONG_DIR",
+ XLAT_STYLE_ABBREV);
return 1;
}
return 0;
@@ -448,10 +450,14 @@ SYS_FUNC(ioctl)
if (iop) {
if (ret)
tprint_alternative_value();
- tprints(iop->symbol);
+ print_xlat_ex(tcp->u_arg[1],
+ iop->symbol,
+ XLAT_STYLE_ABBREV);
while ((iop = ioctl_next_match(iop))) {
tprint_alternative_value();
- tprints(iop->symbol);
+ print_xlat_ex(tcp->u_arg[1],
+ iop->symbol,
+ XLAT_STYLE_ABBREV);
}
} else if (!ret) {
ioctl_print_code(tcp->u_arg[1]);
diff --git a/src/sockaddr.c b/src/sockaddr.c
index 55c9486bd..c210b03d0 100644
--- a/src/sockaddr.c
+++ b/src/sockaddr.c
@@ -617,7 +617,7 @@ print_bluetooth_l2_psm(uint16_t psm)
tprint_comment_begin();
if (psm_name) {
- tprints(psm_name);
+ print_xlat_ex(psm_he, psm_name, XLAT_STYLE_ABBREV);
} else if (psm_he >= L2CAP_PSM_LE_DYN_START
&& psm_he <= L2CAP_PSM_LE_DYN_END) {
print_xlat(L2CAP_PSM_LE_DYN_START);
@@ -657,7 +657,7 @@ print_bluetooth_l2_cid(uint16_t cid)
tprint_comment_begin();
if (cid_name) {
- tprints(cid_name);
+ print_xlat_ex(cid_he, cid_name, XLAT_STYLE_ABBREV);
} else if (cid_he >= L2CAP_CID_DYN_START) {
print_xlat(L2CAP_CID_DYN_START);
tprint_plus();