Skip to content

Commit

Permalink
perf record: Reset event name when falling back to cpu-clock
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
David Ahern authored and Arnaldo Carvalho de Melo committed May 9, 2012
1 parent 40491ea commit d1cae34
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tools/perf/builtin-record.c
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,10 @@ static void perf_record__open(struct perf_record *rec)
"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;
}

Expand Down

0 comments on commit d1cae34

Please sign in to comment.