From: Dmitry V. Levin Date: Sat, 7 Jan 2017 19:09:37 +0000 (+0000) Subject: scsi: detect and print changes of interface id X-Git-Tag: v4.16~79 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cdd27d2088a7225f4789338dbf54d8db4abf4efe;p=strace scsi: detect and print changes of interface id * scsi.c (print_sg_io_v3_res): Detect and print changes of struct sg_io_hdr.interface_id field between entering and exiting syscall. (print_sg_io_v4_res): Detect and print changes of struct sg_io_v4.guard field between entering and exiting syscall. --- diff --git a/scsi.c b/scsi.c index 68824506..3431f3bf 100644 --- a/scsi.c +++ b/scsi.c @@ -99,6 +99,11 @@ print_sg_io_v3_res(struct tcb *const tcp, const kernel_ulong_t arg) return; } + if (sg_io.interface_id != (unsigned char) 'S') { + tprintf(" => interface_id=%u", sg_io.interface_id); + return; + } + if (sg_io.dxfer_direction == SG_DXFER_FROM_DEV || sg_io.dxfer_direction == SG_DXFER_TO_FROM_DEV) { uint32_t din_len = sg_io.dxfer_len; @@ -182,6 +187,11 @@ print_sg_io_v4_res(struct tcb *const tcp, const kernel_ulong_t arg) return; } + if (sg_io.guard != (unsigned char) 'Q') { + tprintf(" => guard=%u", sg_io.guard); + return; + } + tprintf(", response[%u]=", sg_io.response_len); print_sg_io_buffer(tcp, sg_io.response, sg_io.response_len); din_len = sg_io.din_xfer_len;