Skip to content

Commit

Permalink
tracing: Make ftrace_print_array_seq compute buf_len
Browse files Browse the repository at this point in the history
The only caller to this function (__print_array) was getting it wrong by
passing the array length instead of buffer length. As the element size
was already being passed for other reasons it seems reasonable to push
the calculation of buffer length into the function.

Link: http://lkml.kernel.org/r/1430320727-14582-1-git-send-email-alex.bennee@linaro.org

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
  • Loading branch information
stsquad authored and rostedt committed May 7, 2015
1 parent 5ebe6af commit ac01ce1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion include/linux/ftrace_event.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const char *ftrace_print_hex_seq(struct trace_seq *p,
const unsigned char *buf, int len);

const char *ftrace_print_array_seq(struct trace_seq *p,
const void *buf, int buf_len,
const void *buf, int count,
size_t el_size);

struct trace_iterator;
Expand Down
3 changes: 2 additions & 1 deletion kernel/trace/trace_output.c
Original file line number Diff line number Diff line change
Expand Up @@ -178,12 +178,13 @@ ftrace_print_hex_seq(struct trace_seq *p, const unsigned char *buf, int buf_len)
EXPORT_SYMBOL(ftrace_print_hex_seq);

const char *
ftrace_print_array_seq(struct trace_seq *p, const void *buf, int buf_len,
ftrace_print_array_seq(struct trace_seq *p, const void *buf, int count,
size_t el_size)
{
const char *ret = trace_seq_buffer_ptr(p);
const char *prefix = "";
void *ptr = (void *)buf;
size_t buf_len = count * el_size;

trace_seq_putc(p, '{');

Expand Down

0 comments on commit ac01ce1

Please sign in to comment.