}
static struct kvm_event *kvm_alloc_init_event(struct perf_kvm_stat *kvm,
- struct event_key *key)
+ struct event_key *key,
+ struct perf_sample *sample __maybe_unused)
{
struct kvm_event *event;
}
static struct kvm_event *find_create_kvm_event(struct perf_kvm_stat *kvm,
- struct event_key *key)
+ struct event_key *key,
+ struct perf_sample *sample)
{
struct kvm_event *event;
struct list_head *head;
return event;
}
- event = kvm_alloc_init_event(kvm, key);
+ event = kvm_alloc_init_event(kvm, key, sample);
if (!event)
return NULL;
static bool handle_begin_event(struct perf_kvm_stat *kvm,
struct vcpu_event_record *vcpu_record,
- struct event_key *key, u64 timestamp)
+ struct event_key *key,
+ struct perf_sample *sample)
{
struct kvm_event *event = NULL;
if (key->key != INVALID_KEY)
- event = find_create_kvm_event(kvm, key);
+ event = find_create_kvm_event(kvm, key, sample);
vcpu_record->last_event = event;
- vcpu_record->start_time = timestamp;
+ vcpu_record->start_time = sample->time;
return true;
}
static bool handle_child_event(struct perf_kvm_stat *kvm,
struct vcpu_event_record *vcpu_record,
struct event_key *key,
- struct perf_sample *sample __maybe_unused)
+ struct perf_sample *sample)
{
struct kvm_event *event = NULL;
if (key->key != INVALID_KEY)
- event = find_create_kvm_event(kvm, key);
+ event = find_create_kvm_event(kvm, key, sample);
vcpu_record->last_event = event;
return true;
if (!event)
- event = find_create_kvm_event(kvm, key);
+ event = find_create_kvm_event(kvm, key, sample);
if (!event)
return false;
return true;
if (kvm->events_ops->is_begin_event(evsel, sample, &key))
- return handle_begin_event(kvm, vcpu_record, &key, sample->time);
+ return handle_begin_event(kvm, vcpu_record, &key, sample);
if (is_child_event(kvm, evsel, sample, &key))
return handle_child_event(kvm, vcpu_record, &key, sample);