lkml.org 
[lkml]   [2012]   [Feb]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] perf tools: fix guest mode monitoring on AMD
Commit:

1aed267 perf kvm: Do guest-only counting by default

introduced a bug on AMD systems whereby simple commands:

$ perf stat ls
Performance counter stats for 'ls':
0 cycles # 0.000 GHz
0.003704596 seconds time elapsed

would not count anything anymore. Same results for perf record.

I tracked it down to guest mode exclusion being enabled
by default leading to attr->exclude_guest = 1. When
not operating under any sort of virtualization, this
causes the PMU not to count anything.

The fix disables guest exclusion by default.

Signed-off-by: Stephane Eranian <eranian@google.com>
---

diff --git a/tools/perf/util/util.c b/tools/perf/util/util.c
index 8109a90..c1017b3 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 = false;
+bool perf_guest = true;

void event_attr_init(struct perf_event_attr *attr)
{

\
 
 \ /
  Last update: 2012-02-27 18:37    [W:0.049 / U:0.348 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site