Lines Matching full:packet
62 struct arm_spe_pkt *packet) in arm_spe_get_payload() argument
72 case 1: packet->payload = *(uint8_t *)buf; break; in arm_spe_get_payload()
73 case 2: packet->payload = le16_to_cpu(*(uint16_t *)buf); break; in arm_spe_get_payload()
74 case 4: packet->payload = le32_to_cpu(*(uint32_t *)buf); break; in arm_spe_get_payload()
75 case 8: packet->payload = le64_to_cpu(*(uint64_t *)buf); break; in arm_spe_get_payload()
82 static int arm_spe_get_pad(struct arm_spe_pkt *packet) in arm_spe_get_pad() argument
84 packet->type = ARM_SPE_PAD; in arm_spe_get_pad()
89 struct arm_spe_pkt *packet) in arm_spe_get_alignment() argument
96 packet->type = ARM_SPE_PAD; in arm_spe_get_alignment()
100 static int arm_spe_get_end(struct arm_spe_pkt *packet) in arm_spe_get_end() argument
102 packet->type = ARM_SPE_END; in arm_spe_get_end()
107 struct arm_spe_pkt *packet) in arm_spe_get_timestamp() argument
109 packet->type = ARM_SPE_TIMESTAMP; in arm_spe_get_timestamp()
110 return arm_spe_get_payload(buf, len, 0, packet); in arm_spe_get_timestamp()
114 struct arm_spe_pkt *packet) in arm_spe_get_events() argument
116 packet->type = ARM_SPE_EVENTS; in arm_spe_get_events()
123 packet->index = arm_spe_payload_len(buf[0]); in arm_spe_get_events()
125 return arm_spe_get_payload(buf, len, 0, packet); in arm_spe_get_events()
129 struct arm_spe_pkt *packet) in arm_spe_get_data_source() argument
131 packet->type = ARM_SPE_DATA_SOURCE; in arm_spe_get_data_source()
132 return arm_spe_get_payload(buf, len, 0, packet); in arm_spe_get_data_source()
136 struct arm_spe_pkt *packet) in arm_spe_get_context() argument
138 packet->type = ARM_SPE_CONTEXT; in arm_spe_get_context()
139 packet->index = SPE_CTX_PKT_HDR_INDEX(buf[0]); in arm_spe_get_context()
140 return arm_spe_get_payload(buf, len, 0, packet); in arm_spe_get_context()
144 struct arm_spe_pkt *packet) in arm_spe_get_op_type() argument
146 packet->type = ARM_SPE_OP_TYPE; in arm_spe_get_op_type()
147 packet->index = SPE_OP_PKT_HDR_CLASS(buf[0]); in arm_spe_get_op_type()
148 return arm_spe_get_payload(buf, len, 0, packet); in arm_spe_get_op_type()
152 const unsigned char ext_hdr, struct arm_spe_pkt *packet) in arm_spe_get_counter() argument
154 packet->type = ARM_SPE_COUNTER; in arm_spe_get_counter()
157 packet->index = SPE_HDR_EXTENDED_INDEX(buf[0], buf[1]); in arm_spe_get_counter()
159 packet->index = SPE_HDR_SHORT_INDEX(buf[0]); in arm_spe_get_counter()
161 return arm_spe_get_payload(buf, len, ext_hdr, packet); in arm_spe_get_counter()
165 const unsigned char ext_hdr, struct arm_spe_pkt *packet) in arm_spe_get_addr() argument
167 packet->type = ARM_SPE_ADDRESS; in arm_spe_get_addr()
170 packet->index = SPE_HDR_EXTENDED_INDEX(buf[0], buf[1]); in arm_spe_get_addr()
172 packet->index = SPE_HDR_SHORT_INDEX(buf[0]); in arm_spe_get_addr()
174 return arm_spe_get_payload(buf, len, ext_hdr, packet); in arm_spe_get_addr()
178 struct arm_spe_pkt *packet) in arm_spe_do_get_packet() argument
183 memset(packet, 0, sizeof(struct arm_spe_pkt)); in arm_spe_do_get_packet()
191 return arm_spe_get_pad(packet); in arm_spe_do_get_packet()
194 return arm_spe_get_end(packet); in arm_spe_do_get_packet()
197 return arm_spe_get_timestamp(buf, len, packet); in arm_spe_do_get_packet()
200 return arm_spe_get_events(buf, len, packet); in arm_spe_do_get_packet()
203 return arm_spe_get_data_source(buf, len, packet); in arm_spe_do_get_packet()
206 return arm_spe_get_context(buf, len, packet); in arm_spe_do_get_packet()
209 return arm_spe_get_op_type(buf, len, packet); in arm_spe_do_get_packet()
219 return arm_spe_get_alignment(buf, len, packet); in arm_spe_do_get_packet()
225 * address packet and counter packet, so don't need to distinguish if in arm_spe_do_get_packet()
229 return arm_spe_get_addr(buf, len, ext_hdr, packet); in arm_spe_do_get_packet()
232 return arm_spe_get_counter(buf, len, ext_hdr, packet); in arm_spe_do_get_packet()
238 struct arm_spe_pkt *packet) in arm_spe_get_packet() argument
242 ret = arm_spe_do_get_packet(buf, len, packet); in arm_spe_get_packet()
246 if (ret > 0 && packet->type == ARM_SPE_PAD) { in arm_spe_get_packet()
292 static int arm_spe_pkt_desc_event(const struct arm_spe_pkt *packet, in arm_spe_pkt_desc_event() argument
295 u64 payload = packet->payload; in arm_spe_pkt_desc_event()
332 static int arm_spe_pkt_desc_op_type(const struct arm_spe_pkt *packet, in arm_spe_pkt_desc_op_type() argument
335 u64 payload = packet->payload; in arm_spe_pkt_desc_op_type()
338 switch (packet->index) { in arm_spe_pkt_desc_op_type()
418 static int arm_spe_pkt_desc_addr(const struct arm_spe_pkt *packet, in arm_spe_pkt_desc_addr() argument
421 int ns, el, idx = packet->index; in arm_spe_pkt_desc_addr()
423 u64 payload = packet->payload; in arm_spe_pkt_desc_addr()
458 static int arm_spe_pkt_desc_counter(const struct arm_spe_pkt *packet, in arm_spe_pkt_desc_counter() argument
461 u64 payload = packet->payload; in arm_spe_pkt_desc_counter()
462 const char *name = arm_spe_pkt_name(packet->type); in arm_spe_pkt_desc_counter()
468 switch (packet->index) { in arm_spe_pkt_desc_counter()
485 int arm_spe_pkt_desc(const struct arm_spe_pkt *packet, char *buf, in arm_spe_pkt_desc() argument
488 int idx = packet->index; in arm_spe_pkt_desc()
489 unsigned long long payload = packet->payload; in arm_spe_pkt_desc()
490 const char *name = arm_spe_pkt_name(packet->type); in arm_spe_pkt_desc()
495 switch (packet->type) { in arm_spe_pkt_desc()
502 err = arm_spe_pkt_desc_event(packet, buf, buf_len); in arm_spe_pkt_desc()
505 err = arm_spe_pkt_desc_op_type(packet, buf, buf_len); in arm_spe_pkt_desc()
512 err = arm_spe_pkt_desc_addr(packet, buf, buf_len); in arm_spe_pkt_desc()
519 err = arm_spe_pkt_desc_counter(packet, buf, buf_len); in arm_spe_pkt_desc()
522 /* Unknown packet type */ in arm_spe_pkt_desc()
531 name, payload, packet->index); in arm_spe_pkt_desc()