]> granicus.if.org Git - strace/commitdiff
sg_io: decode struct sg_io_hdr.flags and struct sg_io_v4.flags
authorDmitry V. Levin <ldv@altlinux.org>
Sun, 8 Jan 2017 01:20:59 +0000 (01:20 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Sun, 8 Jan 2017 03:30:02 +0000 (03:30 +0000)
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.

sg_io_v3.c
sg_io_v4.c
xlat/bsg_flags.in [new file with mode: 0644]
xlat/sg_io_flags.in [new file with mode: 0644]

index ec8a6ae01fdd317d3d9a2c63cc06b7670faac9cc..6c10ec264d2b6f748a212605fecec3c5cf438deb 100644 (file)
@@ -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) {
index ba4a071c25020dc23d4b82ab13031c1faa7af1af..07d8a5918d0433b959c752f6bab18429d50a1ba4 100644 (file)
@@ -33,6 +33,7 @@
 # include <linux/bsg.h>
 # 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 (file)
index 0000000..2f7bb02
--- /dev/null
@@ -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 (file)
index 0000000..f58c3e5
--- /dev/null
@@ -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