Linux Perf
cs-etm-decoder.h
Go to the documentation of this file.
1 /*
2  * SPDX-License-Identifier: GPL-2.0
3  *
4  * Copyright(C) 2015-2018 Linaro Limited.
5  *
6  * Author: Tor Jeremiassen <tor@ti.com>
7  * Author: Mathieu Poirier <mathieu.poirier@linaro.org>
8  */
9 
10 #ifndef INCLUDE__CS_ETM_DECODER_H__
11 #define INCLUDE__CS_ETM_DECODER_H__
12 
13 #include <linux/types.h>
14 #include <stdio.h>
15 
16 struct cs_etm_decoder;
17 
18 struct cs_etm_buffer {
19  const unsigned char *buf;
20  size_t len;
21  u64 offset;
23 };
24 
26  CS_ETM_RANGE = 1 << 0,
27  CS_ETM_TRACE_ON = 1 << 1,
28 };
29 
30 struct cs_etm_packet {
31  enum cs_etm_sample_type sample_type;
33  u64 end_addr;
35  u8 exc;
36  u8 exc_ret;
37  int cpu;
38 };
39 
40 struct cs_etm_queue;
41 
42 typedef u32 (*cs_etm_mem_cb_type)(struct cs_etm_queue *, u64,
43  size_t, u8 *);
44 
46  u32 reg_idr0;
47  u32 reg_idr1;
48  u32 reg_idr2;
49  u32 reg_idr8;
52 };
53 
55  int protocol;
56  union {
57  struct cs_etmv4_trace_params etmv4;
58  };
59 };
60 
62  int operation;
63  void (*packet_printer)(const char *msg);
66  u8 fsyncs;
67  u8 hsyncs;
69  void *data;
70 };
71 
72 /*
73  * The following enums are indexed starting with 1 to align with the
74  * open source coresight trace decoder library.
75  */
76 enum {
80 };
81 
82 enum {
85 };
86 
88  u64 indx, const u8 *buf,
89  size_t len, size_t *consumed);
90 
91 struct cs_etm_decoder *
92 cs_etm_decoder__new(int num_cpu,
93  struct cs_etm_decoder_params *d_params,
94  struct cs_etm_trace_params t_params[]);
95 
96 void cs_etm_decoder__free(struct cs_etm_decoder *decoder);
97 
99  u64 start, u64 end,
100  cs_etm_mem_cb_type cb_func);
101 
102 int cs_etm_decoder__get_packet(struct cs_etm_decoder *decoder,
103  struct cs_etm_packet *packet);
104 
105 int cs_etm_decoder__reset(struct cs_etm_decoder *decoder);
106 
107 #endif /* INCLUDE__CS_ETM_DECODER_H__ */
struct cs_etm_decoder * cs_etm_decoder__new(int num_cpu, struct cs_etm_decoder_params *d_params, struct cs_etm_trace_params t_params[])
u32(* cs_etm_mem_cb_type)(struct cs_etm_queue *, u64, size_t, u8 *)
void cs_etm_decoder__free(struct cs_etm_decoder *decoder)
cs_etm_mem_cb_type mem_acc_cb
u8 last_instr_taken_branch
int cs_etm_decoder__process_data_block(struct cs_etm_decoder *decoder, u64 indx, const u8 *buf, size_t len, size_t *consumed)
int cs_etm_decoder__reset(struct cs_etm_decoder *decoder)
int cs_etm_decoder__add_mem_access_cb(struct cs_etm_decoder *decoder, u64 start, u64 end, cs_etm_mem_cb_type cb_func)
u64 start
Definition: hists_common.c:25
const unsigned char * buf
cs_etm_sample_type
int cs_etm_decoder__get_packet(struct cs_etm_decoder *decoder, struct cs_etm_packet *packet)