Lines Matching refs:packet

49 			       struct arm_spe_pkt *packet)
59 case 1: packet->payload = *(uint8_t *)buf; break;
60 case 2: packet->payload = get_unaligned_le16(buf); break;
61 case 4: packet->payload = get_unaligned_le32(buf); break;
62 case 8: packet->payload = get_unaligned_le64(buf); break;
69 static int arm_spe_get_pad(struct arm_spe_pkt *packet)
71 packet->type = ARM_SPE_PAD;
76 struct arm_spe_pkt *packet)
83 packet->type = ARM_SPE_PAD;
87 static int arm_spe_get_end(struct arm_spe_pkt *packet)
89 packet->type = ARM_SPE_END;
94 struct arm_spe_pkt *packet)
96 packet->type = ARM_SPE_TIMESTAMP;
97 return arm_spe_get_payload(buf, len, 0, packet);
101 struct arm_spe_pkt *packet)
103 packet->type = ARM_SPE_EVENTS;
110 packet->index = arm_spe_payload_len(buf[0]);
112 return arm_spe_get_payload(buf, len, 0, packet);
116 struct arm_spe_pkt *packet)
118 packet->type = ARM_SPE_DATA_SOURCE;
119 return arm_spe_get_payload(buf, len, 0, packet);
123 struct arm_spe_pkt *packet)
125 packet->type = ARM_SPE_CONTEXT;
126 packet->index = SPE_CTX_PKT_HDR_INDEX(buf[0]);
127 return arm_spe_get_payload(buf, len, 0, packet);
131 struct arm_spe_pkt *packet)
133 packet->type = ARM_SPE_OP_TYPE;
134 packet->index = SPE_OP_PKT_HDR_CLASS(buf[0]);
135 return arm_spe_get_payload(buf, len, 0, packet);
139 const unsigned char ext_hdr, struct arm_spe_pkt *packet)
141 packet->type = ARM_SPE_COUNTER;
144 packet->index = SPE_HDR_EXTENDED_INDEX(buf[0], buf[1]);
146 packet->index = SPE_HDR_SHORT_INDEX(buf[0]);
148 return arm_spe_get_payload(buf, len, ext_hdr, packet);
152 const unsigned char ext_hdr, struct arm_spe_pkt *packet)
154 packet->type = ARM_SPE_ADDRESS;
157 packet->index = SPE_HDR_EXTENDED_INDEX(buf[0], buf[1]);
159 packet->index = SPE_HDR_SHORT_INDEX(buf[0]);
161 return arm_spe_get_payload(buf, len, ext_hdr, packet);
165 struct arm_spe_pkt *packet)
170 memset(packet, 0, sizeof(struct arm_spe_pkt));
178 return arm_spe_get_pad(packet);
181 return arm_spe_get_end(packet);
184 return arm_spe_get_timestamp(buf, len, packet);
187 return arm_spe_get_events(buf, len, packet);
190 return arm_spe_get_data_source(buf, len, packet);
193 return arm_spe_get_context(buf, len, packet);
196 return arm_spe_get_op_type(buf, len, packet);
206 return arm_spe_get_alignment(buf, len, packet);
212 * address packet and counter packet, so don't need to distinguish if
216 return arm_spe_get_addr(buf, len, ext_hdr, packet);
219 return arm_spe_get_counter(buf, len, ext_hdr, packet);
225 struct arm_spe_pkt *packet)
229 ret = arm_spe_do_get_packet(buf, len, packet);
233 if (ret > 0 && packet->type == ARM_SPE_PAD) {
279 static int arm_spe_pkt_desc_event(const struct arm_spe_pkt *packet,
282 u64 payload = packet->payload;
321 static int arm_spe_pkt_desc_op_type(const struct arm_spe_pkt *packet,
324 u64 payload = packet->payload;
327 switch (packet->index) {
422 static int arm_spe_pkt_desc_addr(const struct arm_spe_pkt *packet,
425 int ns, el, idx = packet->index;
427 u64 payload = packet->payload;
464 static int arm_spe_pkt_desc_counter(const struct arm_spe_pkt *packet,
467 u64 payload = packet->payload;
468 const char *name = arm_spe_pkt_name(packet->type);
474 switch (packet->index) {
491 int arm_spe_pkt_desc(const struct arm_spe_pkt *packet, char *buf,
494 int idx = packet->index;
495 unsigned long long payload = packet->payload;
496 const char *name = arm_spe_pkt_name(packet->type);
501 switch (packet->type) {
508 err = arm_spe_pkt_desc_event(packet, buf, buf_len);
511 err = arm_spe_pkt_desc_op_type(packet, buf, buf_len);
518 err = arm_spe_pkt_desc_addr(packet, buf, buf_len);
525 err = arm_spe_pkt_desc_counter(packet, buf, buf_len);
528 /* Unknown packet type */
537 name, payload, packet->index);