Lines Matching refs:speq

136 	struct arm_spe_queue *speq = data;  in arm_spe_get_trace()  local
137 struct auxtrace_buffer *buffer = speq->buffer; in arm_spe_get_trace()
138 struct auxtrace_buffer *old_buffer = speq->old_buffer; in arm_spe_get_trace()
141 queue = &speq->spe->queues.queue_array[speq->queue_nr]; in arm_spe_get_trace()
152 speq->buffer = buffer; in arm_spe_get_trace()
157 int fd = perf_data__fd(speq->spe->session->data); in arm_spe_get_trace()
170 speq->old_buffer = buffer; in arm_spe_get_trace()
183 struct arm_spe_queue *speq; in arm_spe__alloc_queue() local
185 speq = zalloc(sizeof(*speq)); in arm_spe__alloc_queue()
186 if (!speq) in arm_spe__alloc_queue()
189 speq->event_buf = malloc(PERF_SAMPLE_MAX_SIZE); in arm_spe__alloc_queue()
190 if (!speq->event_buf) in arm_spe__alloc_queue()
193 speq->spe = spe; in arm_spe__alloc_queue()
194 speq->queue_nr = queue_nr; in arm_spe__alloc_queue()
195 speq->pid = -1; in arm_spe__alloc_queue()
196 speq->tid = -1; in arm_spe__alloc_queue()
197 speq->cpu = -1; in arm_spe__alloc_queue()
201 params.data = speq; in arm_spe__alloc_queue()
204 speq->decoder = arm_spe_decoder_new(&params); in arm_spe__alloc_queue()
205 if (!speq->decoder) in arm_spe__alloc_queue()
208 return speq; in arm_spe__alloc_queue()
211 zfree(&speq->event_buf); in arm_spe__alloc_queue()
212 free(speq); in arm_spe__alloc_queue()
225 struct arm_spe_queue *speq, in arm_spe_prep_sample() argument
229 struct arm_spe_record *record = &speq->decoder->record; in arm_spe_prep_sample()
232 sample->time = speq->timestamp; in arm_spe_prep_sample()
236 sample->pid = speq->pid; in arm_spe_prep_sample()
237 sample->tid = speq->tid; in arm_spe_prep_sample()
240 sample->cpu = speq->cpu; in arm_spe_prep_sample()
249 struct arm_spe_queue *speq __maybe_unused, in arm_spe_deliver_synth_event()
263 arm_spe_synth_spe_events_sample(struct arm_spe_queue *speq, in arm_spe_synth_spe_events_sample() argument
266 struct arm_spe *spe = speq->spe; in arm_spe_synth_spe_events_sample()
267 union perf_event *event = speq->event_buf; in arm_spe_synth_spe_events_sample()
270 arm_spe_prep_sample(spe, speq, event, &sample); in arm_spe_synth_spe_events_sample()
275 return arm_spe_deliver_synth_event(spe, speq, event, &sample); in arm_spe_synth_spe_events_sample()
278 static int arm_spe_sample(struct arm_spe_queue *speq) in arm_spe_sample() argument
280 const struct arm_spe_record *record = &speq->decoder->record; in arm_spe_sample()
281 struct arm_spe *spe = speq->spe; in arm_spe_sample()
287 speq, spe->l1d_miss_id); in arm_spe_sample()
294 speq, spe->l1d_access_id); in arm_spe_sample()
303 speq, spe->llc_miss_id); in arm_spe_sample()
310 speq, spe->llc_access_id); in arm_spe_sample()
319 speq, spe->tlb_miss_id); in arm_spe_sample()
326 speq, spe->tlb_access_id); in arm_spe_sample()
333 err = arm_spe_synth_spe_events_sample(speq, in arm_spe_sample()
341 err = arm_spe_synth_spe_events_sample(speq, in arm_spe_sample()
350 static int arm_spe_run_decoder(struct arm_spe_queue *speq, u64 *timestamp) in arm_spe_run_decoder() argument
352 struct arm_spe *spe = speq->spe; in arm_spe_run_decoder()
359 ret = arm_spe_decode(speq->decoder); in arm_spe_run_decoder()
372 ret = arm_spe_sample(speq); in arm_spe_run_decoder()
376 if (!spe->timeless_decoding && speq->timestamp >= *timestamp) { in arm_spe_run_decoder()
377 *timestamp = speq->timestamp; in arm_spe_run_decoder()
389 struct arm_spe_queue *speq = queue->priv; in arm_spe__setup_queue() local
392 if (list_empty(&queue->head) || speq) in arm_spe__setup_queue()
395 speq = arm_spe__alloc_queue(spe, queue_nr); in arm_spe__setup_queue()
397 if (!speq) in arm_spe__setup_queue()
400 queue->priv = speq; in arm_spe__setup_queue()
403 speq->cpu = queue->cpu; in arm_spe__setup_queue()
405 if (!speq->on_heap) { in arm_spe__setup_queue()
412 ret = arm_spe_decode(speq->decoder); in arm_spe__setup_queue()
420 record = &speq->decoder->record; in arm_spe__setup_queue()
422 speq->timestamp = record->timestamp; in arm_spe__setup_queue()
423 ret = auxtrace_heap__add(&spe->heap, queue_nr, speq->timestamp); in arm_spe__setup_queue()
426 speq->on_heap = true; in arm_spe__setup_queue()
477 struct arm_spe_queue *speq = queue->priv; in arm_spe_set_pid_tid_cpu() local
480 tid = machine__get_current_tid(spe->machine, speq->cpu); in arm_spe_set_pid_tid_cpu()
482 speq->tid = tid; in arm_spe_set_pid_tid_cpu()
483 thread__zput(speq->thread); in arm_spe_set_pid_tid_cpu()
485 speq->tid = queue->tid; in arm_spe_set_pid_tid_cpu()
487 if ((!speq->thread) && (speq->tid != -1)) { in arm_spe_set_pid_tid_cpu()
488 speq->thread = machine__find_thread(spe->machine, -1, in arm_spe_set_pid_tid_cpu()
489 speq->tid); in arm_spe_set_pid_tid_cpu()
492 if (speq->thread) { in arm_spe_set_pid_tid_cpu()
493 speq->pid = speq->thread->pid_; in arm_spe_set_pid_tid_cpu()
495 speq->cpu = speq->thread->cpu; in arm_spe_set_pid_tid_cpu()
507 struct arm_spe_queue *speq; in arm_spe_process_queues() local
517 speq = queue->priv; in arm_spe_process_queues()
531 ret = arm_spe_run_decoder(speq, &ts); in arm_spe_process_queues()
542 speq->on_heap = false; in arm_spe_process_queues()
558 struct arm_spe_queue *speq = queue->priv; in arm_spe_process_timeless_queues() local
560 if (speq && (tid == -1 || speq->tid == tid)) { in arm_spe_process_timeless_queues()
561 speq->time = time_; in arm_spe_process_timeless_queues()
563 arm_spe_run_decoder(speq, &ts); in arm_spe_process_timeless_queues()
680 struct arm_spe_queue *speq = priv; in arm_spe_free_queue() local
682 if (!speq) in arm_spe_free_queue()
684 thread__zput(speq->thread); in arm_spe_free_queue()
685 arm_spe_decoder_free(speq->decoder); in arm_spe_free_queue()
686 zfree(&speq->event_buf); in arm_spe_free_queue()
687 free(speq); in arm_spe_free_queue()