diff options
author | Dmitry V. Levin <ldv@strace.io> | 2021-07-14 08:00:00 +0000 |
---|---|---|
committer | Dmitry V. Levin <ldv@strace.io> | 2021-07-14 08:00:00 +0000 |
commit | e77ad907a5a186037fbe458b36218ccb6d7da151 (patch) | |
tree | a7d4b5a2b4f78f5a7db771723117fbfe1645657e /src/perf.c | |
parent | bdc51e3be2c4361762a649c89186b6d2c8fa3b0d (diff) | |
download | strace-e77ad907a5a186037fbe458b36218ccb6d7da151.tar.gz |
perf: use more print_fields.h helpers
* src/perf.c (print_perf_event_attr): Use PRINT_VAL_X and
tprintf_comment.
Diffstat (limited to 'src/perf.c')
-rw-r--r-- | src/perf.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/perf.c b/src/perf.c index b88c95ccd..805bfb649 100644 --- a/src/perf.c +++ b/src/perf.c @@ -158,7 +158,8 @@ print_perf_event_attr(struct tcb *const tcp, const kernel_ulong_t addr) tprint_struct_next(); tprints_field_name("config"); if (attr->config >> 32) { - tprintf("%#" PRIx64 "<<32|", attr->config >> 32); + PRINT_VAL_X(attr->config >> 32); + tprints("<<32|"); } printxval(perf_hw_id, attr->config & PERF_HW_EVENT_MASK, "PERF_COUNT_HW_???"); @@ -188,11 +189,12 @@ print_perf_event_attr(struct tcb *const tcp, const kernel_ulong_t addr) tprint_struct_next(); tprints_field_name("config"); if (attr->config >> 32){ - tprintf("%#" PRIx64 "<<32|", attr->config >> 32); + PRINT_VAL_X(attr->config >> 32); + tprints("<<32|"); } if ((attr->config & PERF_HW_EVENT_MASK) >> 24) { - tprintf("%#" PRIx64 "<<24|", - (attr->config & PERF_HW_EVENT_MASK) >> 24); + PRINT_VAL_X((attr->config & PERF_HW_EVENT_MASK) >> 24); + tprints("<<24|"); } printxval(perf_hw_cache_op_result_id, (attr->config >> 16) & 0xFF, @@ -392,7 +394,7 @@ print_perf_event_attr(struct tcb *const tcp, const kernel_ulong_t addr) STRACE_PERF_CHECK_FIELD(__reserved_2); if (attr->__reserved_2) - tprintf(" /* bytes 110..111: %#hx */", attr->__reserved_2); + tprintf_comment("bytes 110..111: %#hx", attr->__reserved_2); STRACE_PERF_CHECK_FIELD(aux_sample_size); tprint_struct_next(); @@ -400,7 +402,7 @@ print_perf_event_attr(struct tcb *const tcp, const kernel_ulong_t addr) STRACE_PERF_CHECK_FIELD(__reserved_3); if (attr->__reserved_3) - tprintf(" /* bytes 116..119: %#x */", attr->__reserved_3); + tprintf_comment("bytes 116..119: %#x", attr->__reserved_3); STRACE_PERF_CHECK_FIELD(sig_data); tprint_struct_next(); |