public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: tip-bot for Robert Richter <robert.richter@amd.com>
To: linux-tip-commits@vger.kernel.org
Cc: acme@redhat.com, linux-kernel@vger.kernel.org, hpa@zytor.com,
	mingo@kernel.org, robert.richter@amd.com, tglx@linutronix.de
Subject: [tip:perf/core] perf record: Use sw counter only if hw pmu is not detected
Date: Fri, 13 Apr 2012 11:23:53 -0700	[thread overview]
Message-ID: <tip-5a7ed29c7572d00a75e8c4529e30c5ac2ef82271@git.kernel.org> (raw)
In-Reply-To: <1333643188-26895-5-git-send-email-robert.richter@amd.com>

Commit-ID:  5a7ed29c7572d00a75e8c4529e30c5ac2ef82271
Gitweb:     http://git.kernel.org/tip/5a7ed29c7572d00a75e8c4529e30c5ac2ef82271
Author:     Robert Richter <robert.richter@amd.com>
AuthorDate: Thu, 5 Apr 2012 18:26:28 +0200
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Wed, 11 Apr 2012 17:39:19 -0300

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>
---
 tools/perf/builtin-record.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index be4e1ee..10b1f1f 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)

      parent reply	other threads:[~2012-04-13 18:24 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-05 16:26 [PATCH 0/4] perf tools: Some fixes and updates Robert Richter
2012-04-05 16:26 ` [PATCH 1/4] perf tools: Fix include header files in util/parse-events.h Robert Richter
2012-04-24 16:53   ` Robert Richter
2012-04-24 17:35     ` Arnaldo Carvalho de Melo
2012-04-24 17:58       ` Robert Richter
2012-04-25 10:21         ` Arnaldo Carvalho de Melo
2012-05-11  6:27   ` [tip:perf/core] perf tools: Fix include header files in util/ parse-events.h tip-bot for Robert Richter
2012-04-05 16:26 ` [PATCH 2/4] perf tools: Fix thread map that is type pid_t Robert Richter
2012-04-13 18:23   ` [tip:perf/core] " tip-bot for Robert Richter
2012-04-05 16:26 ` [PATCH 3/4] perf tools: Declare some references static in builtin-stat.c Robert Richter
2012-04-13 18:22   ` [tip:perf/core] perf stat: Declare some references static tip-bot for Robert Richter
2012-04-05 16:26 ` [PATCH 4/4] perf tools: Use sw counter only if hw pmu is not detected Robert Richter
2012-04-05 16:59   ` David Ahern
2012-04-05 17:18     ` Robert Richter
2012-04-13 18:23   ` tip-bot for Robert Richter [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-5a7ed29c7572d00a75e8c4529e30c5ac2ef82271@git.kernel.org \
    --to=robert.richter@amd.com \
    --cc=acme@redhat.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox