summaryrefslogtreecommitdiffstats
path: root/tools/perf/util/util.c
diff options
context:
space:
mode:
authorJoerg Roedel <joerg.roedel@amd.com>2012-01-04 17:54:20 +0100
committerArnaldo Carvalho de Melo <acme@redhat.com>2012-01-06 15:47:37 -0200
commit1aed2671738785e8f5aea663a6fda91aa7ef59b5 (patch)
treec28239bcbdc3b86278cceb27e2b33187c81ac20e /tools/perf/util/util.c
parentdf25f989a4390ca0dbc9cb24516d4b10c01ceda8 (diff)
downloadblackbird-obmc-linux-1aed2671738785e8f5aea663a6fda91aa7ef59b5.tar.gz
blackbird-obmc-linux-1aed2671738785e8f5aea663a6fda91aa7ef59b5.zip
perf kvm: Do guest-only counting by default
Make use of exclude_guest and exlude_host in perf-kvm to do only guest-only counting by default. Cc: Gleb Natapov <gleb@redhat.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Joerg Roedel <joro@8bytes.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Joerg Roedel <joerg.roedel@amd.com> [ committer note: Moved perf_{guest,host} & event_attr_init to util.c ] [ so as not to drag more stuff to the python binding] Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/util.c')
-rw-r--r--tools/perf/util/util.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/tools/perf/util/util.c b/tools/perf/util/util.c
index 5b3ea49aa63e..813141047fc2 100644
--- a/tools/perf/util/util.c
+++ b/tools/perf/util/util.c
@@ -1,6 +1,21 @@
+#include "../perf.h"
#include "util.h"
#include <sys/mman.h>
+/*
+ * XXX We need to find a better place for these things...
+ */
+bool perf_host = true;
+bool perf_guest = true;
+
+void event_attr_init(struct perf_event_attr *attr)
+{
+ if (!perf_host)
+ attr->exclude_host = 1;
+ if (!perf_guest)
+ attr->exclude_guest = 1;
+}
+
int mkdir_p(char *path, mode_t mode)
{
struct stat st;
OpenPOWER on IntegriCloud