Lines Matching defs:packet
96 struct cs_etm_packet *packet;
263 * update metadata trace ID from the value found in the AUX_HW_INFO packet.
356 pr_err("CS_ETM: map mismatch between HW_ID packet CPU and Trace ID\n");
365 pr_err("CS_ETM: mismatch between CPU trace ID and HW_ID packet ID\n");
383 * if we are picking up the association from the packet, need to plug
394 * When a timestamp packet is encountered the backend code
481 tidq->packet = zalloc(sizeof(struct cs_etm_packet));
482 if (!tidq->packet)
512 zfree(&tidq->packet);
611 * the next incoming packet.
615 * packet is used for the 'from' IP for branch samples, so the
618 * tracking the thread for the previous packet the branch sample
621 tmp = tidq->packet;
622 tidq->packet = tidq->prev_packet;
807 zfree(&tidq->packet);
1132 * encountering a CS timestamp, a full packet queue or the end of
1150 * We didn't find a timestamp so empty all the traceid packet
1151 * queues before looking for another timestamp packet, either
1166 * Note that packets decoded above are still in the traceID's packet
1241 static inline u64 cs_etm__first_executed_instr(struct cs_etm_packet *packet)
1243 /* Returns 0 for the CS_ETM_DISCONTINUITY packet */
1244 if (packet->sample_type == CS_ETM_DISCONTINUITY)
1247 return packet->start_addr;
1251 u64 cs_etm__last_executed_instr(const struct cs_etm_packet *packet)
1253 /* Returns 0 for the CS_ETM_DISCONTINUITY packet */
1254 if (packet->sample_type == CS_ETM_DISCONTINUITY)
1257 return packet->end_addr - packet->last_instr_size;
1262 const struct cs_etm_packet *packet,
1265 if (packet->isa == CS_ETM_ISA_T32) {
1266 u64 addr = packet->start_addr;
1277 return packet->start_addr + offset * 4;
1299 be->to = cs_etm__first_executed_instr(tidq->packet);
1400 const struct cs_etm_packet *packet,
1405 * packet, so directly bail out with 'insn_len' = 0.
1407 if (packet->sample_type == CS_ETM_DISCONTINUITY) {
1416 if (packet->isa == CS_ETM_ISA_T32)
1471 sample.cpu = tidq->packet->cpu;
1475 cs_etm__copy_insn(etmq, tidq->trace_chan_id, tidq->packet, &sample);
1498 * The cs etm packet encodes an instruction range between a branch target
1528 sample.addr = cs_etm__first_executed_instr(tidq->packet);
1532 sample.cpu = tidq->packet->cpu;
1693 /* Get instructions remainder from previous packet */
1696 tidq->period_instructions += tidq->packet->instr_count;
1731 * tidq->packet->instr_count
1736 * last sample before the current etm packet, n+1 to n+3
1737 * samples are generated from the current etm packet.
1739 * tidq->packet->instr_count represents the number of
1740 * instructions in the current etm packet.
1744 * previous etm packet. This will always be less than
1748 * instructions, one is the tail of the old packet and another
1749 * is the head of the new coming packet, to generate
1752 * instructions will be used by later packet and it is assigned
1757 * Get the initial offset into the current packet instructions;
1777 tidq->packet, offset - 1);
1793 /* Generate sample for tracing on packet */
1797 /* Generate sample for branch taken packet */
1817 * When the exception packet is inserted, whether the last instruction
1818 * in previous range packet is taken branch or not, we need to force
1823 * The exception packet includes the dummy address values, so don't
1839 /* Handle start tracing packet */
1893 * It has no new packet coming and 'etmq->packet' contains the stale
1894 * packet which was set at the previous time with packets swapping;
1895 * so skip to generate branch sample to avoid stale packet.
1954 struct cs_etm_packet *packet,
1962 switch (packet->isa) {
2028 struct cs_etm_packet *packet = tidq->packet;
2032 if (packet->exception_number == CS_ETMV3_EXC_SVC)
2038 * packet address.
2041 if (packet->exception_number == CS_ETMV4_EXC_CALL &&
2053 struct cs_etm_packet *packet = tidq->packet;
2056 if (packet->exception_number == CS_ETMV3_EXC_DEBUG_HALT ||
2057 packet->exception_number == CS_ETMV3_EXC_ASYNC_DATA_ABORT ||
2058 packet->exception_number == CS_ETMV3_EXC_PE_RESET ||
2059 packet->exception_number == CS_ETMV3_EXC_IRQ ||
2060 packet->exception_number == CS_ETMV3_EXC_FIQ)
2064 if (packet->exception_number == CS_ETMV4_EXC_RESET ||
2065 packet->exception_number == CS_ETMV4_EXC_DEBUG_HALT ||
2066 packet->exception_number == CS_ETMV4_EXC_SYSTEM_ERROR ||
2067 packet->exception_number == CS_ETMV4_EXC_INST_DEBUG ||
2068 packet->exception_number == CS_ETMV4_EXC_DATA_DEBUG ||
2069 packet->exception_number == CS_ETMV4_EXC_IRQ ||
2070 packet->exception_number == CS_ETMV4_EXC_FIQ)
2081 struct cs_etm_packet *packet = tidq->packet;
2085 if (packet->exception_number == CS_ETMV3_EXC_SMC ||
2086 packet->exception_number == CS_ETMV3_EXC_HYP ||
2087 packet->exception_number == CS_ETMV3_EXC_JAZELLE_THUMBEE ||
2088 packet->exception_number == CS_ETMV3_EXC_UNDEFINED_INSTR ||
2089 packet->exception_number == CS_ETMV3_EXC_PREFETCH_ABORT ||
2090 packet->exception_number == CS_ETMV3_EXC_DATA_FAULT ||
2091 packet->exception_number == CS_ETMV3_EXC_GENERIC)
2095 if (packet->exception_number == CS_ETMV4_EXC_TRAP ||
2096 packet->exception_number == CS_ETMV4_EXC_ALIGNMENT ||
2097 packet->exception_number == CS_ETMV4_EXC_INST_FAULT ||
2098 packet->exception_number == CS_ETMV4_EXC_DATA_FAULT)
2105 if (packet->exception_number == CS_ETMV4_EXC_CALL &&
2117 if (packet->exception_number > CS_ETMV4_EXC_FIQ &&
2118 packet->exception_number <= CS_ETMV4_EXC_END)
2128 struct cs_etm_packet *packet = tidq->packet;
2134 switch (packet->sample_type) {
2141 if (packet->last_instr_type == OCSD_INSTR_BR &&
2142 packet->last_instr_subtype == OCSD_S_INSTR_NONE) {
2143 packet->flags = PERF_IP_FLAG_BRANCH;
2145 if (packet->last_instr_cond)
2146 packet->flags |= PERF_IP_FLAG_CONDITIONAL;
2153 if (packet->last_instr_type == OCSD_INSTR_BR &&
2154 packet->last_instr_subtype == OCSD_S_INSTR_BR_LINK)
2155 packet->flags = PERF_IP_FLAG_BRANCH |
2162 if (packet->last_instr_type == OCSD_INSTR_BR_INDIRECT &&
2163 packet->last_instr_subtype == OCSD_S_INSTR_BR_LINK)
2164 packet->flags = PERF_IP_FLAG_BRANCH |
2172 if (packet->last_instr_type == OCSD_INSTR_BR_INDIRECT &&
2173 packet->last_instr_subtype == OCSD_S_INSTR_V7_IMPLIED_RET)
2174 packet->flags = PERF_IP_FLAG_BRANCH |
2182 if (packet->last_instr_type == OCSD_INSTR_BR_INDIRECT &&
2183 packet->last_instr_subtype == OCSD_S_INSTR_NONE)
2184 packet->flags = PERF_IP_FLAG_BRANCH |
2188 if (packet->last_instr_type == OCSD_INSTR_BR_INDIRECT &&
2189 packet->last_instr_subtype == OCSD_S_INSTR_V8_RET)
2190 packet->flags = PERF_IP_FLAG_BRANCH |
2203 * If the previous packet is an exception return packet
2205 * it needs to calibrate the previous packet sample flags
2212 packet, packet->start_addr))
2219 * The trace is discontinuous, if the previous packet is
2220 * instruction packet, set flag PERF_IP_FLAG_TRACE_END
2221 * for previous packet.
2228 ret = cs_etm__get_magic(packet->trace_chan_id, &magic);
2234 packet->flags = PERF_IP_FLAG_BRANCH |
2242 packet->flags = PERF_IP_FLAG_BRANCH |
2251 packet->flags = PERF_IP_FLAG_BRANCH |
2256 * When the exception packet is inserted, since exception
2257 * packet is not used standalone for generating samples
2259 * packet; so set previous range packet flags to tell perf
2263 prev_packet->flags = packet->flags;
2267 * When the exception return packet is inserted, since
2268 * exception return packet is not used standalone for
2270 * instruction range packet; so set previous range packet
2274 * other exception types; unfortunately the packet doesn't
2276 * the exception type purely based on exception return packet.
2277 * If we record the exception number from exception packet and
2278 * reuse it for exception return packet, this is not reliable
2281 * used for exception return packet for these two cases.
2283 * For exception return packet, we only need to distinguish the
2284 * packet is for system call or for other types. Thus the
2285 * decision can be deferred when receive the next packet which
2310 * Packets are decoded and added to the decoder's packet queue
2311 * until the decoder packet processing callback has requested that
2313 * operations that stop processing are a timestamp packet or a full
2340 /* Process each packet in this chunk */
2343 tidq->packet);
2352 * Since packet addresses are swapped in packet
2362 switch (tidq->packet->sample_type) {
2365 * If the packet contains an instruction
2374 * If the exception packet is coming,
2376 * range packet to be handled properly.
2389 * Should not receive empty packet,
2392 pr_err("CS ETM Trace: empty packet\n");
2446 * Process each packet in this chunk, nothing to do if
3227 * has to be made for each packet that gets decoded, optimizing access