* [GIT PULL 0/3] perf/urgent fixes
@ 2012-03-03 19:20 Arnaldo Carvalho de Melo
2012-03-03 19:20 ` [PATCH 1/3] perf record: No build id option fails Arnaldo Carvalho de Melo
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Arnaldo Carvalho de Melo @ 2012-03-03 19:20 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, Arnaldo Carvalho de Melo, David Ahern,
Frederic Weisbecker, Jason Wang, Joerg Roedel, Mike Galbraith,
Namhyung Kim, Paul Mackerras, Peter Zijlstra, Robert Richter,
Stephane Eranian, Thomas Gleixner, arnaldo.melo,
Arnaldo Carvalho de Melo
Hi Ingo,
Please consider pulling,
- Arnaldo
The following changes since commit 1018faa6cf23b256bf25919ef203cd7c129f06f2:
perf/x86/kvm: Fix Host-Only/Guest-Only counting with SVM disabled (2012-03-02 12:16:39 +0100)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux tags/perf-urgent-for-mingo
for you to fetch changes up to bc76efe64533305b55d1f0834fd03414da8a12b2:
perf tools: Handle kernels that don't support attr.exclude_{guest,host} (2012-03-03 12:19:56 -0300)
----------------------------------------------------------------
Cherry picked fixes from perf/core, together with the kernel fix (1018faa),
the sampling tools (top, record) are back working on AMD systems.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
----------------------------------------------------------------
Arnaldo Carvalho de Melo (1):
perf tools: Handle kernels that don't support attr.exclude_{guest,host}
David Ahern (1):
perf record: No build id option fails
Joerg Roedel (1):
perf tools: Change perf_guest default back to false
tools/perf/builtin-record.c | 33 ++++++++++++++++++++++-----------
tools/perf/builtin-top.c | 23 +++++++++++++++++------
tools/perf/perf.h | 1 +
tools/perf/util/top.h | 1 +
tools/perf/util/util.c | 2 +-
5 files changed, 42 insertions(+), 18 deletions(-)
^ permalink raw reply [flat|nested] 4+ messages in thread* [PATCH 1/3] perf record: No build id option fails
2012-03-03 19:20 [GIT PULL 0/3] perf/urgent fixes Arnaldo Carvalho de Melo
@ 2012-03-03 19:20 ` Arnaldo Carvalho de Melo
2012-03-03 19:20 ` [PATCH 2/3] perf tools: Change perf_guest default back to false Arnaldo Carvalho de Melo
2012-03-03 19:20 ` [PATCH 3/3] perf tools: Handle kernels that don't support attr.exclude_{guest,host} Arnaldo Carvalho de Melo
2 siblings, 0 replies; 4+ messages in thread
From: Arnaldo Carvalho de Melo @ 2012-03-03 19:20 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, David Ahern, Frederic Weisbecker, Paul Mackerras,
Peter Zijlstra, Robert Richter, Thomas Gleixner,
Arnaldo Carvalho de Melo
From: David Ahern <dsahern@gmail.com>
A recent refactoring of perf-record introduced the following:
perf record -a -B
Couldn't generating buildids. Use --no-buildid to profile anyway.
sleep: Terminated
I believe the triple negative was meant to be only a double negative.
:-) While I'm there, fixed the grammar on the error message.
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Robert Richter <robert.richter@amd.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/1328567272-13190-1-git-send-email-dsahern@gmail.com
Signed-off-by: David Ahern <dsahern@gmail.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/builtin-record.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index 0abfb18..39b6a40 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -503,9 +503,9 @@ static int __cmd_record(struct perf_record *rec, int argc, const char **argv)
return err;
}
- if (!!rec->no_buildid
+ if (!rec->no_buildid
&& !perf_header__has_feat(&session->header, HEADER_BUILD_ID)) {
- pr_err("Couldn't generating buildids. "
+ pr_err("Couldn't generate buildids. "
"Use --no-buildid to profile anyway.\n");
return -1;
}
--
1.7.9.2.358.g22243
^ permalink raw reply [flat|nested] 4+ messages in thread* [PATCH 2/3] perf tools: Change perf_guest default back to false
2012-03-03 19:20 [GIT PULL 0/3] perf/urgent fixes Arnaldo Carvalho de Melo
2012-03-03 19:20 ` [PATCH 1/3] perf record: No build id option fails Arnaldo Carvalho de Melo
@ 2012-03-03 19:20 ` Arnaldo Carvalho de Melo
2012-03-03 19:20 ` [PATCH 3/3] perf tools: Handle kernels that don't support attr.exclude_{guest,host} Arnaldo Carvalho de Melo
2 siblings, 0 replies; 4+ messages in thread
From: Arnaldo Carvalho de Melo @ 2012-03-03 19:20 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, Joerg Roedel, David Ahern, Jason Wang,
Paul Mackerras, Peter Zijlstra, Arnaldo Carvalho de Melo
From: Joerg Roedel <joerg.roedel@amd.com>
Setting perf_guest to true by default makes no sense because the perf
subcommands can not setup guest symbol information and thus not process
and guest samples. The only exception is perf-kvm which changes the
perf_guest value on its own. So change the default for perf_guest back
to false.
Cc: David Ahern <dsahern@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Jason Wang <jasowang@redhat.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1328893505-4115-3-git-send-email-joerg.roedel@amd.com
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/util/util.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/perf/util/util.c b/tools/perf/util/util.c
index 8131410..fb25d13 100644
--- a/tools/perf/util/util.c
+++ b/tools/perf/util/util.c
@@ -6,7 +6,7 @@
* XXX We need to find a better place for these things...
*/
bool perf_host = true;
-bool perf_guest = true;
+bool perf_guest = false;
void event_attr_init(struct perf_event_attr *attr)
{
--
1.7.9.2.358.g22243
^ permalink raw reply [flat|nested] 4+ messages in thread* [PATCH 3/3] perf tools: Handle kernels that don't support attr.exclude_{guest,host}
2012-03-03 19:20 [GIT PULL 0/3] perf/urgent fixes Arnaldo Carvalho de Melo
2012-03-03 19:20 ` [PATCH 1/3] perf record: No build id option fails Arnaldo Carvalho de Melo
2012-03-03 19:20 ` [PATCH 2/3] perf tools: Change perf_guest default back to false Arnaldo Carvalho de Melo
@ 2012-03-03 19:20 ` Arnaldo Carvalho de Melo
2 siblings, 0 replies; 4+ messages in thread
From: Arnaldo Carvalho de Melo @ 2012-03-03 19:20 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, Arnaldo Carvalho de Melo, David Ahern,
Frederic Weisbecker, Joerg Roedel, Mike Galbraith,
Paul Mackerras, Peter Zijlstra, Stephane Eranian
From: Arnaldo Carvalho de Melo <acme@redhat.com>
Just fall back to resetting those fields, if set, warning the user that
that feature is not available.
If guest samples appear they will just be discarded because no struct
machine will be found and thus the event will be accounted as not
handled and dropped, see 0c09571.
Reported-by: Namhyung Kim <namhyung@gmail.com>
Tested-by: Joerg Roedel <joerg.roedel@amd.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Joerg Roedel <joerg.roedel@amd.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-vuwxig36mzprl5n7nzvnxxsh@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/builtin-record.c | 29 ++++++++++++++++++++---------
tools/perf/builtin-top.c | 23 +++++++++++++++++------
tools/perf/perf.h | 1 +
tools/perf/util/top.h | 1 +
4 files changed, 39 insertions(+), 15 deletions(-)
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index 39b6a40..227b6ae 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -204,6 +204,9 @@ static void perf_record__open(struct perf_record *rec)
if (opts->group && pos != first)
group_fd = first->fd;
+fallback_missing_features:
+ if (opts->exclude_guest_missing)
+ attr->exclude_guest = attr->exclude_host = 0;
retry_sample_id:
attr->sample_id_all = opts->sample_id_all_avail ? 1 : 0;
try_again:
@@ -217,15 +220,23 @@ try_again:
} else if (err == ENODEV && opts->cpu_list) {
die("No such device - did you specify"
" an out-of-range profile CPU?\n");
- } else if (err == EINVAL && opts->sample_id_all_avail) {
- /*
- * Old kernel, no attr->sample_id_type_all field
- */
- opts->sample_id_all_avail = false;
- if (!opts->sample_time && !opts->raw_samples && !time_needed)
- attr->sample_type &= ~PERF_SAMPLE_TIME;
-
- goto retry_sample_id;
+ } else if (err == EINVAL) {
+ if (!opts->exclude_guest_missing &&
+ (attr->exclude_guest || attr->exclude_host)) {
+ pr_debug("Old kernel, cannot exclude "
+ "guest or host samples.\n");
+ opts->exclude_guest_missing = true;
+ goto fallback_missing_features;
+ } else if (opts->sample_id_all_avail) {
+ /*
+ * Old kernel, no attr->sample_id_type_all field
+ */
+ opts->sample_id_all_avail = false;
+ if (!opts->sample_time && !opts->raw_samples && !time_needed)
+ attr->sample_type &= ~PERF_SAMPLE_TIME;
+
+ goto retry_sample_id;
+ }
}
/*
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
index dd162aa..ecff312 100644
--- a/tools/perf/builtin-top.c
+++ b/tools/perf/builtin-top.c
@@ -857,6 +857,9 @@ static void perf_top__start_counters(struct perf_top *top)
attr->mmap = 1;
attr->comm = 1;
attr->inherit = top->inherit;
+fallback_missing_features:
+ if (top->exclude_guest_missing)
+ attr->exclude_guest = attr->exclude_host = 0;
retry_sample_id:
attr->sample_id_all = top->sample_id_all_avail ? 1 : 0;
try_again:
@@ -868,12 +871,20 @@ try_again:
if (err == EPERM || err == EACCES) {
ui__error_paranoid();
goto out_err;
- } else if (err == EINVAL && top->sample_id_all_avail) {
- /*
- * Old kernel, no attr->sample_id_type_all field
- */
- top->sample_id_all_avail = false;
- goto retry_sample_id;
+ } else if (err == EINVAL) {
+ if (!top->exclude_guest_missing &&
+ (attr->exclude_guest || attr->exclude_host)) {
+ pr_debug("Old kernel, cannot exclude "
+ "guest or host samples.\n");
+ top->exclude_guest_missing = true;
+ goto fallback_missing_features;
+ } else if (top->sample_id_all_avail) {
+ /*
+ * Old kernel, no attr->sample_id_type_all field
+ */
+ top->sample_id_all_avail = false;
+ goto retry_sample_id;
+ }
}
/*
* If it's cycles then fall back to hrtimer
diff --git a/tools/perf/perf.h b/tools/perf/perf.h
index 64f8bee..16e7d20 100644
--- a/tools/perf/perf.h
+++ b/tools/perf/perf.h
@@ -199,6 +199,7 @@ struct perf_record_opts {
bool sample_address;
bool sample_time;
bool sample_id_all_avail;
+ bool exclude_guest_missing;
bool system_wide;
bool period;
unsigned int freq;
diff --git a/tools/perf/util/top.h b/tools/perf/util/top.h
index a248f3c..f2eab81 100644
--- a/tools/perf/util/top.h
+++ b/tools/perf/util/top.h
@@ -34,6 +34,7 @@ struct perf_top {
bool inherit;
bool group;
bool sample_id_all_avail;
+ bool exclude_guest_missing;
bool dump_symtab;
const char *cpu_list;
struct hist_entry *sym_filter_entry;
--
1.7.9.2.358.g22243
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-03-03 19:20 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-03 19:20 [GIT PULL 0/3] perf/urgent fixes Arnaldo Carvalho de Melo
2012-03-03 19:20 ` [PATCH 1/3] perf record: No build id option fails Arnaldo Carvalho de Melo
2012-03-03 19:20 ` [PATCH 2/3] perf tools: Change perf_guest default back to false Arnaldo Carvalho de Melo
2012-03-03 19:20 ` [PATCH 3/3] perf tools: Handle kernels that don't support attr.exclude_{guest,host} Arnaldo Carvalho de Melo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®