From 0503b6948626b82c3cd8085a74df5f4eba7e69e7 Mon Sep 17 00:00:00 2001 From: "Dmitry V. Levin" Date: Sun, 8 Jan 2017 03:27:18 +0000 Subject: [PATCH] sg_io: decode struct sg_io_hdr.info and struct sg_io_v4.info 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 | 1 + sg_io_v3.c | 5 ++++- sg_io_v4.c | 3 ++- xlat/sg_io_info.in | 3 +++ 4 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 xlat/sg_io_info.in diff --git a/defs.h b/defs.h index eae39874..09c0a5f9 100644 --- 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[]; diff --git a/sg_io_v3.c b/sg_io_v3.c index 6c10ec26..b60cc922 100644 --- a/sg_io_v3.c +++ b/sg_io_v3.c @@ -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; } diff --git a/sg_io_v4.c b/sg_io_v4.c index 07d8a591..7deff41c 100644 --- a/sg_io_v4.c +++ b/sg_io_v4.c @@ -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 index 00000000..afebe4f3 --- /dev/null +++ b/xlat/sg_io_info.in @@ -0,0 +1,3 @@ +SG_INFO_CHECK 1 +SG_INFO_DIRECT_IO 2 +SG_INFO_MIXED_IO 4 -- 2.40.0