perf: add struct hw_perf_event

Change-Id: I0938e2b18064ad805a9edb6e15d26cf438bf0a59
This commit is contained in:
TOIDA,Suguru
2019-11-19 09:31:49 +09:00
parent 767792808a
commit 86c45484e3
5 changed files with 81 additions and 0 deletions

View File

@ -215,3 +215,20 @@ int ihk_mc_perfctr_set_extra(struct mc_perf_event *event)
/* Nothing to do. */
return 0;
}
static inline uint64_t arm_pmu_event_max_period(struct mc_perf_event *event)
{
return 0xFFFFFFFF;
}
int hw_perf_event_init(struct mc_perf_event *event)
{
struct hw_perf_event *hwc = &event->hw;
if (!is_sampling_event(event)) {
hwc->sample_period = arm_pmu_event_max_period(event) >> 1;
hwc->last_period = hwc->sample_period;
ihk_atomic64_set(&hwc->period_left, hwc->sample_period);
}
return 0;
}