From 55d126a8d7dfedf51a862c377db36ce674b478d1 Mon Sep 17 00:00:00 2001 From: "Dmitry V. Levin" Date: Sat, 18 Feb 2017 00:58:17 +0000 Subject: [PATCH] Use tprints instead of tprintf in a few more places * bpf.c (bpf_obj_manage, bpf_prog_attach_detach): Replace tprintf with tprints for printing strings without format specifiers. * dm.c (dm_decode_dm_target_spec): Likewise. * mq.c (SYS_FUNC(mq_timedreceive)): Likewise. * perf.c (print_perf_event_attr): Likewise. * syscall.c (trace_syscall_exiting): Likewise. --- bpf.c | 14 +++++++------- dm.c | 2 +- mq.c | 2 +- perf.c | 16 ++++++++-------- syscall.c | 2 +- 5 files changed, 18 insertions(+), 18 deletions(-) diff --git a/bpf.c b/bpf.c index d78c8042..2c709e17 100644 --- a/bpf.c +++ b/bpf.c @@ -198,11 +198,11 @@ bpf_obj_manage(struct tcb *const tcp, const kernel_ulong_t addr, if (umoven_or_printaddr(tcp, addr, size, &attr)) return RVAL_DECODED | RVAL_FD; - tprintf("{pathname="); + tprints("{pathname="); printpath(tcp, attr.pathname); tprints(", bpf_fd="); printfd(tcp, attr.bpf_fd); - tprintf("}"); + tprints("}"); return RVAL_DECODED | RVAL_FD; } @@ -224,19 +224,19 @@ bpf_prog_attach_detach(struct tcb *const tcp, const kernel_ulong_t addr, if (umoven_or_printaddr(tcp, addr, size, &attr)) return RVAL_DECODED; - tprintf("{target_fd="); + tprints("{target_fd="); printfd(tcp, attr.target_fd); if (print_attach) { - tprintf(", attach_bpf_fd="); + tprints(", attach_bpf_fd="); printfd(tcp, attr.attach_bpf_fd); } - tprintf(", attach_type="); + tprints(", attach_type="); printxval(bpf_attach_type, attr.attach_type, "BPF_???"); if (print_attach) { - tprintf(", attach_flags="); + tprints(", attach_flags="); printflags(bpf_attach_flags, attr.attach_flags, "BPF_F_???"); } - tprintf("}"); + tprints("}"); return RVAL_DECODED; } diff --git a/dm.c b/dm.c index 7f856895..a69077b9 100644 --- a/dm.c +++ b/dm.c @@ -180,7 +180,7 @@ dm_decode_dm_target_spec(struct tcb *const tcp, const kernel_ulong_t addr, tprints(", string="); printstr_ex(tcp, addr + offset_end, ioc->data_size - offset_end, QUOTE_0_TERMINATED); - tprintf("}"); + tprints("}"); if (entering(tcp)) offset += s.next; diff --git a/mq.c b/mq.c index 5b46d478..ed167764 100644 --- a/mq.c +++ b/mq.c @@ -66,7 +66,7 @@ SYS_FUNC(mq_timedreceive) printstrn(tcp, tcp->u_arg[1], tcp->u_rval); tprintf(", %" PRI_klu ", ", tcp->u_arg[2]); printnum_int(tcp, tcp->u_arg[3], "%u"); - tprintf(", "); + tprints(", "); /* * Since the timeout parameter is read by the kernel * on entering syscall, it has to be decoded the same way diff --git a/perf.c b/perf.c index f151c198..d24cde3b 100644 --- a/perf.c +++ b/perf.c @@ -160,7 +160,7 @@ print_perf_event_attr(struct tcb *const tcp, const kernel_ulong_t addr) } PRINT_XLAT("{type=", perf_type_id, attr->type, "PERF_TYPE_???"); - tprintf(", size="); + tprints(", size="); printxval(perf_attr_size, attr->size, "PERF_ATTR_SIZE_???"); if (use_new_size) { @@ -217,7 +217,7 @@ print_perf_event_attr(struct tcb *const tcp, const kernel_ulong_t addr) PRINT_XLAT("<<8|", perf_hw_cache_op_result_id, (attr->config >> 16) & 0xFF, "PERF_COUNT_HW_CACHE_RESULT_???"); - tprintf("<<16"); + tprints("<<16"); if (attr->config >> 24) tprintf("|%#" PRIx64 "<<24 " "/* PERF_COUNT_HW_CACHE_??? */", @@ -253,11 +253,11 @@ print_perf_event_attr(struct tcb *const tcp, const kernel_ulong_t addr) else tprintf(", sample_period=%" PRIu64, attr->sample_period); - tprintf(", sample_type="); + tprints(", sample_type="); printflags64(perf_event_sample_format, attr->sample_type, "PERF_SAMPLE_???"); - tprintf(", read_format="); + tprints(", read_format="); printflags64(perf_event_read_format, attr->read_format, "PERF_FORMAT_???"); @@ -355,7 +355,7 @@ print_perf_event_attr(struct tcb *const tcp, const kernel_ulong_t addr) _PERF_CHECK_FIELD(branch_sample_type); if (attr->sample_type & PERF_SAMPLE_BRANCH_STACK) { - tprintf(", branch_sample_type="); + tprints(", branch_sample_type="); printflags64(perf_branch_sample_type, attr->branch_sample_type, "PERF_SAMPLE_BRANCH_???"); } @@ -380,7 +380,7 @@ print_perf_event_attr(struct tcb *const tcp, const kernel_ulong_t addr) if (attr->use_clockid) { _PERF_CHECK_FIELD(clockid); - tprintf(", clockid="); + tprints(", clockid="); printxval(clocknames, attr->clockid, "CLOCK_???"); } @@ -399,9 +399,9 @@ print_perf_event_attr(struct tcb *const tcp, const kernel_ulong_t addr) print_perf_event_attr_out: if ((attr->size && (attr->size > size)) || (!attr->size && (size < PERF_ATTR_SIZE_VER0))) - tprintf(", ..."); + tprints(", ..."); - tprintf("}"); + tprints("}"); } SYS_FUNC(perf_event_open) diff --git a/syscall.c b/syscall.c index c0407ed5..8e62c8b5 100644 --- a/syscall.c +++ b/syscall.c @@ -910,7 +910,7 @@ trace_syscall_exiting(struct tcb *tcp) break; } if (syscall_tampered(tcp)) - tprintf(" (INJECTED)"); + tprints(" (INJECTED)"); if ((sys_res & RVAL_STR) && tcp->auxstr) tprintf(" (%s)", tcp->auxstr); } -- 2.40.0