[PATCH 14/15] process_vm: Remove syserror check for iovec printing
Eugene Syromyatnikov
evgsyr at gmail.com
Sat Oct 15 01:26:13 UTC 2016
This check had been done by print_array inside tprint_iov anyway.
* process_vm.c (SYS_FUNC(process_vm_readv)): Use tprint_iov_upto for
printing local_iov; do not check for syserror, provide decode_iov
parameter to tprint_iov{,_upto} based on its value instead.
---
process_vm.c | 17 +++++------------
1 file changed, 5 insertions(+), 12 deletions(-)
diff --git a/process_vm.c b/process_vm.c
index 3227036..0538f7d 100644
--- a/process_vm.c
+++ b/process_vm.c
@@ -39,21 +39,14 @@ SYS_FUNC(process_vm_readv)
unsigned long long flags = getarg_ull(tcp, 5);
/* arg 2: local iov */
- if (syserror(tcp)) {
- printaddr(tcp->u_arg[1]);
- } else {
- tprint_iov(tcp, local_iovcnt, tcp->u_arg[1],
- IOV_DECODE_STR);
- }
+ tprint_iov_upto(tcp, local_iovcnt, tcp->u_arg[1],
+ syserror(tcp) ? IOV_DECODE_ADDR : IOV_DECODE_STR,
+ tcp->u_rval);
/* arg 3: local iovcnt */
tprintf(", %llu, ", local_iovcnt);
/* arg 4: remote iov */
- if (syserror(tcp)) {
- printaddr(tcp->u_arg[3]);
- } else {
- tprint_iov(tcp, remote_iovcnt, tcp->u_arg[3],
- IOV_DECODE_ADDR);
- }
+ tprint_iov(tcp, remote_iovcnt, tcp->u_arg[3],
+ IOV_DECODE_ADDR);
/* arg 5: remote iovcnt */
/* arg 6: flags */
tprintf(", %llu, %llu", remote_iovcnt, flags);
--
1.7.10.4
More information about the Strace-devel
mailing list