Lines Matching refs:packet_queue
87 int cs_etm_decoder__get_packet(struct cs_etm_packet_queue *packet_queue, in cs_etm_decoder__get_packet() argument
90 if (!packet_queue || !packet) in cs_etm_decoder__get_packet()
94 if (packet_queue->packet_count == 0) in cs_etm_decoder__get_packet()
105 packet_queue->head = (packet_queue->head + 1) & in cs_etm_decoder__get_packet()
108 *packet = packet_queue->packet_buffer[packet_queue->head]; in cs_etm_decoder__get_packet()
110 packet_queue->packet_count--; in cs_etm_decoder__get_packet()
260 struct cs_etm_packet_queue *packet_queue, in cs_etm_decoder__do_soft_timestamp() argument
264 if (!packet_queue->cs_timestamp) in cs_etm_decoder__do_soft_timestamp()
267 packet_queue->cs_timestamp = packet_queue->next_cs_timestamp; in cs_etm_decoder__do_soft_timestamp()
270 packet_queue->next_cs_timestamp += packet_queue->instr_count; in cs_etm_decoder__do_soft_timestamp()
271 packet_queue->instr_count = 0; in cs_etm_decoder__do_soft_timestamp()
285 struct cs_etm_packet_queue *packet_queue; in cs_etm_decoder__do_hard_timestamp() local
288 packet_queue = cs_etm__etmq_get_packet_queue(etmq, trace_chan_id); in cs_etm_decoder__do_hard_timestamp()
289 if (!packet_queue) in cs_etm_decoder__do_hard_timestamp()
297 if (packet_queue->cs_timestamp) { in cs_etm_decoder__do_hard_timestamp()
298 packet_queue->next_cs_timestamp = elem->timestamp; in cs_etm_decoder__do_hard_timestamp()
309 packet_queue->cs_timestamp = 0; in cs_etm_decoder__do_hard_timestamp()
315 } else if (packet_queue->instr_count > elem->timestamp) { in cs_etm_decoder__do_hard_timestamp()
320 packet_queue->cs_timestamp = 0; in cs_etm_decoder__do_hard_timestamp()
330 packet_queue->cs_timestamp = elem->timestamp - packet_queue->instr_count; in cs_etm_decoder__do_hard_timestamp()
332 packet_queue->next_cs_timestamp = elem->timestamp; in cs_etm_decoder__do_hard_timestamp()
333 packet_queue->instr_count = 0; in cs_etm_decoder__do_hard_timestamp()
343 cs_etm_decoder__reset_timestamp(struct cs_etm_packet_queue *packet_queue) in cs_etm_decoder__reset_timestamp() argument
345 packet_queue->cs_timestamp = 0; in cs_etm_decoder__reset_timestamp()
346 packet_queue->next_cs_timestamp = 0; in cs_etm_decoder__reset_timestamp()
347 packet_queue->instr_count = 0; in cs_etm_decoder__reset_timestamp()
351 cs_etm_decoder__buffer_packet(struct cs_etm_packet_queue *packet_queue, in cs_etm_decoder__buffer_packet() argument
358 if (packet_queue->packet_count >= CS_ETM_PACKET_MAX_BUFFER - 1) in cs_etm_decoder__buffer_packet()
364 et = packet_queue->tail; in cs_etm_decoder__buffer_packet()
366 packet_queue->tail = et; in cs_etm_decoder__buffer_packet()
367 packet_queue->packet_count++; in cs_etm_decoder__buffer_packet()
369 packet_queue->packet_buffer[et].sample_type = sample_type; in cs_etm_decoder__buffer_packet()
370 packet_queue->packet_buffer[et].isa = CS_ETM_ISA_UNKNOWN; in cs_etm_decoder__buffer_packet()
371 packet_queue->packet_buffer[et].cpu = cpu; in cs_etm_decoder__buffer_packet()
372 packet_queue->packet_buffer[et].start_addr = CS_ETM_INVAL_ADDR; in cs_etm_decoder__buffer_packet()
373 packet_queue->packet_buffer[et].end_addr = CS_ETM_INVAL_ADDR; in cs_etm_decoder__buffer_packet()
374 packet_queue->packet_buffer[et].instr_count = 0; in cs_etm_decoder__buffer_packet()
375 packet_queue->packet_buffer[et].last_instr_taken_branch = false; in cs_etm_decoder__buffer_packet()
376 packet_queue->packet_buffer[et].last_instr_size = 0; in cs_etm_decoder__buffer_packet()
377 packet_queue->packet_buffer[et].last_instr_type = 0; in cs_etm_decoder__buffer_packet()
378 packet_queue->packet_buffer[et].last_instr_subtype = 0; in cs_etm_decoder__buffer_packet()
379 packet_queue->packet_buffer[et].last_instr_cond = 0; in cs_etm_decoder__buffer_packet()
380 packet_queue->packet_buffer[et].flags = 0; in cs_etm_decoder__buffer_packet()
381 packet_queue->packet_buffer[et].exception_number = UINT32_MAX; in cs_etm_decoder__buffer_packet()
382 packet_queue->packet_buffer[et].trace_chan_id = trace_chan_id; in cs_etm_decoder__buffer_packet()
384 if (packet_queue->packet_count == CS_ETM_PACKET_MAX_BUFFER - 1) in cs_etm_decoder__buffer_packet()
392 struct cs_etm_packet_queue *packet_queue, in cs_etm_decoder__buffer_range() argument
399 ret = cs_etm_decoder__buffer_packet(packet_queue, trace_chan_id, in cs_etm_decoder__buffer_range()
404 packet = &packet_queue->packet_buffer[packet_queue->tail]; in cs_etm_decoder__buffer_range()
450 packet_queue->instr_count += elem->num_instr_range; in cs_etm_decoder__buffer_range()
452 ret = cs_etm_decoder__do_soft_timestamp(etmq, packet_queue, in cs_etm_decoder__buffer_range()
499 struct cs_etm_packet_queue *packet_queue, in cs_etm_decoder__set_tid() argument
546 cs_etm_decoder__reset_timestamp(packet_queue); in cs_etm_decoder__set_tid()
560 struct cs_etm_packet_queue *packet_queue; in cs_etm_decoder__gen_trace_elem_printer() local
563 packet_queue = cs_etm__etmq_get_packet_queue(etmq, trace_chan_id); in cs_etm_decoder__gen_trace_elem_printer()
564 if (!packet_queue) in cs_etm_decoder__gen_trace_elem_printer()
573 resp = cs_etm_decoder__buffer_discontinuity(packet_queue, in cs_etm_decoder__gen_trace_elem_printer()
577 resp = cs_etm_decoder__buffer_range(etmq, packet_queue, elem, in cs_etm_decoder__gen_trace_elem_printer()
581 resp = cs_etm_decoder__buffer_exception(packet_queue, elem, in cs_etm_decoder__gen_trace_elem_printer()
585 resp = cs_etm_decoder__buffer_exception_ret(packet_queue, in cs_etm_decoder__gen_trace_elem_printer()
594 resp = cs_etm_decoder__set_tid(etmq, packet_queue, in cs_etm_decoder__gen_trace_elem_printer()