summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2012-09-26 08:57:22 +0200
committerIngo Molnar <mingo@kernel.org>2012-09-26 08:57:22 +0200
commita91f408e4435d4f572392295ee47756b6f5011c7 (patch)
tree298177b72d51218a69ffd92a940029c13a3bdde6 /tools
parentf74eb728687afbf239abe2ea66921583db4eaa4b (diff)
parentf1b2256d66fe8d613b9afcc1c16079362f9fc05c (diff)
Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core
Pull perf/core fixes from Arnaldo Carvalho de Melo: * The new perf_evsel__tp_sched_test 'perf test' broke the build by setting the 'ret' variable but not using it, caught by newer gcc -Werror=unused-but-set-variable, fix from Namhyung Kim. * pevent_parse_event should return a proper PEVENT_ERRNO__ and call pevent_free_format on its failure path, fixes from Namhyung Kim. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'tools')
-rw-r--r--tools/lib/traceevent/event-parse.c8
-rw-r--r--tools/perf/builtin-test.c4
2 files changed, 6 insertions, 6 deletions
diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c
index 17c922145e88..47264b4652b9 100644
--- a/tools/lib/traceevent/event-parse.c
+++ b/tools/lib/traceevent/event-parse.c
@@ -5044,8 +5044,10 @@ enum pevent_errno pevent_parse_event(struct pevent *pevent, const char *buf,
/* Add pevent to event so that it can be referenced */
event->pevent = pevent;
- if (add_event(pevent, event))
+ if (add_event(pevent, event)) {
+ ret = PEVENT_ERRNO__MEM_ALLOC_FAILED;
goto event_add_failed;
+ }
#define PRINT_ARGS 0
if (PRINT_ARGS && event->print_fmt.args)
@@ -5054,9 +5056,7 @@ enum pevent_errno pevent_parse_event(struct pevent *pevent, const char *buf,
return 0;
event_add_failed:
- free(event->system);
- free(event->name);
- free(event);
+ pevent_free_format(event);
return ret;
}
diff --git a/tools/perf/builtin-test.c b/tools/perf/builtin-test.c
index 32caf13cfe01..78b47a75a7c9 100644
--- a/tools/perf/builtin-test.c
+++ b/tools/perf/builtin-test.c
@@ -1233,7 +1233,7 @@ static int perf_evsel__test_field(struct perf_evsel *evsel, const char *name,
ret = -1;
}
- return 0;
+ return ret;
}
static int perf_evsel__tp_sched_test(void)
@@ -1286,7 +1286,7 @@ static int perf_evsel__tp_sched_test(void)
if (perf_evsel__test_field(evsel, "target_cpu", 4, true))
ret = -1;
- return 0;
+ return ret;
}
static struct test {