]> granicus.if.org Git - strace/commitdiff
sg_io: decode struct sg_io_hdr.info and struct sg_io_v4.info
authorDmitry V. Levin <ldv@altlinux.org>
Sun, 8 Jan 2017 03:27:18 +0000 (03:27 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Sun, 8 Jan 2017 03:30:23 +0000 (03:30 +0000)
Print struct sg_io_hdr.info and struct sg_io_v4.info using printflags.

* xlat/sg_io_info.in: New file.
* defs.h (sg_io_info): New xlat prototype.
* sg_io_v3.c: Include "xlat/sg_io_info.h".
(decode_response): Print struct_sg_io_hdr.info using printflags.
* sg_io_v4.c: (decode_response): Print struct sg_io_v4.info
using printflags.

defs.h
sg_io_v3.c
sg_io_v4.c
xlat/sg_io_info.in [new file with mode: 0644]

diff --git a/defs.h b/defs.h
index eae3987445333aaebd6f63523edd4b16095a296a..09c0a5f9f6aeffc7fbc9d0d6189b7962db94a921 100644 (file)
--- a/defs.h
+++ b/defs.h
@@ -295,6 +295,7 @@ extern const struct xlat msg_flags[];
 extern const struct xlat open_access_modes[];
 extern const struct xlat open_mode_flags[];
 extern const struct xlat resource_flags[];
+extern const struct xlat sg_io_info[];
 extern const struct xlat socketlayers[];
 extern const struct xlat whence_codes[];
 
index 6c10ec264d2b6f748a212605fecec3c5cf438deb..b60cc9222cef69eb0f527349816da70ebc732d2f 100644 (file)
@@ -41,6 +41,8 @@ typedef struct sg_io_hdr struct_sg_io_hdr;
 
 #include MPERS_DEFS
 
+#include "xlat/sg_io_info.h"
+
 #ifdef HAVE_SCSI_SG_H
 # include "xlat/sg_io_dxfer_direction.h"
 # include "xlat/sg_io_flags.h"
@@ -132,7 +134,8 @@ decode_response(struct tcb *const tcp, const kernel_ulong_t arg)
        tprintf(", driver_status=%#x", sg_io.driver_status);
        tprintf(", resid=%d", sg_io.resid);
        tprintf(", duration=%d", sg_io.duration);
-       tprintf(", info=%#x", sg_io.info);
+       tprints(", info=");
+       printflags(sg_io_info, sg_io.info, "SG_INFO_???");
 
        return RVAL_DECODED | 1;
 }
index 07d8a5918d0433b959c752f6bab18429d50a1ba4..7deff41c4497c7e6781fc08e55c964aa6615d9d9 100644 (file)
@@ -117,7 +117,8 @@ decode_response(struct tcb *const tcp, const kernel_ulong_t arg)
        tprintf(", transport_status=%u", sg_io.transport_status);
        tprintf(", device_status=%u", sg_io.device_status);
        tprintf(", retry_delay=%u", sg_io.retry_delay);
-       tprintf(", info=%u", sg_io.info);
+       tprints(", info=");
+       printflags(sg_io_info, sg_io.info, "SG_INFO_???");
        tprintf(", duration=%u", sg_io.duration);
        tprintf(", response_len=%u", sg_io.response_len);
        tprintf(", din_resid=%u", sg_io.din_resid);
diff --git a/xlat/sg_io_info.in b/xlat/sg_io_info.in
new file mode 100644 (file)
index 0000000..afebe4f
--- /dev/null
@@ -0,0 +1,3 @@
+SG_INFO_CHECK          1
+SG_INFO_DIRECT_IO      2
+SG_INFO_MIXED_IO       4