diff options
author | Stephane Eranian <eranian@google.com> | 2014-01-17 19:34:05 +0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2014-01-20 23:19:08 +0400 |
commit | 8a398897ff21f73cb8b15a19514660f032926882 (patch) | |
tree | bb08e1fcfe48e09b30ec21f67b7b7fbb5fb7f176 /tools/perf/util/parse-events.c | |
parent | 3a46817f674389d5fb2f4dce19fbc73ebd1976bb (diff) | |
download | linux-8a398897ff21f73cb8b15a19514660f032926882.tar.xz |
perf stat: fix NULL pointer reference bug with event unit
This patch fixes a problem with the handling of the newly introduced
optional event unit. The following cmdline caused a segfault:
$ perf stat -e cpu/event-0x3c/ ls
This patch fixes the problem with the default setting for alias->unit
which was eventually causing the segfault.
Signed-off-by: Stephane Eranian <eranian@google.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/1389972846-6566-2-git-send-email-eranian@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/parse-events.c')
-rw-r--r-- | tools/perf/util/parse-events.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c index a7f1b6a91fdd..d248fca6d7ed 100644 --- a/tools/perf/util/parse-events.c +++ b/tools/perf/util/parse-events.c @@ -635,7 +635,7 @@ int parse_events_add_pmu(struct list_head *list, int *idx, struct perf_event_attr attr; struct perf_pmu *pmu; struct perf_evsel *evsel; - char *unit; + const char *unit; double scale; pmu = perf_pmu__find(name); |