lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 15 Feb 2010 18:46:18 +0900
From:	Kei Tokunaga <tokunaga.keiich@...fujitsu.com>
To:	"linux-scsi@...r.kernel.org" <linux-scsi@...r.kernel.org>,
	James Bottomley <James.Bottomley@...e.de>,
	Ingo Molnar <mingo@...hat.com>,
	Steven Rostedt <rostedt@...dmis.org>,
	Frederic Weisbecker <fweisbec@...il.com>,
	"Martin K. Petersen" <martin.petersen@...cle.com>
CC:	Tomohiro Kusumi <kusumi.tomohiro@...fujitsu.com>,
	lkml <linux-kernel@...r.kernel.org>,
	Li Zefan <lizf@...fujitsu.com>,
	Xiao Guangrong <xiaoguangrong@...fujitsu.com>,
	Kei Tokunaga <tokunaga.keiich@...fujitsu.com>
Subject: [PATCH 1/2 v3] scsi: add __print_hex() to ftrace

From: Li Zefan <lizf@...fujitsu.com>

This is the same patch from v1.

__print_hex() prints values in an array in hex (w/o '0x') (space separated)
EX) 92 33 32 f3 ee 4d

Signed-off-by: Li Zefan <lizf@...fujitsu.com>
Signed-off-by: Tomohiro Kusumi <kusumi.tomohiro@...fujitsu.com>
Signed-off-by: Kei Tokunaga <tokunaga.keiich@...fujitsu.com>


---

 linux-2.6.33-rc8-trace-kei/include/linux/ftrace_event.h |    3 +++
 linux-2.6.33-rc8-trace-kei/include/trace/ftrace.h       |    3 +++
 linux-2.6.33-rc8-trace-kei/kernel/trace/trace_output.c  |   15 +++++++++++++++
 3 files changed, 21 insertions(+)

diff -puN include/linux/ftrace_event.h~ftrace_print_hex include/linux/ftrace_event.h
--- linux-2.6.33-rc8-trace/include/linux/ftrace_event.h~ftrace_print_hex	2010-02-15 17:25:31.000000000 +0900
+++ linux-2.6.33-rc8-trace-kei/include/linux/ftrace_event.h	2010-02-15 17:25:31.000000000 +0900
@@ -24,6 +24,9 @@ const char *ftrace_print_flags_seq(struc
 const char *ftrace_print_symbols_seq(struct trace_seq *p, unsigned long val,
 				     const struct trace_print_flags *symbol_array);
 
+const char *ftrace_print_hex_seq(struct trace_seq *p,
+				 const unsigned char *buf, int len);
+
 /*
  * The trace entry - the most basic unit of tracing. This is what
  * is printed in the end as a single line in the trace output, such as:
diff -puN include/trace/ftrace.h~ftrace_print_hex include/trace/ftrace.h
--- linux-2.6.33-rc8-trace/include/trace/ftrace.h~ftrace_print_hex	2010-02-15 17:25:31.000000000 +0900
+++ linux-2.6.33-rc8-trace-kei/include/trace/ftrace.h	2010-02-15 17:25:31.000000000 +0900
@@ -321,6 +321,9 @@ ftrace_format_##name(struct ftrace_event
 		ftrace_print_symbols_seq(p, value, symbols);		\
 	})
 
+#undef __print_hex
+#define __print_hex(buf, buf_len) ftrace_print_hex_seq(p, buf, buf_len)
+
 #undef DECLARE_EVENT_CLASS
 #define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print)	\
 static enum print_line_t						\
diff -puN kernel/trace/trace_output.c~ftrace_print_hex kernel/trace/trace_output.c
--- linux-2.6.33-rc8-trace/kernel/trace/trace_output.c~ftrace_print_hex	2010-02-15 17:25:31.000000000 +0900
+++ linux-2.6.33-rc8-trace-kei/kernel/trace/trace_output.c	2010-02-15 17:25:31.000000000 +0900
@@ -355,6 +355,21 @@ ftrace_print_symbols_seq(struct trace_se
 }
 EXPORT_SYMBOL(ftrace_print_symbols_seq);
 
+const char *
+ftrace_print_hex_seq(struct trace_seq *p, const unsigned char *buf, int buf_len)
+{
+	int i;
+	const char *ret = p->buffer + p->len;
+
+	for (i = 0; i < buf_len; i++)
+		trace_seq_printf(p, "%s%2.2x", i == 0 ? "" : " ", buf[i]);
+
+	trace_seq_putc(p, 0);
+
+	return ret;
+}
+EXPORT_SYMBOL(ftrace_print_hex_seq);
+
 #ifdef CONFIG_KRETPROBES
 static inline const char *kretprobed(const char *name)
 {

_



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists