diff options
author | Kei Tokunaga <tokunaga.keiich@jp.fujitsu.com> | 2010-04-01 07:40:58 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2010-04-30 13:50:22 -0400 |
commit | 5a2e3995951176e1aaa63d17ae2e1d26ac99003d (patch) | |
tree | 7305a7dc2c1822e5d4fec610d1c9bb6ddfadce70 /kernel/trace | |
parent | 59c31b69d278b760fb84266f99c1dcb0f73ec51d (diff) |
[SCSI] ftrace: add __print_hex()
__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>
Acked-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'kernel/trace')
-rw-r--r-- | kernel/trace/trace_output.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/kernel/trace/trace_output.c b/kernel/trace/trace_output.c index 8e46b3323cdc..7c4a0ca650b5 100644 --- a/kernel/trace/trace_output.c +++ b/kernel/trace/trace_output.c | |||
@@ -355,6 +355,21 @@ ftrace_print_symbols_seq(struct trace_seq *p, unsigned long val, | |||
355 | } | 355 | } |
356 | EXPORT_SYMBOL(ftrace_print_symbols_seq); | 356 | EXPORT_SYMBOL(ftrace_print_symbols_seq); |
357 | 357 | ||
358 | const char * | ||
359 | ftrace_print_hex_seq(struct trace_seq *p, const unsigned char *buf, int buf_len) | ||
360 | { | ||
361 | int i; | ||
362 | const char *ret = p->buffer + p->len; | ||
363 | |||
364 | for (i = 0; i < buf_len; i++) | ||
365 | trace_seq_printf(p, "%s%2.2x", i == 0 ? "" : " ", buf[i]); | ||
366 | |||
367 | trace_seq_putc(p, 0); | ||
368 | |||
369 | return ret; | ||
370 | } | ||
371 | EXPORT_SYMBOL(ftrace_print_hex_seq); | ||
372 | |||
358 | #ifdef CONFIG_KRETPROBES | 373 | #ifdef CONFIG_KRETPROBES |
359 | static inline const char *kretprobed(const char *name) | 374 | static inline const char *kretprobed(const char *name) |
360 | { | 375 | { |