]> granicus.if.org Git - strace/commitdiff
Use tprints instead of tprintf in a few more places
authorDmitry V. Levin <ldv@altlinux.org>
Sat, 18 Feb 2017 00:58:17 +0000 (00:58 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Fri, 17 Feb 2017 23:19:58 +0000 (23:19 +0000)
* 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
dm.c
mq.c
perf.c
syscall.c

diff --git a/bpf.c b/bpf.c
index d78c8042adbac136fd8e1263ae1b96eb020f2259..2c709e174415fe442918a3517facefdbdff74543 100644 (file)
--- 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 7f856895fb0c7c14d501c6c44ce0207d95bab58f..a69077b99b5f4b3c73503d9fc72f45b711e904f5 100644 (file)
--- 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 5b46d478241dd5d213364a18d391ecfb3617bcaa..ed167764c852d8a6600cbe0c6d91f20bf1660875 100644 (file)
--- 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 f151c198fde4872bc1a53bf24521a0f276cba626..d24cde3b0d1286239c90491bc8f50cb14ae6729d 100644 (file)
--- 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)
index c0407ed509b707580a2aa8df25b374f2ee3e0cff..8e62c8b5a4199dcf233fb6a225a3732d9a9238f1 100644 (file)
--- 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);
        }