Lines Matching refs:bts
183 static void bts_update(struct bts_ctx *bts)
187 struct bts_buffer *buf = perf_get_aux(&bts->handle);
201 perf_aux_output_flag(&bts->handle,
219 * of bts::state, which:
220 * - is set when bts::handle::event is valid, that is, between
223 * - is ordered against bts::handle::event with a compiler barrier.
228 struct bts_ctx *bts = this_cpu_ptr(&bts_ctx);
229 struct bts_buffer *buf = perf_get_aux(&bts->handle);
243 * before we enable BTS and bts::state goes ACTIVE
248 WRITE_ONCE(bts->state, BTS_STATE_ACTIVE);
257 struct bts_ctx *bts = this_cpu_ptr(&bts_ctx);
260 buf = perf_aux_output_begin(&bts->handle, event);
264 if (bts_buffer_reset(buf, &bts->handle))
267 bts->ds_back.bts_buffer_base = cpuc->ds->bts_buffer_base;
268 bts->ds_back.bts_absolute_maximum = cpuc->ds->bts_absolute_maximum;
269 bts->ds_back.bts_interrupt_threshold = cpuc->ds->bts_interrupt_threshold;
279 perf_aux_output_end(&bts->handle, 0);
287 struct bts_ctx *bts = this_cpu_ptr(&bts_ctx);
290 WRITE_ONCE(bts->state, state);
302 struct bts_ctx *bts = this_cpu_ptr(&bts_ctx);
304 int state = READ_ONCE(bts->state);
310 buf = perf_get_aux(&bts->handle);
315 bts_update(bts);
319 bts->handle.head =
322 perf_aux_output_end(&bts->handle,
326 cpuc->ds->bts_index = bts->ds_back.bts_buffer_base;
327 cpuc->ds->bts_buffer_base = bts->ds_back.bts_buffer_base;
328 cpuc->ds->bts_absolute_maximum = bts->ds_back.bts_absolute_maximum;
329 cpuc->ds->bts_interrupt_threshold = bts->ds_back.bts_interrupt_threshold;
335 struct bts_ctx *bts = this_cpu_ptr(&bts_ctx);
336 int state = READ_ONCE(bts->state);
349 if (bts->handle.event)
350 __bts_event_start(bts->handle.event);
355 struct bts_ctx *bts = this_cpu_ptr(&bts_ctx);
361 if (READ_ONCE(bts->state) != BTS_STATE_ACTIVE)
364 if (bts->handle.event)
365 __bts_event_stop(bts->handle.event, BTS_STATE_INACTIVE);
447 struct bts_ctx *bts = this_cpu_ptr(&bts_ctx);
448 struct perf_event *event = bts->handle.event;
464 if (READ_ONCE(bts->state) == BTS_STATE_STOPPED)
467 buf = perf_get_aux(&bts->handle);
480 bts_update(bts);
486 perf_aux_output_end(&bts->handle, local_xchg(&buf->data_size, 0));
488 buf = perf_aux_output_begin(&bts->handle, event);
490 err = bts_buffer_reset(buf, &bts->handle);
493 WRITE_ONCE(bts->state, BTS_STATE_STOPPED);
501 perf_aux_output_end(&bts->handle, 0);
515 struct bts_ctx *bts = this_cpu_ptr(&bts_ctx);
524 if (bts->handle.event)
584 if (!boot_cpu_has(X86_FEATURE_DTES64) || !x86_pmu.bts)