mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
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 <[email protected]> Reviewed-by: Cornelia Huck <[email protected]> Reviewed-by: David Ahern <[email protected]> Signed-off-by: Alexander Yarygin <[email protected]> Cc: Christian Borntraeger <[email protected]> Cc: Cornelia Huck <[email protected]> Cc: David Ahern <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Peter Zijlstra <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
This commit is contained in:
parent
9daa81239e
commit
54c801ff71
3 changed files with 18 additions and 1 deletions
|
|
@ -136,6 +136,11 @@ struct kvm_reg_events_ops kvm_reg_events_ops[] = {
|
|||
{ NULL, NULL },
|
||||
};
|
||||
|
||||
const char * const kvm_skip_events[] = {
|
||||
"HLT",
|
||||
NULL,
|
||||
};
|
||||
|
||||
int cpu_isa_init(struct perf_kvm_stat *kvm, const char *cpuid)
|
||||
{
|
||||
if (strstr(cpuid, "Intel")) {
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -126,5 +126,6 @@ int cpu_isa_init(struct perf_kvm_stat *kvm, const char *cpuid);
|
|||
|
||||
extern const char * const kvm_events_tp[];
|
||||
extern struct kvm_reg_events_ops kvm_reg_events_ops[];
|
||||
extern const char * const kvm_skip_events[];
|
||||
|
||||
#endif /* __PERF_KVM_STAT_H */
|
||||
|
|
|
|||
Loading…
Reference in a new issue