Lines Matching defs: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,
215 * BTS updating is ordered against bts::handle::event.
225 * of bts::state, which:
226 * - is set when bts::handle::event is valid, that is, between
229 * - is ordered against bts::handle::event with a compiler barrier.
234 struct bts_ctx *bts = this_cpu_ptr(&bts_ctx);
235 struct bts_buffer *buf = perf_get_aux(&bts->handle);
249 * before we enable BTS and bts::state goes ACTIVE
254 WRITE_ONCE(bts->state, BTS_STATE_ACTIVE);
263 struct bts_ctx *bts = this_cpu_ptr(&bts_ctx);
266 buf = perf_aux_output_begin(&bts->handle, event);
270 if (bts_buffer_reset(buf, &bts->handle))
273 bts->ds_back.bts_buffer_base = cpuc->ds->bts_buffer_base;
274 bts->ds_back.bts_absolute_maximum = cpuc->ds->bts_absolute_maximum;
275 bts->ds_back.bts_interrupt_threshold = cpuc->ds->bts_interrupt_threshold;
285 perf_aux_output_end(&bts->handle, 0);
293 struct bts_ctx *bts = this_cpu_ptr(&bts_ctx);
296 WRITE_ONCE(bts->state, state);
308 struct bts_ctx *bts = this_cpu_ptr(&bts_ctx);
310 int state = READ_ONCE(bts->state);
316 buf = perf_get_aux(&bts->handle);
321 bts_update(bts);
325 bts->handle.head =
328 perf_aux_output_end(&bts->handle,
332 cpuc->ds->bts_index = bts->ds_back.bts_buffer_base;
333 cpuc->ds->bts_buffer_base = bts->ds_back.bts_buffer_base;
334 cpuc->ds->bts_absolute_maximum = bts->ds_back.bts_absolute_maximum;
335 cpuc->ds->bts_interrupt_threshold = bts->ds_back.bts_interrupt_threshold;
341 struct bts_ctx *bts = this_cpu_ptr(&bts_ctx);
342 int state = READ_ONCE(bts->state);
355 if (bts->handle.event)
356 __bts_event_start(bts->handle.event);
361 struct bts_ctx *bts = this_cpu_ptr(&bts_ctx);
367 if (READ_ONCE(bts->state) != BTS_STATE_ACTIVE)
370 if (bts->handle.event)
371 __bts_event_stop(bts->handle.event, BTS_STATE_INACTIVE);
453 struct bts_ctx *bts = this_cpu_ptr(&bts_ctx);
454 struct perf_event *event = bts->handle.event;
470 if (READ_ONCE(bts->state) == BTS_STATE_STOPPED)
473 buf = perf_get_aux(&bts->handle);
486 bts_update(bts);
492 perf_aux_output_end(&bts->handle, local_xchg(&buf->data_size, 0));
494 buf = perf_aux_output_begin(&bts->handle, event);
496 err = bts_buffer_reset(buf, &bts->handle);
499 WRITE_ONCE(bts->state, BTS_STATE_STOPPED);
507 perf_aux_output_end(&bts->handle, 0);
521 struct bts_ctx *bts = this_cpu_ptr(&bts_ctx);
530 if (bts->handle.event)
590 if (!boot_cpu_has(X86_FEATURE_DTES64) || !x86_pmu.bts)