linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] lib/scatterlist: Provide scatterlist hexdump.
@ 2022-02-09  3:36 chengchaohang
  0 siblings, 0 replies; 5+ messages in thread
From: chengchaohang @ 2022-02-09  3:36 UTC (permalink / raw)
  To: leon, maorg, jgg, logang, thunder.leizhen; +Cc: linux-kernel, chaohang.cheng

From: "chaohang.cheng" <chaohang.cheng@horizon.ai>

A scatterlist hexdump is essential during debug, sometimes.

Signed-off-by: chaohang.cheng <chaohang.cheng@horizon.ai>
---
 include/linux/scatterlist.h | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/include/linux/scatterlist.h b/include/linux/scatterlist.h
index 7ff9d6386c12..ef8ecaac0016 100644
--- a/include/linux/scatterlist.h
+++ b/include/linux/scatterlist.h
@@ -563,4 +563,21 @@ bool sg_miter_skip(struct sg_mapping_iter *miter, off_t offset);
 bool sg_miter_next(struct sg_mapping_iter *miter);
 void sg_miter_stop(struct sg_mapping_iter *miter);
 
+/*
+ * Hexdump scatterlist
+ *
+ * @sg: struct scatterlist* .
+ * it stands for the head of a scatterlist .
+ *
+ * note: print_hex_dump_debug is a dynamic debug .
+ *
+ */
+#define SG_HEXDUMP(sg)							\
+do {									\
+	struct scatterlist *sg_tmp = NULL;				\
+	for (sg_tmp = sg; sg_tmp; sg_tmp = sg_next(sg_tmp))		\
+		print_hex_dump_debug("", DUMP_PREFIX_OFFSET,		\
+			16, 1, sg_virt(sg_tmp), sg_tmp->length, true);	\
+} while (0)
+
 #endif /* _LINUX_SCATTERLIST_H */
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH] lib/scatterlist: Provide scatterlist hexdump.
@ 2022-02-10  3:13 chaohang.cheng
  0 siblings, 0 replies; 5+ messages in thread
From: chaohang.cheng @ 2022-02-10  3:13 UTC (permalink / raw)
  To: leon, maorg, jgg, logang, thunder.leizhen; +Cc: linux-kernel

From: "chaohang.cheng" <chaohang.cheng@horizon.ai>

A scatterlist hexdump is essential during debug, sometimes.

Signed-off-by: chaohang.cheng <chaohang.cheng@horizon.ai>
---
 include/linux/scatterlist.h | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/include/linux/scatterlist.h b/include/linux/scatterlist.h
index 7ff9d6386c12..ef8ecaac0016 100644
--- a/include/linux/scatterlist.h
+++ b/include/linux/scatterlist.h
@@ -563,4 +563,21 @@ bool sg_miter_skip(struct sg_mapping_iter *miter, off_t offset);
 bool sg_miter_next(struct sg_mapping_iter *miter);
 void sg_miter_stop(struct sg_mapping_iter *miter);
 
+/*
+ * Hexdump scatterlist
+ *
+ * @sg: struct scatterlist* .
+ * it stands for the head of a scatterlist .
+ *
+ * note: print_hex_dump_debug is a dynamic debug .
+ *
+ */
+#define SG_HEXDUMP(sg)							\
+do {									\
+	struct scatterlist *sg_tmp = NULL;				\
+	for (sg_tmp = sg; sg_tmp; sg_tmp = sg_next(sg_tmp))		\
+		print_hex_dump_debug("", DUMP_PREFIX_OFFSET,		\
+			16, 1, sg_virt(sg_tmp), sg_tmp->length, true);	\
+} while (0)
+
 #endif /* _LINUX_SCATTERLIST_H */
-- 
2.25.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH] lib/scatterlist: Provide scatterlist hexdump.
@ 2022-02-09  3:51 chengchaohang
  0 siblings, 0 replies; 5+ messages in thread
From: chengchaohang @ 2022-02-09  3:51 UTC (permalink / raw)
  To: leon, maorg, jgg, logang, thunder.leizhen; +Cc: linux-kernel, chaohang . cheng

From: "chaohang.cheng" <chaohang.cheng@horizon.ai>

A scatterlist hexdump is essential during debug, sometimes.

Signed-off-by: chaohang.cheng <chaohang.cheng@horizon.ai>
---
 include/linux/scatterlist.h | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/include/linux/scatterlist.h b/include/linux/scatterlist.h
index 7ff9d6386c12..ef8ecaac0016 100644
--- a/include/linux/scatterlist.h
+++ b/include/linux/scatterlist.h
@@ -563,4 +563,21 @@ bool sg_miter_skip(struct sg_mapping_iter *miter, off_t offset);
 bool sg_miter_next(struct sg_mapping_iter *miter);
 void sg_miter_stop(struct sg_mapping_iter *miter);
 
+/*
+ * Hexdump scatterlist
+ *
+ * @sg: struct scatterlist* .
+ * it stands for the head of a scatterlist .
+ *
+ * note: print_hex_dump_debug is a dynamic debug .
+ *
+ */
+#define SG_HEXDUMP(sg)							\
+do {									\
+	struct scatterlist *sg_tmp = NULL;				\
+	for (sg_tmp = sg; sg_tmp; sg_tmp = sg_next(sg_tmp))		\
+		print_hex_dump_debug("", DUMP_PREFIX_OFFSET,		\
+			16, 1, sg_virt(sg_tmp), sg_tmp->length, true);	\
+} while (0)
+
 #endif /* _LINUX_SCATTERLIST_H */
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH] lib/scatterlist: Provide scatterlist hexdump.
@ 2022-02-09  3:42 chaohang.cheng
  0 siblings, 0 replies; 5+ messages in thread
From: chaohang.cheng @ 2022-02-09  3:42 UTC (permalink / raw)
  To: leon, maorg, jgg, logang, thunder.leizhen; +Cc: linux-kernel

From: "chaohang.cheng" <chaohang.cheng@horizon.ai>

A scatterlist hexdump is essential during debug, sometimes.

Signed-off-by: chaohang.cheng <chaohang.cheng@horizon.ai>
---
 include/linux/scatterlist.h | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/include/linux/scatterlist.h b/include/linux/scatterlist.h
index 7ff9d6386c12..ef8ecaac0016 100644
--- a/include/linux/scatterlist.h
+++ b/include/linux/scatterlist.h
@@ -563,4 +563,21 @@ bool sg_miter_skip(struct sg_mapping_iter *miter, off_t offset);
 bool sg_miter_next(struct sg_mapping_iter *miter);
 void sg_miter_stop(struct sg_mapping_iter *miter);
 
+/*
+ * Hexdump scatterlist
+ *
+ * @sg: struct scatterlist* .
+ * it stands for the head of a scatterlist .
+ *
+ * note: print_hex_dump_debug is a dynamic debug .
+ *
+ */
+#define SG_HEXDUMP(sg)							\
+do {									\
+	struct scatterlist *sg_tmp = NULL;				\
+	for (sg_tmp = sg; sg_tmp; sg_tmp = sg_next(sg_tmp))		\
+		print_hex_dump_debug("", DUMP_PREFIX_OFFSET,		\
+			16, 1, sg_virt(sg_tmp), sg_tmp->length, true);	\
+} while (0)
+
 #endif /* _LINUX_SCATTERLIST_H */
-- 
2.25.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH] lib/scatterlist: Provide scatterlist hexdump.
@ 2022-02-09  3:34 chengchaohang
  0 siblings, 0 replies; 5+ messages in thread
From: chengchaohang @ 2022-02-09  3:34 UTC (permalink / raw)
  To: leon, maorg, jgg, logang, thunder.leizhen; +Cc: linux-kernel, chaohang.cheng

From: "chaohang.cheng" <chaohang.cheng@horizon.ai>

A scatterlist hexdump is essential during debug, sometimes.

Signed-off-by: chaohang.cheng <chaohang.cheng@horizon.ai>
---
 include/linux/scatterlist.h | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/include/linux/scatterlist.h b/include/linux/scatterlist.h
index 7ff9d6386c12..ef8ecaac0016 100644
--- a/include/linux/scatterlist.h
+++ b/include/linux/scatterlist.h
@@ -563,4 +563,21 @@ bool sg_miter_skip(struct sg_mapping_iter *miter, off_t offset);
 bool sg_miter_next(struct sg_mapping_iter *miter);
 void sg_miter_stop(struct sg_mapping_iter *miter);
 
+/*
+ * Hexdump scatterlist
+ *
+ * @sg: struct scatterlist* .
+ * it stands for the head of a scatterlist .
+ *
+ * note: print_hex_dump_debug is a dynamic debug .
+ *
+ */
+#define SG_HEXDUMP(sg)							\
+do {									\
+	struct scatterlist *sg_tmp = NULL;				\
+	for (sg_tmp = sg; sg_tmp; sg_tmp = sg_next(sg_tmp))		\
+		print_hex_dump_debug("", DUMP_PREFIX_OFFSET,		\
+			16, 1, sg_virt(sg_tmp), sg_tmp->length, true);	\
+} while (0)
+
 #endif /* _LINUX_SCATTERLIST_H */
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-02-10  3:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-09  3:36 [PATCH] lib/scatterlist: Provide scatterlist hexdump chengchaohang
  -- strict thread matches above, loose matches on Subject: below --
2022-02-10  3:13 chaohang.cheng
2022-02-09  3:51 chengchaohang
2022-02-09  3:42 chaohang.cheng
2022-02-09  3:34 chengchaohang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).