Lines Matching refs:speq
137 struct arm_spe_queue *speq = data; in arm_spe_get_trace() local
138 struct auxtrace_buffer *buffer = speq->buffer; in arm_spe_get_trace()
139 struct auxtrace_buffer *old_buffer = speq->old_buffer; in arm_spe_get_trace()
142 queue = &speq->spe->queues.queue_array[speq->queue_nr]; in arm_spe_get_trace()
153 speq->buffer = buffer; in arm_spe_get_trace()
158 int fd = perf_data__fd(speq->spe->session->data); in arm_spe_get_trace()
171 speq->old_buffer = buffer; in arm_spe_get_trace()
184 struct arm_spe_queue *speq; in arm_spe__alloc_queue() local
186 speq = zalloc(sizeof(*speq)); in arm_spe__alloc_queue()
187 if (!speq) in arm_spe__alloc_queue()
190 speq->event_buf = malloc(PERF_SAMPLE_MAX_SIZE); in arm_spe__alloc_queue()
191 if (!speq->event_buf) in arm_spe__alloc_queue()
194 speq->spe = spe; in arm_spe__alloc_queue()
195 speq->queue_nr = queue_nr; in arm_spe__alloc_queue()
196 speq->pid = -1; in arm_spe__alloc_queue()
197 speq->tid = -1; in arm_spe__alloc_queue()
198 speq->cpu = -1; in arm_spe__alloc_queue()
202 params.data = speq; in arm_spe__alloc_queue()
205 speq->decoder = arm_spe_decoder_new(¶ms); in arm_spe__alloc_queue()
206 if (!speq->decoder) in arm_spe__alloc_queue()
209 return speq; in arm_spe__alloc_queue()
212 zfree(&speq->event_buf); in arm_spe__alloc_queue()
213 free(speq); in arm_spe__alloc_queue()
226 struct arm_spe_queue *speq, in arm_spe_prep_sample() argument
230 struct arm_spe_record *record = &speq->decoder->record; in arm_spe_prep_sample()
233 sample->time = speq->timestamp; in arm_spe_prep_sample()
237 sample->pid = speq->pid; in arm_spe_prep_sample()
238 sample->tid = speq->tid; in arm_spe_prep_sample()
241 sample->cpu = speq->cpu; in arm_spe_prep_sample()
256 struct arm_spe_queue *speq __maybe_unused, in arm_spe_deliver_synth_event()
276 arm_spe_synth_spe_events_sample(struct arm_spe_queue *speq, in arm_spe_synth_spe_events_sample() argument
279 struct arm_spe *spe = speq->spe; in arm_spe_synth_spe_events_sample()
280 union perf_event *event = speq->event_buf; in arm_spe_synth_spe_events_sample()
283 arm_spe_prep_sample(spe, speq, event, &sample); in arm_spe_synth_spe_events_sample()
288 return arm_spe_deliver_synth_event(spe, speq, event, &sample); in arm_spe_synth_spe_events_sample()
291 static int arm_spe_sample(struct arm_spe_queue *speq) in arm_spe_sample() argument
293 const struct arm_spe_record *record = &speq->decoder->record; in arm_spe_sample()
294 struct arm_spe *spe = speq->spe; in arm_spe_sample()
300 speq, spe->l1d_miss_id); in arm_spe_sample()
307 speq, spe->l1d_access_id); in arm_spe_sample()
316 speq, spe->llc_miss_id); in arm_spe_sample()
323 speq, spe->llc_access_id); in arm_spe_sample()
332 speq, spe->tlb_miss_id); in arm_spe_sample()
339 speq, spe->tlb_access_id); in arm_spe_sample()
346 err = arm_spe_synth_spe_events_sample(speq, in arm_spe_sample()
354 err = arm_spe_synth_spe_events_sample(speq, in arm_spe_sample()
363 static int arm_spe_run_decoder(struct arm_spe_queue *speq, u64 *timestamp) in arm_spe_run_decoder() argument
365 struct arm_spe *spe = speq->spe; in arm_spe_run_decoder()
372 ret = arm_spe_decode(speq->decoder); in arm_spe_run_decoder()
385 ret = arm_spe_sample(speq); in arm_spe_run_decoder()
389 if (!spe->timeless_decoding && speq->timestamp >= *timestamp) { in arm_spe_run_decoder()
390 *timestamp = speq->timestamp; in arm_spe_run_decoder()
402 struct arm_spe_queue *speq = queue->priv; in arm_spe__setup_queue() local
405 if (list_empty(&queue->head) || speq) in arm_spe__setup_queue()
408 speq = arm_spe__alloc_queue(spe, queue_nr); in arm_spe__setup_queue()
410 if (!speq) in arm_spe__setup_queue()
413 queue->priv = speq; in arm_spe__setup_queue()
416 speq->cpu = queue->cpu; in arm_spe__setup_queue()
418 if (!speq->on_heap) { in arm_spe__setup_queue()
425 ret = arm_spe_decode(speq->decoder); in arm_spe__setup_queue()
433 record = &speq->decoder->record; in arm_spe__setup_queue()
435 speq->timestamp = record->timestamp; in arm_spe__setup_queue()
436 ret = auxtrace_heap__add(&spe->heap, queue_nr, speq->timestamp); in arm_spe__setup_queue()
439 speq->on_heap = true; in arm_spe__setup_queue()
490 struct arm_spe_queue *speq = queue->priv; in arm_spe_set_pid_tid_cpu() local
493 tid = machine__get_current_tid(spe->machine, speq->cpu); in arm_spe_set_pid_tid_cpu()
495 speq->tid = tid; in arm_spe_set_pid_tid_cpu()
496 thread__zput(speq->thread); in arm_spe_set_pid_tid_cpu()
498 speq->tid = queue->tid; in arm_spe_set_pid_tid_cpu()
500 if ((!speq->thread) && (speq->tid != -1)) { in arm_spe_set_pid_tid_cpu()
501 speq->thread = machine__find_thread(spe->machine, -1, in arm_spe_set_pid_tid_cpu()
502 speq->tid); in arm_spe_set_pid_tid_cpu()
505 if (speq->thread) { in arm_spe_set_pid_tid_cpu()
506 speq->pid = speq->thread->pid_; in arm_spe_set_pid_tid_cpu()
508 speq->cpu = speq->thread->cpu; in arm_spe_set_pid_tid_cpu()
520 struct arm_spe_queue *speq; in arm_spe_process_queues() local
530 speq = queue->priv; in arm_spe_process_queues()
544 ret = arm_spe_run_decoder(speq, &ts); in arm_spe_process_queues()
555 speq->on_heap = false; in arm_spe_process_queues()
571 struct arm_spe_queue *speq = queue->priv; in arm_spe_process_timeless_queues() local
573 if (speq && (tid == -1 || speq->tid == tid)) { in arm_spe_process_timeless_queues()
574 speq->time = time_; in arm_spe_process_timeless_queues()
576 arm_spe_run_decoder(speq, &ts); in arm_spe_process_timeless_queues()
693 struct arm_spe_queue *speq = priv; in arm_spe_free_queue() local
695 if (!speq) in arm_spe_free_queue()
697 thread__zput(speq->thread); in arm_spe_free_queue()
698 arm_spe_decoder_free(speq->decoder); in arm_spe_free_queue()
699 zfree(&speq->event_buf); in arm_spe_free_queue()
700 free(speq); in arm_spe_free_queue()