lkml.org 
[lkml]   [2018]   [Feb]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH 20/20 v2] tracing: Add argument error message too many args for function based events
From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>

If too many arguments are added to the function_events, have the error
message state that instead of saying the type of argument that passed the
allowed amount is incorrect.

Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
kernel/trace/trace_event_ftrace.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/kernel/trace/trace_event_ftrace.c b/kernel/trace/trace_event_ftrace.c
index 314d025dc676..e612b1c4fc40 100644
--- a/kernel/trace/trace_event_ftrace.c
+++ b/kernel/trace/trace_event_ftrace.c
@@ -1380,8 +1380,14 @@ static void add_failure(struct func_event *func_event, char *token,

trace_seq_printf(s, "\n%*s\n", len, "^");

- trace_seq_printf(s, "Unexpected token '%s' for %s state",
- save_token, func_state_names[state]);
+ /* for COMMA or PARAM state, the error could be too many args */
+ if ((state == FUNC_STATE_COMMA || state == FUNC_STATE_PARAM) &&
+ func_event->arg_cnt >= max_args)
+ trace_seq_printf(s, "Error: Too many arguments (max of %d)",
+ max_args);
+ else
+ trace_seq_printf(s, "Unexpected token '%s' for %s state",
+ save_token, func_state_names[state]);

finish:
len = min(ERR_SIZE-1, s->seq.len);
--
2.15.1

\
 
 \ /
  Last update: 2018-02-07 21:31    [W:0.097 / U:7.640 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site