瀏覽代碼

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>
David Ahern 13 年之前
父節點
當前提交
d1cae34d6f
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      tools/perf/builtin-record.c

+ 4 - 0
tools/perf/builtin-record.c

@@ -256,6 +256,10 @@ try_again:
 						    "trying to fall back to cpu-clock-ticks\n");
 						    "trying to fall back to cpu-clock-ticks\n");
 				attr->type = PERF_TYPE_SOFTWARE;
 				attr->type = PERF_TYPE_SOFTWARE;
 				attr->config = PERF_COUNT_SW_CPU_CLOCK;
 				attr->config = PERF_COUNT_SW_CPU_CLOCK;
+				if (pos->name) {
+					free(pos->name);
+					pos->name = NULL;
+				}
 				goto try_again;
 				goto try_again;
 			}
 			}