From: Dmitry V. Levin Date: Sun, 8 Jan 2017 01:20:59 +0000 (+0000) Subject: sg_io: decode struct sg_io_hdr.flags and struct sg_io_v4.flags X-Git-Tag: v4.16~76 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0f774151a4c76775800dd3d6f28790c7a2bfc183;p=strace sg_io: decode struct sg_io_hdr.flags and struct sg_io_v4.flags Print struct sg_io_hdr.flags and struct sg_io_v4.flags using printflags. * xlat/sg_io_flags.in: New file. * sg_io_v3.c: Include "xlat/sg_io_flags.h". (decode_request): Print struct_sg_io_hdr.flags using printflags. * xlat/bsg_flags.in: New file. * sg_io_v4.c: Include "xlat/bsg_flags.h". (decode_request): Print struct sg_io_v4.flags using printflags. --- diff --git a/sg_io_v3.c b/sg_io_v3.c index ec8a6ae0..6c10ec26 100644 --- a/sg_io_v3.c +++ b/sg_io_v3.c @@ -43,6 +43,7 @@ typedef struct sg_io_hdr struct_sg_io_hdr; #ifdef HAVE_SCSI_SG_H # include "xlat/sg_io_dxfer_direction.h" +# include "xlat/sg_io_flags.h" static void print_sg_io_buffer(struct tcb *const tcp, const kernel_ulong_t addr, @@ -74,7 +75,8 @@ decode_request(struct tcb *const tcp, const kernel_ulong_t arg) tprintf(", iovec_count=%d", sg_io.iovec_count); tprintf(", dxfer_len=%u", sg_io.dxfer_len); tprintf(", timeout=%u", sg_io.timeout); - tprintf(", flags=%#x", sg_io.flags); + tprints(", flags="); + printflags(sg_io_flags, sg_io.flags, "SG_FLAG_???"); if (sg_io.dxfer_direction == SG_DXFER_TO_DEV || sg_io.dxfer_direction == SG_DXFER_TO_FROM_DEV) { diff --git a/sg_io_v4.c b/sg_io_v4.c index ba4a071c..07d8a591 100644 --- a/sg_io_v4.c +++ b/sg_io_v4.c @@ -33,6 +33,7 @@ # include # include "xlat/bsg_protocol.h" # include "xlat/bsg_subprotocol.h" +# include "xlat/bsg_flags.h" static void print_sg_io_buffer(struct tcb *const tcp, const kernel_ulong_t addr, @@ -71,7 +72,8 @@ decode_request(struct tcb *const tcp, const kernel_ulong_t arg) tprintf(", din_iovec_count=%u", sg_io.din_iovec_count); tprintf(", din_xfer_len=%u", sg_io.din_xfer_len); tprintf(", timeout=%u", sg_io.timeout); - tprintf(", flags=%u", sg_io.flags); + tprints(", flags="); + printflags(bsg_flags, sg_io.flags, "BSG_FLAG_???"); tprintf(", usr_ptr=%" PRI__u64, sg_io.usr_ptr); tprintf(", spare_in=%u", sg_io.spare_in); tprintf(", dout[%u]=", sg_io.dout_xfer_len); diff --git a/xlat/bsg_flags.in b/xlat/bsg_flags.in new file mode 100644 index 00000000..2f7bb027 --- /dev/null +++ b/xlat/bsg_flags.in @@ -0,0 +1,2 @@ +BSG_FLAG_Q_AT_TAIL +BSG_FLAG_Q_AT_HEAD diff --git a/xlat/sg_io_flags.in b/xlat/sg_io_flags.in new file mode 100644 index 00000000..f58c3e55 --- /dev/null +++ b/xlat/sg_io_flags.in @@ -0,0 +1,6 @@ +SG_FLAG_DIRECT_IO +SG_FLAG_UNUSED_LUN_INHIBIT +SG_FLAG_MMAP_IO +SG_FLAG_NO_DXFER +SG_FLAG_Q_AT_TAIL +SG_FLAG_Q_AT_HEAD