From: tip-bot for Alexander Yarygin <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: acme@redhat.com, linux-kernel@vger.kernel.org, paulus@samba.org,
hpa@zytor.com, mingo@kernel.org, a.p.zijlstra@chello.nl,
borntraeger@de.ibm.com, jolsa@redhat.com,
cornelia.huck@de.ibm.com, yarygin@linux.vnet.ibm.com,
dsahern@gmail.com, tglx@linutronix.de
Subject: [tip:perf/core] perf kvm: Introduce HAVE_KVM_STAT_SUPPORT flag
Date: Wed, 16 Jul 2014 12:15:55 -0700 [thread overview]
Message-ID: <tip-da50ad69723111e0292f1943dad77b41bb9a25b0@git.kernel.org> (raw)
In-Reply-To: <1404395992-17095-2-git-send-email-yarygin@linux.vnet.ibm.com>
Commit-ID: da50ad69723111e0292f1943dad77b41bb9a25b0
Gitweb: http://git.kernel.org/tip/da50ad69723111e0292f1943dad77b41bb9a25b0
Author: Alexander Yarygin <yarygin@linux.vnet.ibm.com>
AuthorDate: Thu, 3 Jul 2014 17:59:49 +0400
Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Mon, 7 Jul 2014 16:55:23 -0300
perf kvm: Introduce HAVE_KVM_STAT_SUPPORT flag
kvm stat support is currently conditional on i386/x86_64. Let's abstract
this into a HAVE_KVM_STAT_SUPPORT flag, so that other architectures can
support kvm stat as well.
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Reviewed-by: David Ahern <dsahern@gmail.com>
Signed-off-by: Alexander Yarygin <yarygin@linux.vnet.ibm.com>
Acked-by: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: Cornelia Huck <cornelia.huck@de.ibm.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1404395992-17095-2-git-send-email-yarygin@linux.vnet.ibm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/arch/x86/Makefile | 1 +
tools/perf/builtin-kvm.c | 6 +++---
tools/perf/config/Makefile | 4 ++++
3 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/tools/perf/arch/x86/Makefile b/tools/perf/arch/x86/Makefile
index 1641542..d393901 100644
--- a/tools/perf/arch/x86/Makefile
+++ b/tools/perf/arch/x86/Makefile
@@ -15,3 +15,4 @@ endif
LIB_OBJS += $(OUTPUT)arch/$(ARCH)/util/header.o
LIB_OBJS += $(OUTPUT)arch/$(ARCH)/util/tsc.o
LIB_H += arch/$(ARCH)/util/tsc.h
+HAVE_KVM_STAT_SUPPORT := 1
diff --git a/tools/perf/builtin-kvm.c b/tools/perf/builtin-kvm.c
index 0f1e5a2..214ec0e 100644
--- a/tools/perf/builtin-kvm.c
+++ b/tools/perf/builtin-kvm.c
@@ -29,7 +29,7 @@
#include <pthread.h>
#include <math.h>
-#if defined(__i386__) || defined(__x86_64__)
+#ifdef HAVE_KVM_STAT_SUPPORT
#include <asm/svm.h>
#include <asm/vmx.h>
#include <asm/kvm.h>
@@ -1609,7 +1609,7 @@ static int kvm_cmd_stat(const char *file_name, int argc, const char **argv)
perf_stat:
return cmd_stat(argc, argv, NULL);
}
-#endif
+#endif /* HAVE_KVM_STAT_SUPPORT */
static int __cmd_record(const char *file_name, int argc, const char **argv)
{
@@ -1726,7 +1726,7 @@ int cmd_kvm(int argc, const char **argv, const char *prefix __maybe_unused)
return cmd_top(argc, argv, NULL);
else if (!strncmp(argv[0], "buildid-list", 12))
return __cmd_buildid_list(file_name, argc, argv);
-#if defined(__i386__) || defined(__x86_64__)
+#ifdef HAVE_KVM_STAT_SUPPORT
else if (!strncmp(argv[0], "stat", 4))
return kvm_cmd_stat(file_name, argc, argv);
#endif
diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index 346bdb6..b7f42d5 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -594,6 +594,10 @@ ifndef NO_LIBNUMA
endif
endif
+ifdef HAVE_KVM_STAT_SUPPORT
+ CFLAGS += -DHAVE_KVM_STAT_SUPPORT
+endif
+
# Among the variables below, these:
# perfexecdir
# template_dir
next prev parent reply other threads:[~2014-07-16 19:16 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-03 13:59 [PATCH 0/4] perf kvm: Refactoring and small improvements Alexander Yarygin
2014-07-03 13:59 ` [PATCH 1/4] perf kvm: Introduce HAVE_KVM_STAT_SUPPORT flag Alexander Yarygin
2014-07-16 19:15 ` tip-bot for Alexander Yarygin [this message]
2014-07-03 13:59 ` [PATCH 2/4] perf kvm: Simplify of exit reasons tables definitions Alexander Yarygin
2014-07-16 19:16 ` [tip:perf/core] perf kvm: Simplify " tip-bot for Alexander Yarygin
2014-07-03 13:59 ` [PATCH 3/4] perf kvm: Refactoring of cpu_isa_config() Alexander Yarygin
2014-07-16 19:16 ` [tip:perf/core] " tip-bot for Alexander Yarygin
2014-07-03 14:08 ` [PATCH 4/4] perf: Allow to use cpuinfo on s390 Alexander Yarygin
2014-07-16 19:16 ` [tip:perf/core] perf tools: " tip-bot for Alexander Yarygin
2014-07-03 14:47 ` [PATCH 0/4] perf kvm: Refactoring and small improvements Christian Borntraeger
2014-07-03 15:22 ` Arnaldo Carvalho de Melo
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-da50ad69723111e0292f1943dad77b41bb9a25b0@git.kernel.org \
--to=tipbot@zytor.com \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@redhat.com \
--cc=borntraeger@de.ibm.com \
--cc=cornelia.huck@de.ibm.com \
--cc=dsahern@gmail.com \
--cc=hpa@zytor.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=paulus@samba.org \
--cc=tglx@linutronix.de \
--cc=yarygin@linux.vnet.ibm.com \
/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