All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kei Tokunaga <tokunaga.keiich@jp.fujitsu.com>
To: "linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
	James Bottomley <James.Bottomley@suse.de>,
	Ingo Molnar <mingo@redhat.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Frederic
Cc: Tomohiro Kusumi <kusumi.tomohiro@jp.fujitsu.com>,
	lkml <linux-kernel@vger.kernel.org>,
	Li Zefan <lizf@cn.fujitsu.com>,
	Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>,
	Kei Tokunaga <tokunaga.keiich@jp.fujitsu.com>
Subject: [PATCH 1/2 v3] scsi: add __print_hex() to ftrace
Date: Mon, 15 Feb 2010 18:46:18 +0900	[thread overview]
Message-ID: <4B7917EA.5010401@jp.fujitsu.com> (raw)
In-Reply-To: <4B7914CD.8020508@jp.fujitsu.com>

From: Li Zefan <lizf@cn.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@cn.fujitsu.com>
Signed-off-by: Tomohiro Kusumi <kusumi.tomohiro@jp.fujitsu.com>
Signed-off-by: Kei Tokunaga <tokunaga.keiich@jp.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)
 {

_




WARNING: multiple messages have this Message-ID (diff)
From: Kei Tokunaga <tokunaga.keiich@jp.fujitsu.com>
To: "linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
	James Bottomley <James.Bottomley@suse.de>,
	Ingo Molnar <mingo@redhat.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	"Martin K. Petersen" <martin.petersen@oracle.com>
Cc: Tomohiro Kusumi <kusumi.tomohiro@jp.fujitsu.com>,
	lkml <linux-kernel@vger.kernel.org>,
	Li Zefan <lizf@cn.fujitsu.com>,
	Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>,
	Kei Tokunaga <tokunaga.keiich@jp.fujitsu.com>
Subject: [PATCH 1/2 v3] scsi: add __print_hex() to ftrace
Date: Mon, 15 Feb 2010 18:46:18 +0900	[thread overview]
Message-ID: <4B7917EA.5010401@jp.fujitsu.com> (raw)
In-Reply-To: <4B7914CD.8020508@jp.fujitsu.com>

From: Li Zefan <lizf@cn.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@cn.fujitsu.com>
Signed-off-by: Tomohiro Kusumi <kusumi.tomohiro@jp.fujitsu.com>
Signed-off-by: Kei Tokunaga <tokunaga.keiich@jp.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)
 {

_




  reply	other threads:[~2010-02-15  9:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-15  9:33 [PATCH 0/2 v3] scsi: ftrace based scsi tracing feature Kei Tokunaga
2010-02-15  9:33 ` Kei Tokunaga
2010-02-15  9:46 ` Kei Tokunaga [this message]
2010-02-15  9:46   ` [PATCH 1/2 v3] scsi: add __print_hex() to ftrace Kei Tokunaga
2010-02-15  9:46 ` [PATCH 2/2 v3] scsi: add scsi trace core functions and put trace points Kei Tokunaga
2010-02-15  9:46   ` Kei Tokunaga

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4B7917EA.5010401@jp.fujitsu.com \
    --to=tokunaga.keiich@jp.fujitsu.com \
    --cc=James.Bottomley@suse.de \
    --cc=kusumi.tomohiro@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=lizf@cn.fujitsu.com \
    --cc=mingo@redhat.com \
    --cc=rostedt@goodmis.org \
    --cc=xiaoguangrong@cn.fujitsu.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.