aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-record.c
diff options
context:
space:
mode:
authorRobert Richter <robert.richter@amd.com>2012-04-05 18:26:28 +0200
committerArnaldo Carvalho de Melo <acme@redhat.com>2012-04-11 17:39:19 -0300
commit5a7ed29c7572d00a75e8c4529e30c5ac2ef82271 (patch)
treeece2e7d0e2c19ea5a3d0ec172ad0b81a8a19021d /tools/perf/builtin-record.c
parentperf tools: Fix thread map that is type pid_t (diff)
downloadlinux-dev-5a7ed29c7572d00a75e8c4529e30c5ac2ef82271.tar.xz
linux-dev-5a7ed29c7572d00a75e8c4529e30c5ac2ef82271.zip
perf record: Use sw counter only if hw pmu is not detected
Use cpu-clock-tick sw counter for cpu-cycles only if there is no hw pmu available. This is the case if the syscall reports ENOENT. In other cases (e.g. invalid attributes) we don't want the sw counter to be used. Cc: Ingo Molnar <mingo@kernel.org> Link: http://lkml.kernel.org/r/1333643188-26895-5-git-send-email-robert.richter@amd.com Signed-off-by: Robert Richter <robert.richter@amd.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.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index be4e1eee782e..10b1f1f25ed7 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -245,7 +245,7 @@ try_again:
* based cpu-clock-tick sw counter, which
* is always available even if no PMU support:
*/
- if (attr->type == PERF_TYPE_HARDWARE
+ if (err == ENOENT && attr->type == PERF_TYPE_HARDWARE
&& attr->config == PERF_COUNT_HW_CPU_CYCLES) {
if (verbose)