Skip to content

Commit

Permalink
Merge tag 'perf-urgent-for-mingo' of git://git.kernel.org/pub/scm/lin…
Browse files Browse the repository at this point in the history
…ux/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: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
  • Loading branch information
Ingo Molnar committed May 24, 2012
2 parents e76df19 + eaec12d commit c985f78
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 7 deletions.
22 changes: 18 additions & 4 deletions tools/lib/traceevent/event-parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -1434,8 +1434,11 @@ static int event_read_fields(struct event_format *event, struct format_field **f
fail:
free_token(token);
fail_expect:
if (field)
if (field) {
free(field->type);
free(field->name);
free(field);
}
return -1;
}

Expand Down Expand Up @@ -1712,6 +1715,8 @@ process_op(struct event_format *event, struct print_arg *arg, char **tok)

if (set_op_prio(arg) == -1) {
event->flags |= EVENT_FL_FAILED;
/* arg->op.op (= token) will be freed at out_free */
arg->op.op = NULL;
goto out_free;
}

Expand Down Expand Up @@ -2124,6 +2129,13 @@ process_fields(struct event_format *event, struct print_flag_sym **list, char **

free_token(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, ","))
goto out_free;

Expand Down Expand Up @@ -2288,17 +2300,18 @@ process_dynamic_array(struct event_format *event, struct print_arg *arg, char **
arg = alloc_arg();
type = process_arg(event, arg, &token);
if (type == EVENT_ERROR)
goto out_free;
goto out_free_arg;

if (!test_type_token(type, token, EVENT_OP, "]"))
goto out_free;
goto out_free_arg;

free_token(token);
type = read_token_item(tok);
return type;

out_free_arg:
free_arg(arg);
out_free:
free(arg);
free_token(token);
*tok = NULL;
return EVENT_ERROR;
Expand Down Expand Up @@ -3362,6 +3375,7 @@ process_defined_func(struct trace_seq *s, void *data, int size,
break;
}
farg = farg->next;
param = param->next;
}

ret = (*func_handle->func)(s, args);
Expand Down
5 changes: 2 additions & 3 deletions tools/lib/traceevent/parse-filter.c
Original file line number Diff line number Diff line change
Expand Up @@ -325,9 +325,8 @@ static void free_events(struct event_list *events)
}

static struct filter_arg *
create_arg_item(struct event_format *event,
const char *token, enum filter_arg_type type,
char **error_str)
create_arg_item(struct event_format *event, const char *token,
enum event_type type, char **error_str)
{
struct format_field *field;
struct filter_arg *arg;
Expand Down

0 comments on commit c985f78

Please sign in to comment.