Lines Matching defs:speq

149 	struct arm_spe_queue *speq = data;
150 struct auxtrace_buffer *buffer = speq->buffer;
151 struct auxtrace_buffer *old_buffer = speq->old_buffer;
154 queue = &speq->spe->queues.queue_array[speq->queue_nr];
165 speq->buffer = buffer;
170 int fd = perf_data__fd(speq->spe->session->data);
183 speq->old_buffer = buffer;
196 struct arm_spe_queue *speq;
198 speq = zalloc(sizeof(*speq));
199 if (!speq)
202 speq->event_buf = malloc(PERF_SAMPLE_MAX_SIZE);
203 if (!speq->event_buf)
206 speq->spe = spe;
207 speq->queue_nr = queue_nr;
208 speq->pid = -1;
209 speq->tid = -1;
210 speq->cpu = -1;
211 speq->period_instructions = 0;
215 params.data = speq;
218 speq->decoder = arm_spe_decoder_new(&params);
219 if (!speq->decoder)
222 return speq;
225 zfree(&speq->event_buf);
226 free(speq);
241 struct arm_spe_queue *speq = queue->priv;
244 tid = machine__get_current_tid(spe->machine, speq->cpu);
246 speq->tid = tid;
247 thread__zput(speq->thread);
249 speq->tid = queue->tid;
251 if ((!speq->thread) && (speq->tid != -1)) {
252 speq->thread = machine__find_thread(spe->machine, -1,
253 speq->tid);
256 if (speq->thread) {
257 speq->pid = thread__pid(speq->thread);
259 speq->cpu = thread__cpu(speq->thread);
263 static int arm_spe_set_tid(struct arm_spe_queue *speq, pid_t tid)
265 struct arm_spe *spe = speq->spe;
266 int err = machine__set_current_tid(spe->machine, speq->cpu, -1, tid);
271 arm_spe_set_pid_tid_cpu(spe, &spe->queues.queue_array[speq->queue_nr]);
296 struct arm_spe_queue *speq,
300 struct arm_spe_record *record = &speq->decoder->record;
307 sample->pid = speq->pid;
308 sample->tid = speq->tid;
310 sample->cpu = speq->cpu;
326 struct arm_spe_queue *speq __maybe_unused,
345 static int arm_spe__synth_mem_sample(struct arm_spe_queue *speq,
348 struct arm_spe *spe = speq->spe;
349 struct arm_spe_record *record = &speq->decoder->record;
350 union perf_event *event = speq->event_buf;
353 arm_spe_prep_sample(spe, speq, event, &sample);
362 return arm_spe_deliver_synth_event(spe, speq, event, &sample);
365 static int arm_spe__synth_branch_sample(struct arm_spe_queue *speq,
368 struct arm_spe *spe = speq->spe;
369 struct arm_spe_record *record = &speq->decoder->record;
370 union perf_event *event = speq->event_buf;
373 arm_spe_prep_sample(spe, speq, event, &sample);
380 return arm_spe_deliver_synth_event(spe, speq, event, &sample);
383 static int arm_spe__synth_instruction_sample(struct arm_spe_queue *speq,
386 struct arm_spe *spe = speq->spe;
387 struct arm_spe_record *record = &speq->decoder->record;
388 union perf_event *event = speq->event_buf;
394 speq->period_instructions++;
395 if (speq->period_instructions < spe->instructions_sample_period)
397 speq->period_instructions = 0;
399 arm_spe_prep_sample(spe, speq, event, &sample);
409 return arm_spe_deliver_synth_event(spe, speq, event, &sample);
547 static int arm_spe_sample(struct arm_spe_queue *speq)
549 const struct arm_spe_record *record = &speq->decoder->record;
550 struct arm_spe *spe = speq->spe;
558 err = arm_spe__synth_mem_sample(speq, spe->l1d_miss_id,
565 err = arm_spe__synth_mem_sample(speq, spe->l1d_access_id,
574 err = arm_spe__synth_mem_sample(speq, spe->llc_miss_id,
581 err = arm_spe__synth_mem_sample(speq, spe->llc_access_id,
590 err = arm_spe__synth_mem_sample(speq, spe->tlb_miss_id,
597 err = arm_spe__synth_mem_sample(speq, spe->tlb_access_id,
605 err = arm_spe__synth_branch_sample(speq, spe->branch_miss_id);
612 err = arm_spe__synth_mem_sample(speq, spe->remote_access_id,
623 err = arm_spe__synth_mem_sample(speq, spe->memory_id, data_src);
629 err = arm_spe__synth_instruction_sample(speq, spe->instructions_id, data_src);
637 static int arm_spe_run_decoder(struct arm_spe_queue *speq, u64 *timestamp)
639 struct arm_spe *spe = speq->spe;
670 record = &speq->decoder->record;
672 ret = arm_spe_set_tid(speq, record->context_id);
679 ret = arm_spe_sample(speq);
683 ret = arm_spe_decode(speq->decoder);
696 record = &speq->decoder->record;
699 if (record->timestamp > speq->timestamp)
700 speq->timestamp = record->timestamp;
707 if (!spe->timeless_decoding && speq->timestamp >= *timestamp) {
708 *timestamp = speq->timestamp;
720 struct arm_spe_queue *speq = queue->priv;
723 if (list_empty(&queue->head) || speq)
726 speq = arm_spe__alloc_queue(spe, queue_nr);
728 if (!speq)
731 queue->priv = speq;
734 speq->cpu = queue->cpu;
736 if (!speq->on_heap) {
743 ret = arm_spe_decode(speq->decoder);
751 record = &speq->decoder->record;
753 speq->timestamp = record->timestamp;
754 ret = auxtrace_heap__add(&spe->heap, queue_nr, speq->timestamp);
757 speq->on_heap = true;
813 struct arm_spe_queue *speq;
823 speq = queue->priv;
842 ret = arm_spe_run_decoder(speq, &ts);
853 speq->on_heap = false;
869 struct arm_spe_queue *speq = queue->priv;
871 if (speq && (tid == -1 || speq->tid == tid)) {
872 speq->time = time_;
874 arm_spe_run_decoder(speq, &ts);
1021 struct arm_spe_queue *speq = priv;
1023 if (!speq)
1025 thread__zput(speq->thread);
1026 arm_spe_decoder_free(speq->decoder);
1027 zfree(&speq->event_buf);
1028 free(speq);