Lines Matching refs:packet
58 unsigned char extHdr, struct SpePkt *packet)
60 CHECK_TRUE(buf == nullptr || packet == nullptr, -1, 1, "Invalid pointer!");
68 case LEN_TYPE_BYTE: packet->payload = *(reinterpret_cast<const uint8_t *>(buf)); break;
69 case LEN_TYPE_HLFWRD: packet->payload = LE16_TO_CPU(*reinterpret_cast<const uint16_t *>(buf)); break;
70 case LEN_TYPE_WORD: packet->payload = LE32_TO_CPU(*reinterpret_cast<const uint32_t *>(buf)); break;
71 case LEN_TYPE_DBLEWRD: packet->payload = LE64_TO_CPU(*reinterpret_cast<const uint64_t *>(buf)); break;
78 static int SpeGetPad(struct SpePkt *packet)
80 CHECK_TRUE(packet == nullptr, -1, 1, "Invalid pointer!");
81 packet->type = PERF_SPE_PAD;
86 struct SpePkt *packet)
88 CHECK_TRUE(buf == nullptr || packet == nullptr, -1, 1, "Invalid pointer!");
94 packet->type = PERF_SPE_PAD;
98 static int SpeGetEnd(struct SpePkt *packet)
100 CHECK_TRUE(packet == nullptr, -1, 1, "Invalid pointer!");
101 packet->type = PERF_SPE_END;
106 struct SpePkt *packet)
108 CHECK_TRUE(buf == nullptr || packet == nullptr, -1, 1, "Invalid pointer!");
109 packet->type = PERF_SPE_TIMESTAMP;
110 return SpeGetPayload(buf, len, 0, packet);
114 struct SpePkt *packet)
116 CHECK_TRUE(buf == nullptr || packet == nullptr, -1, 1, "Invalid pointer!");
117 packet->type = PERF_SPE_EVENTS;
118 packet->index = SpePayloadLen(buf[0]);
119 return SpeGetPayload(buf, len, 0, packet);
123 struct SpePkt *packet)
125 CHECK_TRUE(buf == nullptr || packet == nullptr, -1, 1, "Invalid pointer!");
126 packet->type = PERF_SPE_DATA_SOURCE;
127 return SpeGetPayload(buf, len, 0, packet);
131 struct SpePkt *packet)
133 CHECK_TRUE(buf == nullptr || packet == nullptr, -1, 1, "Invalid pointer!");
134 packet->type = PERF_SPE_CONTEXT;
135 packet->index = PERF_SPE_CTX_PKT_HDR_INDEX(buf[0]);
136 return SpeGetPayload(buf, len, 0, packet);
140 struct SpePkt *packet)
142 CHECK_TRUE(buf == nullptr || packet == nullptr, -1, 1, "Invalid pointer!");
143 packet->type = PERF_SPE_OP_TYPE;
144 packet->index = PERF_SPE_OP_PKT_HDR_CLASS(buf[0]);
145 return SpeGetPayload(buf, len, 0, packet);
149 const unsigned char extHdr, struct SpePkt *packet)
151 CHECK_TRUE(buf == nullptr || packet == nullptr, -1, 1, "Invalid pointer!");
152 packet->type = PERF_SPE_COUNTER;
154 packet->index = PERF_SPE_HDR_EXTENDED_INDEX(buf[0], buf[1]);
156 packet->index = PERF_SPE_HDR_SHORT_INDEX(buf[0]);
159 return SpeGetPayload(buf, len, extHdr, packet);
163 const unsigned char extHdr, struct SpePkt *packet)
165 CHECK_TRUE(buf == nullptr || packet == nullptr, -1, 1, "Invalid pointer!");
166 packet->type = PERF_SPE_ADDRESS;
168 packet->index = PERF_SPE_HDR_EXTENDED_INDEX(buf[0], buf[1]);
170 packet->index = PERF_SPE_HDR_SHORT_INDEX(buf[0]);
173 return SpeGetPayload(buf, len, extHdr, packet);
177 struct SpePkt *packet)
179 CHECK_TRUE(buf == nullptr || packet == nullptr, -1, 1, "Invalid pointer!");
183 memset_s(packet, sizeof(struct SpePkt), 0, sizeof(struct SpePkt));
191 return SpeGetPad(packet);
193 return SpeGetEnd(packet);
196 return SpeGetTimestamp(buf, len, packet);
198 return SpeGetEvents(buf, len, packet);
200 return SpeGetDataSource(buf, len, packet);
202 return SpeGetContext(buf, len, packet);
204 return SpeGetOpType(buf, len, packet);
215 return SpeGetAlignment(buf, len, packet);
222 * address packet and counter packet, so don't need to distinguish if
226 return SpeGetAddr(buf, len, extHdr, packet);
230 return SpeGetCounter(buf, len, extHdr, packet);
236 struct SpePkt *packet)
238 CHECK_TRUE(buf == nullptr || packet == nullptr, -1, 1, "Invalid pointer!");
239 int ret = SpeDoGetPacket(buf, len, packet);
243 if (ret > 0 && packet->type == PERF_SPE_PAD) {
294 static int SpePktDescEvent(const struct SpePkt *packet,
297 CHECK_TRUE(buf == nullptr || packet == nullptr, -1, 1, "Invalid pointer!");
298 u64 payload = packet->payload;
348 static int SpePktDescOpType(const struct SpePkt *packet,
351 CHECK_TRUE(buf == nullptr || packet == nullptr, -1, 1, "Invalid pointer!");
352 u64 payload = packet->payload;
355 switch (packet->index) {
436 /* Unknown packet index */
444 static int SpePktDescAddr(const struct SpePkt *packet,
447 CHECK_TRUE(buf == nullptr || packet == nullptr, -1, 1, "Invalid pointer!");
450 int idx = packet->index;
453 u64 payload = packet->payload;
482 /* Unknown packet index */
490 static int SpePktDesCont(const struct SpePkt *packet,
493 CHECK_TRUE(buf == nullptr || packet == nullptr, -1, 1, "Invalid pointer!");
494 u64 payload = packet->payload;
495 const char *name = SpePktName(packet->type);
501 switch (packet->index) {
518 int SpePktDesc(const struct SpePkt *packet, char *buf,
521 CHECK_TRUE(buf == nullptr || packet == nullptr, -1, 1, "Invalid pointer!");
522 int idx = packet->index;
523 unsigned long long payload = packet->payload;
524 const char *name = SpePktName(packet->type);
529 switch (packet->type) {
536 err = SpePktDescEvent(packet, buf, bufLen);
539 err = SpePktDescOpType(packet, buf, bufLen);
546 err = SpePktDescAddr(packet, buf, bufLen);
553 err = SpePktDesCont(packet, buf, bufLen);
556 /* Unknown packet type */
565 name, payload, packet->index);
597 * Armv8 ARM (ARM DDI 0487F.c), chapter "D10.2.1 Address packet"
623 HLOGV("ignoring address packet index: 0x%x\n", index);
665 &decoder->packet);
675 } while (decoder->packet.type == PERF_SPE_PAD);
693 int idx = decoder->packet.index;
694 payload = decoder->packet.payload;
696 switch (decoder->packet.type) {
746 HLOGV("Get packet error!");
798 printf("Get packet error!\n");
834 struct SpePkt packet;
842 int ret = SpeGetPacket(buf, len, &packet);
857 ret = SpePktDesc(&packet, desc,
863 PRINT_INDENT(indent, " Bad packet!\n");