diff options
author | Daniel Borkmann <daniel@iogearbox.net> | 2017-01-25 02:28:16 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-01-25 13:17:47 -0500 |
commit | 2acae0d5b0f73a8fb4b180bd13491feb96e55fc6 (patch) | |
tree | 2446a003c916ffd69a70a4ec167848c67aa2305b /kernel/trace | |
parent | 60b1af3300724d211bb0b420c1fbe6bf5b87b013 (diff) | |
download | op-kernel-dev-2acae0d5b0f73a8fb4b180bd13491feb96e55fc6.zip op-kernel-dev-2acae0d5b0f73a8fb4b180bd13491feb96e55fc6.tar.gz |
trace: add variant without spacing in trace_print_hex_seq
For upcoming tracepoint support for BPF, we want to dump the program's
tag. Format should be similar to __print_hex(), but without spacing.
Add a __print_hex_str() variant for exactly that purpose that reuses
trace_print_hex_seq().
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'kernel/trace')
-rw-r--r-- | kernel/trace/trace_output.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/kernel/trace/trace_output.c b/kernel/trace/trace_output.c index 5d33a73..30a144b1 100644 --- a/kernel/trace/trace_output.c +++ b/kernel/trace/trace_output.c @@ -163,14 +163,15 @@ trace_print_bitmask_seq(struct trace_seq *p, void *bitmask_ptr, EXPORT_SYMBOL_GPL(trace_print_bitmask_seq); const char * -trace_print_hex_seq(struct trace_seq *p, const unsigned char *buf, int buf_len) +trace_print_hex_seq(struct trace_seq *p, const unsigned char *buf, int buf_len, + bool spacing) { int i; const char *ret = trace_seq_buffer_ptr(p); for (i = 0; i < buf_len; i++) - trace_seq_printf(p, "%s%2.2x", i == 0 ? "" : " ", buf[i]); - + trace_seq_printf(p, "%s%2.2x", !spacing || i == 0 ? "" : " ", + buf[i]); trace_seq_putc(p, 0); return ret; |