public inbox for linux-s390@vger.kernel.org
 help / color / mirror / Atom feed
* [strace PATCH 03/12] print_fields.h: add macro to print hexadecimal array field
@ 2018-01-18  6:16 Eugene Syromyatnikov
  0 siblings, 0 replies; only message in thread
From: Eugene Syromyatnikov @ 2018-01-18  6:16 UTC (permalink / raw)
  To: linux-s390, strace

* print_fields.h (PRINT_FIELD_HEX_ARRAY): New macro, prints target
array with QUOTE_FORCE_HEX.
---
 print_fields.h | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/print_fields.h b/print_fields.h
index 0af087a..b2c6a30 100644
--- a/print_fields.h
+++ b/print_fields.h
@@ -107,6 +107,15 @@
 				     sizeof((where_).field_));		\
 	} while (0)
 
+#define PRINT_FIELD_HEX_ARRAY(prefix_, where_, field_)			\
+	do {								\
+		STRACE_PRINTF("%s%s=", (prefix_), #field_);		\
+		print_quoted_string((const char *)(where_).field_,	\
+				     sizeof((where_).field_) +		\
+					    MUST_BE_ARRAY((where_).field_), \
+				    QUOTE_FORCE_HEX); \
+	} while (0)
+
 #define PRINT_FIELD_INET_ADDR(prefix_, where_, field_, af_)		\
 	do {								\
 		STRACE_PRINTF(prefix_);					\
-- 
2.1.4

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2018-01-18  6:16 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-18  6:16 [strace PATCH 03/12] print_fields.h: add macro to print hexadecimal array field Eugene Syromyatnikov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox