Commit c985f781 authored by Ingo Molnar's avatar Ingo Molnar

Merge tag 'perf-urgent-for-mingo' of...

Merge tag 'perf-urgent-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent

Fixes for the recently merged libtraceevent, from Arnaldo Carvalho de Melo:

* Selected fixes for libtraceevent, from various contributors, submitter by
  Namhyung Kim in agreement with Steven Rostedt, all from the trace-cmd repo,
  i.e. they have been in use for quite a while in trace-cmd.
Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
parents e76df19b eaec12d7
...@@ -1434,8 +1434,11 @@ static int event_read_fields(struct event_format *event, struct format_field **f ...@@ -1434,8 +1434,11 @@ static int event_read_fields(struct event_format *event, struct format_field **f
fail: fail:
free_token(token); free_token(token);
fail_expect: fail_expect:
if (field) if (field) {
free(field->type);
free(field->name);
free(field); free(field);
}
return -1; return -1;
} }
...@@ -1712,6 +1715,8 @@ process_op(struct event_format *event, struct print_arg *arg, char **tok) ...@@ -1712,6 +1715,8 @@ process_op(struct event_format *event, struct print_arg *arg, char **tok)
if (set_op_prio(arg) == -1) { if (set_op_prio(arg) == -1) {
event->flags |= EVENT_FL_FAILED; event->flags |= EVENT_FL_FAILED;
/* arg->op.op (= token) will be freed at out_free */
arg->op.op = NULL;
goto out_free; goto out_free;
} }
...@@ -2124,6 +2129,13 @@ process_fields(struct event_format *event, struct print_flag_sym **list, char ** ...@@ -2124,6 +2129,13 @@ process_fields(struct event_format *event, struct print_flag_sym **list, char **
free_token(token); free_token(token);
type = process_arg(event, arg, &token); type = process_arg(event, arg, &token);
if (type == EVENT_OP)
type = process_op(event, arg, &token);
if (type == EVENT_ERROR)
goto out_free;
if (test_type_token(type, token, EVENT_DELIM, ",")) if (test_type_token(type, token, EVENT_DELIM, ","))
goto out_free; goto out_free;
...@@ -2288,17 +2300,18 @@ process_dynamic_array(struct event_format *event, struct print_arg *arg, char ** ...@@ -2288,17 +2300,18 @@ process_dynamic_array(struct event_format *event, struct print_arg *arg, char **
arg = alloc_arg(); arg = alloc_arg();
type = process_arg(event, arg, &token); type = process_arg(event, arg, &token);
if (type == EVENT_ERROR) if (type == EVENT_ERROR)
goto out_free; goto out_free_arg;
if (!test_type_token(type, token, EVENT_OP, "]")) if (!test_type_token(type, token, EVENT_OP, "]"))
goto out_free; goto out_free_arg;
free_token(token); free_token(token);
type = read_token_item(tok); type = read_token_item(tok);
return type; return type;
out_free_arg:
free_arg(arg);
out_free: out_free:
free(arg);
free_token(token); free_token(token);
*tok = NULL; *tok = NULL;
return EVENT_ERROR; return EVENT_ERROR;
...@@ -3362,6 +3375,7 @@ process_defined_func(struct trace_seq *s, void *data, int size, ...@@ -3362,6 +3375,7 @@ process_defined_func(struct trace_seq *s, void *data, int size,
break; break;
} }
farg = farg->next; farg = farg->next;
param = param->next;
} }
ret = (*func_handle->func)(s, args); ret = (*func_handle->func)(s, args);
......
...@@ -325,9 +325,8 @@ static void free_events(struct event_list *events) ...@@ -325,9 +325,8 @@ static void free_events(struct event_list *events)
} }
static struct filter_arg * static struct filter_arg *
create_arg_item(struct event_format *event, create_arg_item(struct event_format *event, const char *token,
const char *token, enum filter_arg_type type, enum event_type type, char **error_str)
char **error_str)
{ {
struct format_field *field; struct format_field *field;
struct filter_arg *arg; struct filter_arg *arg;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment