Lines Matching refs:bts
177 static void bts_update(struct bts_ctx *bts) in bts_update() argument
181 struct bts_buffer *buf = perf_get_aux(&bts->handle); in bts_update()
195 perf_aux_output_flag(&bts->handle, in bts_update()
222 struct bts_ctx *bts = this_cpu_ptr(&bts_ctx); in __bts_event_start() local
223 struct bts_buffer *buf = perf_get_aux(&bts->handle); in __bts_event_start()
242 WRITE_ONCE(bts->state, BTS_STATE_ACTIVE); in __bts_event_start()
251 struct bts_ctx *bts = this_cpu_ptr(&bts_ctx); in bts_event_start() local
254 buf = perf_aux_output_begin(&bts->handle, event); in bts_event_start()
258 if (bts_buffer_reset(buf, &bts->handle)) in bts_event_start()
261 bts->ds_back.bts_buffer_base = cpuc->ds->bts_buffer_base; in bts_event_start()
262 bts->ds_back.bts_absolute_maximum = cpuc->ds->bts_absolute_maximum; in bts_event_start()
263 bts->ds_back.bts_interrupt_threshold = cpuc->ds->bts_interrupt_threshold; in bts_event_start()
273 perf_aux_output_end(&bts->handle, 0); in bts_event_start()
281 struct bts_ctx *bts = this_cpu_ptr(&bts_ctx); in __bts_event_stop() local
284 WRITE_ONCE(bts->state, state); in __bts_event_stop()
296 struct bts_ctx *bts = this_cpu_ptr(&bts_ctx); in bts_event_stop() local
298 int state = READ_ONCE(bts->state); in bts_event_stop()
304 buf = perf_get_aux(&bts->handle); in bts_event_stop()
309 bts_update(bts); in bts_event_stop()
313 bts->handle.head = in bts_event_stop()
316 perf_aux_output_end(&bts->handle, in bts_event_stop()
320 cpuc->ds->bts_index = bts->ds_back.bts_buffer_base; in bts_event_stop()
321 cpuc->ds->bts_buffer_base = bts->ds_back.bts_buffer_base; in bts_event_stop()
322 cpuc->ds->bts_absolute_maximum = bts->ds_back.bts_absolute_maximum; in bts_event_stop()
323 cpuc->ds->bts_interrupt_threshold = bts->ds_back.bts_interrupt_threshold; in bts_event_stop()
329 struct bts_ctx *bts = this_cpu_ptr(&bts_ctx); in intel_bts_enable_local() local
330 int state = READ_ONCE(bts->state); in intel_bts_enable_local()
343 if (bts->handle.event) in intel_bts_enable_local()
344 __bts_event_start(bts->handle.event); in intel_bts_enable_local()
349 struct bts_ctx *bts = this_cpu_ptr(&bts_ctx); in intel_bts_disable_local() local
355 if (READ_ONCE(bts->state) != BTS_STATE_ACTIVE) in intel_bts_disable_local()
358 if (bts->handle.event) in intel_bts_disable_local()
359 __bts_event_stop(bts->handle.event, BTS_STATE_INACTIVE); in intel_bts_disable_local()
441 struct bts_ctx *bts = this_cpu_ptr(&bts_ctx); in intel_bts_interrupt() local
442 struct perf_event *event = bts->handle.event; in intel_bts_interrupt()
458 if (READ_ONCE(bts->state) == BTS_STATE_STOPPED) in intel_bts_interrupt()
461 buf = perf_get_aux(&bts->handle); in intel_bts_interrupt()
474 bts_update(bts); in intel_bts_interrupt()
480 perf_aux_output_end(&bts->handle, local_xchg(&buf->data_size, 0)); in intel_bts_interrupt()
482 buf = perf_aux_output_begin(&bts->handle, event); in intel_bts_interrupt()
484 err = bts_buffer_reset(buf, &bts->handle); in intel_bts_interrupt()
487 WRITE_ONCE(bts->state, BTS_STATE_STOPPED); in intel_bts_interrupt()
495 perf_aux_output_end(&bts->handle, 0); in intel_bts_interrupt()
509 struct bts_ctx *bts = this_cpu_ptr(&bts_ctx); in bts_event_add() local
518 if (bts->handle.event) in bts_event_add()
576 if (!boot_cpu_has(X86_FEATURE_DTES64) || !x86_pmu.bts) in bts_init()