Lines Matching refs:event

153 static inline u64 rapl_read_counter(struct perf_event *event)  in rapl_read_counter()  argument
156 rdmsrl(event->hw.event_base, raw); in rapl_read_counter()
175 static u64 rapl_event_update(struct perf_event *event) in rapl_event_update() argument
177 struct hw_perf_event *hwc = &event->hw; in rapl_event_update()
184 rdmsrl(event->hw.event_base, new_raw_count); in rapl_event_update()
203 sdelta = rapl_scale(delta, event->hw.config); in rapl_event_update()
205 local64_add(sdelta, &event->count); in rapl_event_update()
219 struct perf_event *event; in rapl_hrtimer_handle() local
227 list_for_each_entry(event, &pmu->active_list, active_entry) in rapl_hrtimer_handle()
228 rapl_event_update(event); in rapl_hrtimer_handle()
246 struct perf_event *event) in __rapl_pmu_event_start() argument
248 if (WARN_ON_ONCE(!(event->hw.state & PERF_HES_STOPPED))) in __rapl_pmu_event_start()
251 event->hw.state = 0; in __rapl_pmu_event_start()
253 list_add_tail(&event->active_entry, &pmu->active_list); in __rapl_pmu_event_start()
255 local64_set(&event->hw.prev_count, rapl_read_counter(event)); in __rapl_pmu_event_start()
262 static void rapl_pmu_event_start(struct perf_event *event, int mode) in rapl_pmu_event_start() argument
264 struct rapl_pmu *pmu = event->pmu_private; in rapl_pmu_event_start()
268 __rapl_pmu_event_start(pmu, event); in rapl_pmu_event_start()
272 static void rapl_pmu_event_stop(struct perf_event *event, int mode) in rapl_pmu_event_stop() argument
274 struct rapl_pmu *pmu = event->pmu_private; in rapl_pmu_event_stop()
275 struct hw_perf_event *hwc = &event->hw; in rapl_pmu_event_stop()
287 list_del(&event->active_entry); in rapl_pmu_event_stop()
299 rapl_event_update(event); in rapl_pmu_event_stop()
306 static int rapl_pmu_event_add(struct perf_event *event, int mode) in rapl_pmu_event_add() argument
308 struct rapl_pmu *pmu = event->pmu_private; in rapl_pmu_event_add()
309 struct hw_perf_event *hwc = &event->hw; in rapl_pmu_event_add()
317 __rapl_pmu_event_start(pmu, event); in rapl_pmu_event_add()
324 static void rapl_pmu_event_del(struct perf_event *event, int flags) in rapl_pmu_event_del() argument
326 rapl_pmu_event_stop(event, PERF_EF_UPDATE); in rapl_pmu_event_del()
329 static int rapl_pmu_event_init(struct perf_event *event) in rapl_pmu_event_init() argument
331 u64 cfg = event->attr.config & RAPL_EVENT_MASK; in rapl_pmu_event_init()
336 if (event->attr.type != rapl_pmus->pmu.type) in rapl_pmu_event_init()
340 if (event->attr.config & ~RAPL_EVENT_MASK) in rapl_pmu_event_init()
343 if (event->cpu < 0) in rapl_pmu_event_init()
346 event->event_caps |= PERF_EV_CAP_READ_ACTIVE_PKG; in rapl_pmu_event_init()
359 if (event->attr.sample_period) /* no sampling */ in rapl_pmu_event_init()
363 pmu = cpu_to_rapl_pmu(event->cpu); in rapl_pmu_event_init()
366 event->cpu = pmu->cpu; in rapl_pmu_event_init()
367 event->pmu_private = pmu; in rapl_pmu_event_init()
368 event->hw.event_base = rapl_msrs[bit].msr; in rapl_pmu_event_init()
369 event->hw.config = cfg; in rapl_pmu_event_init()
370 event->hw.idx = bit; in rapl_pmu_event_init()
375 static void rapl_pmu_event_read(struct perf_event *event) in rapl_pmu_event_read() argument
377 rapl_event_update(event); in rapl_pmu_event_read()
432 PMU_FORMAT_ATTR(event, "config:0-7");