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.
This commit is contained in:
Дмитрий Левин 2017-01-07 19:09:37 +00:00
parent ff96efe158
commit cdd27d2088

10
scsi.c
View File

@ -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;