Lines Matching refs:bts
183 static void bts_update(struct bts_ctx *bts) in bts_update() argument
187 struct bts_buffer *buf = perf_get_aux(&bts->handle); in bts_update()
201 perf_aux_output_flag(&bts->handle, in bts_update()
228 struct bts_ctx *bts = this_cpu_ptr(&bts_ctx); in __bts_event_start() local
229 struct bts_buffer *buf = perf_get_aux(&bts->handle); in __bts_event_start()
248 WRITE_ONCE(bts->state, BTS_STATE_ACTIVE); in __bts_event_start()
257 struct bts_ctx *bts = this_cpu_ptr(&bts_ctx); in bts_event_start() local
260 buf = perf_aux_output_begin(&bts->handle, event); in bts_event_start()
264 if (bts_buffer_reset(buf, &bts->handle)) in bts_event_start()
267 bts->ds_back.bts_buffer_base = cpuc->ds->bts_buffer_base; in bts_event_start()
268 bts->ds_back.bts_absolute_maximum = cpuc->ds->bts_absolute_maximum; in bts_event_start()
269 bts->ds_back.bts_interrupt_threshold = cpuc->ds->bts_interrupt_threshold; in bts_event_start()
279 perf_aux_output_end(&bts->handle, 0); in bts_event_start()
287 struct bts_ctx *bts = this_cpu_ptr(&bts_ctx); in __bts_event_stop() local
290 WRITE_ONCE(bts->state, state); in __bts_event_stop()
302 struct bts_ctx *bts = this_cpu_ptr(&bts_ctx); in bts_event_stop() local
304 int state = READ_ONCE(bts->state); in bts_event_stop()
310 buf = perf_get_aux(&bts->handle); in bts_event_stop()
315 bts_update(bts); in bts_event_stop()
319 bts->handle.head = in bts_event_stop()
322 perf_aux_output_end(&bts->handle, in bts_event_stop()
326 cpuc->ds->bts_index = bts->ds_back.bts_buffer_base; in bts_event_stop()
327 cpuc->ds->bts_buffer_base = bts->ds_back.bts_buffer_base; in bts_event_stop()
328 cpuc->ds->bts_absolute_maximum = bts->ds_back.bts_absolute_maximum; in bts_event_stop()
329 cpuc->ds->bts_interrupt_threshold = bts->ds_back.bts_interrupt_threshold; in bts_event_stop()
335 struct bts_ctx *bts = this_cpu_ptr(&bts_ctx); in intel_bts_enable_local() local
336 int state = READ_ONCE(bts->state); in intel_bts_enable_local()
349 if (bts->handle.event) in intel_bts_enable_local()
350 __bts_event_start(bts->handle.event); in intel_bts_enable_local()
355 struct bts_ctx *bts = this_cpu_ptr(&bts_ctx); in intel_bts_disable_local() local
361 if (READ_ONCE(bts->state) != BTS_STATE_ACTIVE) in intel_bts_disable_local()
364 if (bts->handle.event) in intel_bts_disable_local()
365 __bts_event_stop(bts->handle.event, BTS_STATE_INACTIVE); in intel_bts_disable_local()
447 struct bts_ctx *bts = this_cpu_ptr(&bts_ctx); in intel_bts_interrupt() local
448 struct perf_event *event = bts->handle.event; in intel_bts_interrupt()
464 if (READ_ONCE(bts->state) == BTS_STATE_STOPPED) in intel_bts_interrupt()
467 buf = perf_get_aux(&bts->handle); in intel_bts_interrupt()
480 bts_update(bts); in intel_bts_interrupt()
486 perf_aux_output_end(&bts->handle, local_xchg(&buf->data_size, 0)); in intel_bts_interrupt()
488 buf = perf_aux_output_begin(&bts->handle, event); in intel_bts_interrupt()
490 err = bts_buffer_reset(buf, &bts->handle); in intel_bts_interrupt()
493 WRITE_ONCE(bts->state, BTS_STATE_STOPPED); in intel_bts_interrupt()
501 perf_aux_output_end(&bts->handle, 0); in intel_bts_interrupt()
515 struct bts_ctx *bts = this_cpu_ptr(&bts_ctx); in bts_event_add() local
524 if (bts->handle.event) in bts_event_add()
584 if (!boot_cpu_has(X86_FEATURE_DTES64) || !x86_pmu.bts) in bts_init()