1 /* SPDX-License-Identifier: GPL-2.0 */
3 * arm_spe_decoder.h: Arm Statistical Profiling Extensions support
4 * Copyright (c) 2019-2020, Arm Ltd.
7 #ifndef INCLUDE__ARM_SPE_DECODER_H__
8 #define INCLUDE__ARM_SPE_DECODER_H__
14 #include "arm-spe-pkt-decoder.h"
16 enum arm_spe_sample_type {
17 ARM_SPE_L1D_ACCESS = 1 << 0,
18 ARM_SPE_L1D_MISS = 1 << 1,
19 ARM_SPE_LLC_ACCESS = 1 << 2,
20 ARM_SPE_LLC_MISS = 1 << 3,
21 ARM_SPE_TLB_ACCESS = 1 << 4,
22 ARM_SPE_TLB_MISS = 1 << 5,
23 ARM_SPE_BRANCH_MISS = 1 << 6,
24 ARM_SPE_REMOTE_ACCESS = 1 << 7,
27 enum arm_spe_op_type {
32 struct arm_spe_record {
33 enum arm_spe_sample_type type;
45 struct arm_spe_buffer {
46 const unsigned char *buf;
52 struct arm_spe_params {
53 int (*get_trace)(struct arm_spe_buffer *buffer, void *data);
57 struct arm_spe_decoder {
58 int (*get_trace)(struct arm_spe_buffer *buffer, void *data);
60 struct arm_spe_record record;
62 const unsigned char *buf;
65 struct arm_spe_pkt packet;
68 struct arm_spe_decoder *arm_spe_decoder_new(struct arm_spe_params *params);
69 void arm_spe_decoder_free(struct arm_spe_decoder *decoder);
71 int arm_spe_decode(struct arm_spe_decoder *decoder);