diff options
author | David Ahern <dsahern@gmail.com> | 2012-05-08 12:50:11 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2012-05-09 11:02:10 -0400 |
commit | d1cae34d6fda59391e1b06ac1642ef4a740ba3ef (patch) | |
tree | f1f518a8769cd55cfa0750dd7aced93148c4b5c1 /tools/perf/builtin-record.c | |
parent | 40491eaa46a693e8c6ef94102350a747c63e584d (diff) |
perf record: Reset event name when falling back to cpu-clock
perf-record defaults to the H/W cycles event and if it is not supported
falls back to cpu-clock. Reset the event name as well.
Signed-off-by: David Ahern <dsahern@gmail.com>
Link: http://lkml.kernel.org/r/1336495811-58461-1-git-send-email-dsahern@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/builtin-record.c')
-rw-r--r-- | tools/perf/builtin-record.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index 1a9098c697b4..d19058a7b84c 100644 --- a/tools/perf/builtin-record.c +++ b/tools/perf/builtin-record.c | |||
@@ -256,6 +256,10 @@ try_again: | |||
256 | "trying to fall back to cpu-clock-ticks\n"); | 256 | "trying to fall back to cpu-clock-ticks\n"); |
257 | attr->type = PERF_TYPE_SOFTWARE; | 257 | attr->type = PERF_TYPE_SOFTWARE; |
258 | attr->config = PERF_COUNT_SW_CPU_CLOCK; | 258 | attr->config = PERF_COUNT_SW_CPU_CLOCK; |
259 | if (pos->name) { | ||
260 | free(pos->name); | ||
261 | pos->name = NULL; | ||
262 | } | ||
259 | goto try_again; | 263 | goto try_again; |
260 | } | 264 | } |
261 | 265 | ||