path: root/tools/perf/builtin-kvm.c
diff options
authorAlexander Yarygin <>2014-07-03 18:29:06 +0400
committerArnaldo Carvalho de Melo <>2014-07-16 17:57:32 -0300
commit54c801ff71ba9c9ae41871e226b9d846ff9c6bab (patch)
treef76af7d6d25bbf56be31d9c3bddaaae77205aa76 /tools/perf/builtin-kvm.c
parent9daa81239e60c162153fb2a365b8492c9a9bf632 (diff)
perf kvm: Add skip_event() for --duration option
Current code skips output of the x86 specific HLT event in order to avoid flooding the output with enabled --duration option. The events to be skipped should be architecture dependent, though. Let's add an architecture specific array of events to be skipped and introduce a skip_event() function checking against that array. Reviewed-by: Christian Borntraeger <> Reviewed-by: Cornelia Huck <> Reviewed-by: David Ahern <> Signed-off-by: Alexander Yarygin <> Cc: Christian Borntraeger <> Cc: Cornelia Huck <> Cc: David Ahern <> Cc: Ingo Molnar <> Cc: Jiri Olsa <> Cc: Paul Mackerras <> Cc: Peter Zijlstra <> Link: Signed-off-by: Arnaldo Carvalho de Melo <>
Diffstat (limited to 'tools/perf/builtin-kvm.c')
1 files changed, 12 insertions, 1 deletions
diff --git a/tools/perf/builtin-kvm.c b/tools/perf/builtin-kvm.c
index 75ee8c1a6baf..fc2d63d3e791 100644
--- a/tools/perf/builtin-kvm.c
+++ b/tools/perf/builtin-kvm.c
@@ -261,6 +261,17 @@ static bool update_kvm_event(struct kvm_event *event, int vcpu_id,
return true;
+static bool skip_event(const char *event)
+ const char * const *skip_events;
+ for (skip_events = kvm_skip_events; *skip_events; skip_events++)
+ if (!strcmp(event, *skip_events))
+ return true;
+ return false;
static bool handle_end_event(struct perf_kvm_stat *kvm,
struct vcpu_event_record *vcpu_record,
struct event_key *key,
@@ -312,7 +323,7 @@ static bool handle_end_event(struct perf_kvm_stat *kvm,
char decode[DECODE_STR_LEN];
kvm->events_ops->decode_key(kvm, &event->key, decode);
- if (strcmp(decode, "HLT")) {
+ if (!skip_event(decode)) {
pr_info("%" PRIu64 " VM %d, vcpu %d: %s event took %" PRIu64 "usec\n",
sample->time, sample->pid, vcpu_record->vcpu_id,
decode, time_diff/1000);