Lines Matching full:packet

79 	struct cs_etm_packet *packet;  member
163 * Wnen a timestamp packet is encountered the backend code in cs_etm__etmq_set_traceid_queue_timestamp()
248 tidq->packet = zalloc(sizeof(struct cs_etm_packet)); in cs_etm__init_traceid_queue()
249 if (!tidq->packet) in cs_etm__init_traceid_queue()
279 zfree(&tidq->packet); in cs_etm__init_traceid_queue()
377 * Swap PACKET with PREV_PACKET: PACKET becomes PREV_PACKET for in cs_etm__packet_swap()
378 * the next incoming packet. in cs_etm__packet_swap()
380 tmp = tidq->packet; in cs_etm__packet_swap()
381 tidq->packet = tidq->prev_packet; in cs_etm__packet_swap()
567 zfree(&tidq->packet); in cs_etm__free_traceid_queues()
815 * encountering a timestamp, a full packet queue or the end of in cs_etm__setup_queue()
833 * We didn't find a timestamp so empty all the traceid packet in cs_etm__setup_queue()
834 * queues before looking for another timestamp packet, either in cs_etm__setup_queue()
849 * Note that packets decoded above are still in the traceID's packet in cs_etm__setup_queue()
951 static inline u64 cs_etm__first_executed_instr(struct cs_etm_packet *packet) in cs_etm__first_executed_instr() argument
953 /* Returns 0 for the CS_ETM_DISCONTINUITY packet */ in cs_etm__first_executed_instr()
954 if (packet->sample_type == CS_ETM_DISCONTINUITY) in cs_etm__first_executed_instr()
957 return packet->start_addr; in cs_etm__first_executed_instr()
961 u64 cs_etm__last_executed_instr(const struct cs_etm_packet *packet) in cs_etm__last_executed_instr() argument
963 /* Returns 0 for the CS_ETM_DISCONTINUITY packet */ in cs_etm__last_executed_instr()
964 if (packet->sample_type == CS_ETM_DISCONTINUITY) in cs_etm__last_executed_instr()
967 return packet->end_addr - packet->last_instr_size; in cs_etm__last_executed_instr()
972 const struct cs_etm_packet *packet, in cs_etm__instr_addr() argument
975 if (packet->isa == CS_ETM_ISA_T32) { in cs_etm__instr_addr()
976 u64 addr = packet->start_addr; in cs_etm__instr_addr()
987 return packet->start_addr + offset * 4; in cs_etm__instr_addr()
1009 be->to = cs_etm__first_executed_instr(tidq->packet); in cs_etm__update_last_branch_rb()
1115 const struct cs_etm_packet *packet, in cs_etm__copy_insn() argument
1120 * packet, so directly bail out with 'insn_len' = 0. in cs_etm__copy_insn()
1122 if (packet->sample_type == CS_ETM_DISCONTINUITY) { in cs_etm__copy_insn()
1131 if (packet->isa == CS_ETM_ISA_T32) in cs_etm__copy_insn()
1161 sample.cpu = tidq->packet->cpu; in cs_etm__synth_instruction_sample()
1165 cs_etm__copy_insn(etmq, tidq->trace_chan_id, tidq->packet, &sample); in cs_etm__synth_instruction_sample()
1188 * The cs etm packet encodes an instruction range between a branch target
1214 sample.addr = cs_etm__first_executed_instr(tidq->packet); in cs_etm__synth_branch_sample()
1218 sample.cpu = tidq->packet->cpu; in cs_etm__synth_branch_sample()
1381 /* Get instructions remainder from previous packet */ in cs_etm__sample()
1384 tidq->period_instructions += tidq->packet->instr_count; in cs_etm__sample()
1419 * tidq->packet->instr_count in cs_etm__sample()
1424 * last sample before the current etm packet, n+1 to n+3 in cs_etm__sample()
1425 * samples are generated from the current etm packet. in cs_etm__sample()
1427 * tidq->packet->instr_count represents the number of in cs_etm__sample()
1428 * instructions in the current etm packet. in cs_etm__sample()
1432 * previous etm packet. This will always be less than in cs_etm__sample()
1436 * instructions, one is the tail of the old packet and another in cs_etm__sample()
1437 * is the head of the new coming packet, to generate in cs_etm__sample()
1440 * instructions will be used by later packet and it is assigned in cs_etm__sample()
1445 * Get the initial offset into the current packet instructions; in cs_etm__sample()
1465 tidq->packet, offset - 1); in cs_etm__sample()
1481 /* Generate sample for tracing on packet */ in cs_etm__sample()
1485 /* Generate sample for branch taken packet */ in cs_etm__sample()
1505 * When the exception packet is inserted, whether the last instruction in cs_etm__exception()
1506 * in previous range packet is taken branch or not, we need to force in cs_etm__exception()
1511 * The exception packet includes the dummy address values, so don't in cs_etm__exception()
1512 * swap PACKET with PREV_PACKET. This keeps PREV_PACKET to be useful in cs_etm__exception()
1527 /* Handle start tracing packet */ in cs_etm__flush()
1580 * It has no new packet coming and 'etmq->packet' contains the stale in cs_etm__end_block()
1581 * packet which was set at the previous time with packets swapping; in cs_etm__end_block()
1582 * so skip to generate branch sample to avoid stale packet. in cs_etm__end_block()
1640 struct cs_etm_packet *packet, in cs_etm__is_svc_instr() argument
1648 switch (packet->isa) { in cs_etm__is_svc_instr()
1714 struct cs_etm_packet *packet = tidq->packet; in cs_etm__is_syscall() local
1718 if (packet->exception_number == CS_ETMV3_EXC_SVC) in cs_etm__is_syscall()
1724 * packet address. in cs_etm__is_syscall()
1727 if (packet->exception_number == CS_ETMV4_EXC_CALL && in cs_etm__is_syscall()
1739 struct cs_etm_packet *packet = tidq->packet; in cs_etm__is_async_exception() local
1742 if (packet->exception_number == CS_ETMV3_EXC_DEBUG_HALT || in cs_etm__is_async_exception()
1743 packet->exception_number == CS_ETMV3_EXC_ASYNC_DATA_ABORT || in cs_etm__is_async_exception()
1744 packet->exception_number == CS_ETMV3_EXC_PE_RESET || in cs_etm__is_async_exception()
1745 packet->exception_number == CS_ETMV3_EXC_IRQ || in cs_etm__is_async_exception()
1746 packet->exception_number == CS_ETMV3_EXC_FIQ) in cs_etm__is_async_exception()
1750 if (packet->exception_number == CS_ETMV4_EXC_RESET || in cs_etm__is_async_exception()
1751 packet->exception_number == CS_ETMV4_EXC_DEBUG_HALT || in cs_etm__is_async_exception()
1752 packet->exception_number == CS_ETMV4_EXC_SYSTEM_ERROR || in cs_etm__is_async_exception()
1753 packet->exception_number == CS_ETMV4_EXC_INST_DEBUG || in cs_etm__is_async_exception()
1754 packet->exception_number == CS_ETMV4_EXC_DATA_DEBUG || in cs_etm__is_async_exception()
1755 packet->exception_number == CS_ETMV4_EXC_IRQ || in cs_etm__is_async_exception()
1756 packet->exception_number == CS_ETMV4_EXC_FIQ) in cs_etm__is_async_exception()
1767 struct cs_etm_packet *packet = tidq->packet; in cs_etm__is_sync_exception() local
1771 if (packet->exception_number == CS_ETMV3_EXC_SMC || in cs_etm__is_sync_exception()
1772 packet->exception_number == CS_ETMV3_EXC_HYP || in cs_etm__is_sync_exception()
1773 packet->exception_number == CS_ETMV3_EXC_JAZELLE_THUMBEE || in cs_etm__is_sync_exception()
1774 packet->exception_number == CS_ETMV3_EXC_UNDEFINED_INSTR || in cs_etm__is_sync_exception()
1775 packet->exception_number == CS_ETMV3_EXC_PREFETCH_ABORT || in cs_etm__is_sync_exception()
1776 packet->exception_number == CS_ETMV3_EXC_DATA_FAULT || in cs_etm__is_sync_exception()
1777 packet->exception_number == CS_ETMV3_EXC_GENERIC) in cs_etm__is_sync_exception()
1781 if (packet->exception_number == CS_ETMV4_EXC_TRAP || in cs_etm__is_sync_exception()
1782 packet->exception_number == CS_ETMV4_EXC_ALIGNMENT || in cs_etm__is_sync_exception()
1783 packet->exception_number == CS_ETMV4_EXC_INST_FAULT || in cs_etm__is_sync_exception()
1784 packet->exception_number == CS_ETMV4_EXC_DATA_FAULT) in cs_etm__is_sync_exception()
1791 if (packet->exception_number == CS_ETMV4_EXC_CALL && in cs_etm__is_sync_exception()
1803 if (packet->exception_number > CS_ETMV4_EXC_FIQ && in cs_etm__is_sync_exception()
1804 packet->exception_number <= CS_ETMV4_EXC_END) in cs_etm__is_sync_exception()
1814 struct cs_etm_packet *packet = tidq->packet; in cs_etm__set_sample_flags() local
1820 switch (packet->sample_type) { in cs_etm__set_sample_flags()
1827 if (packet->last_instr_type == OCSD_INSTR_BR && in cs_etm__set_sample_flags()
1828 packet->last_instr_subtype == OCSD_S_INSTR_NONE) { in cs_etm__set_sample_flags()
1829 packet->flags = PERF_IP_FLAG_BRANCH; in cs_etm__set_sample_flags()
1831 if (packet->last_instr_cond) in cs_etm__set_sample_flags()
1832 packet->flags |= PERF_IP_FLAG_CONDITIONAL; in cs_etm__set_sample_flags()
1839 if (packet->last_instr_type == OCSD_INSTR_BR && in cs_etm__set_sample_flags()
1840 packet->last_instr_subtype == OCSD_S_INSTR_BR_LINK) in cs_etm__set_sample_flags()
1841 packet->flags = PERF_IP_FLAG_BRANCH | in cs_etm__set_sample_flags()
1848 if (packet->last_instr_type == OCSD_INSTR_BR_INDIRECT && in cs_etm__set_sample_flags()
1849 packet->last_instr_subtype == OCSD_S_INSTR_BR_LINK) in cs_etm__set_sample_flags()
1850 packet->flags = PERF_IP_FLAG_BRANCH | in cs_etm__set_sample_flags()
1858 if (packet->last_instr_type == OCSD_INSTR_BR_INDIRECT && in cs_etm__set_sample_flags()
1859 packet->last_instr_subtype == OCSD_S_INSTR_V7_IMPLIED_RET) in cs_etm__set_sample_flags()
1860 packet->flags = PERF_IP_FLAG_BRANCH | in cs_etm__set_sample_flags()
1868 if (packet->last_instr_type == OCSD_INSTR_BR_INDIRECT && in cs_etm__set_sample_flags()
1869 packet->last_instr_subtype == OCSD_S_INSTR_NONE) in cs_etm__set_sample_flags()
1870 packet->flags = PERF_IP_FLAG_BRANCH | in cs_etm__set_sample_flags()
1874 if (packet->last_instr_type == OCSD_INSTR_BR_INDIRECT && in cs_etm__set_sample_flags()
1875 packet->last_instr_subtype == OCSD_S_INSTR_V8_RET) in cs_etm__set_sample_flags()
1876 packet->flags = PERF_IP_FLAG_BRANCH | in cs_etm__set_sample_flags()
1889 * If the previous packet is an exception return packet in cs_etm__set_sample_flags()
1891 * it needs to calibrate the previous packet sample flags in cs_etm__set_sample_flags()
1898 packet, packet->start_addr)) in cs_etm__set_sample_flags()
1905 * The trace is discontinuous, if the previous packet is in cs_etm__set_sample_flags()
1906 * instruction packet, set flag PERF_IP_FLAG_TRACE_END in cs_etm__set_sample_flags()
1907 * for previous packet. in cs_etm__set_sample_flags()
1914 ret = cs_etm__get_magic(packet->trace_chan_id, &magic); in cs_etm__set_sample_flags()
1920 packet->flags = PERF_IP_FLAG_BRANCH | in cs_etm__set_sample_flags()
1928 packet->flags = PERF_IP_FLAG_BRANCH | in cs_etm__set_sample_flags()
1937 packet->flags = PERF_IP_FLAG_BRANCH | in cs_etm__set_sample_flags()
1942 * When the exception packet is inserted, since exception in cs_etm__set_sample_flags()
1943 * packet is not used standalone for generating samples in cs_etm__set_sample_flags()
1945 * packet; so set previous range packet flags to tell perf in cs_etm__set_sample_flags()
1949 prev_packet->flags = packet->flags; in cs_etm__set_sample_flags()
1953 * When the exception return packet is inserted, since in cs_etm__set_sample_flags()
1954 * exception return packet is not used standalone for in cs_etm__set_sample_flags()
1956 * instruction range packet; so set previous range packet in cs_etm__set_sample_flags()
1960 * other exception types; unfortunately the packet doesn't in cs_etm__set_sample_flags()
1962 * the exception type purely based on exception return packet. in cs_etm__set_sample_flags()
1963 * If we record the exception number from exception packet and in cs_etm__set_sample_flags()
1964 * reuse it for excpetion return packet, this is not reliable in cs_etm__set_sample_flags()
1967 * used for exception return packet for these two cases. in cs_etm__set_sample_flags()
1969 * For exception return packet, we only need to distinguish the in cs_etm__set_sample_flags()
1970 * packet is for system call or for other types. Thus the in cs_etm__set_sample_flags()
1971 * decision can be deferred when receive the next packet which in cs_etm__set_sample_flags()
1996 * Packets are decoded and added to the decoder's packet queue in cs_etm__decode_data_block()
1997 * until the decoder packet processing callback has requested that in cs_etm__decode_data_block()
1999 * operations that stop processing are a timestamp packet or a full in cs_etm__decode_data_block()
2026 /* Process each packet in this chunk */ in cs_etm__process_traceid_queue()
2029 tidq->packet); in cs_etm__process_traceid_queue()
2038 * Since packet addresses are swapped in packet in cs_etm__process_traceid_queue()
2048 switch (tidq->packet->sample_type) { in cs_etm__process_traceid_queue()
2051 * If the packet contains an instruction in cs_etm__process_traceid_queue()
2060 * If the exception packet is coming, in cs_etm__process_traceid_queue()
2062 * range packet to be handled properly. in cs_etm__process_traceid_queue()
2075 * Should not receive empty packet, in cs_etm__process_traceid_queue()
2078 pr_err("CS ETM Trace: empty packet\n"); in cs_etm__process_traceid_queue()
2132 * Process each packet in this chunk, nothing to do if in cs_etm__run_decoder()
2532 * has to be made for each packet that gets decoded, optimizing access in cs_etm__process_auxtrace_info()