From: David Ahern Date: Tue, 8 May 2012 16:50:11 +0000 (-0600) Subject: perf record: Reset event name when falling back to cpu-clock X-Git-Tag: v3.5-rc1~120^3~40^2~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d1cae34d6fda59391e1b06ac1642ef4a740ba3ef;p=platform%2Fupstream%2Fkernel-adaptation-pc.git 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 Link: http://lkml.kernel.org/r/1336495811-58461-1-git-send-email-dsahern@gmail.com Signed-off-by: Arnaldo Carvalho de Melo --- diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index 1a9098c..d19058a 100644 --- a/tools/perf/builtin-record.c +++ b/tools/perf/builtin-record.c @@ -256,6 +256,10 @@ try_again: "trying to fall back to cpu-clock-ticks\n"); attr->type = PERF_TYPE_SOFTWARE; attr->config = PERF_COUNT_SW_CPU_CLOCK; + if (pos->name) { + free(pos->name); + pos->name = NULL; + } goto try_again; }