Linux Perf
cs-etm.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3  * Copyright(C) 2015 Linaro Limited. All rights reserved.
4  * Author: Mathieu Poirier <mathieu.poirier@linaro.org>
5  */
6 
7 #ifndef INCLUDE__UTIL_PERF_CS_ETM_H__
8 #define INCLUDE__UTIL_PERF_CS_ETM_H__
9 
10 #include "util/event.h"
11 #include "util/session.h"
12 
13 /* Versionning header in case things need tro change in the future. That way
14  * decoding of old snapshot is still possible.
15  */
16 enum {
17  /* Starting with 0x0 */
19  /* PMU->type (32 bit), total # of CPUs (32 bit) */
23 };
24 
25 /* Beginning of header common to both ETMv3 and V4 */
26 enum {
29 };
30 
31 /* ETMv3/PTM metadata */
32 enum {
33  /* Dynamic, configurable parameters */
36  /* RO, taken from sysFS */
40 };
41 
42 /* ETMv4 metadata */
43 enum {
44  /* Dynamic, configurable parameters */
47  /* RO, taken from sysFS */
54 };
55 
56 /* RB tree for quick conversion between traceID and CPUs */
58 
59 #define KiB(x) ((x) * 1024)
60 #define MiB(x) ((x) * 1024 * 1024)
61 
62 #define CS_ETM_HEADER_SIZE (CS_HEADER_VERSION_0_MAX * sizeof(u64))
63 
64 static const u64 __perf_cs_etmv3_magic = 0x3030303030303030ULL;
65 static const u64 __perf_cs_etmv4_magic = 0x4040404040404040ULL;
66 #define CS_ETMV3_PRIV_SIZE (CS_ETM_PRIV_MAX * sizeof(u64))
67 #define CS_ETMV4_PRIV_SIZE (CS_ETMV4_PRIV_MAX * sizeof(u64))
68 
69 #ifdef HAVE_CSTRACE_SUPPORT
71  struct perf_session *session);
72 #else
73 static inline int
75  struct perf_session *session __maybe_unused)
76 {
77  return -1;
78 }
79 #endif
80 
81 #endif
static const u64 __perf_cs_etmv3_magic
Definition: cs-etm.h:64
static const u64 __perf_cs_etmv4_magic
Definition: cs-etm.h:65
static struct perf_session * session
Definition: builtin-lock.c:34
#define event
static int cs_etm__process_auxtrace_info(union perf_event *event __maybe_unused, struct perf_session *session __maybe_unused)
Definition: cs-etm.h:74
struct intlist * traceid_list
Definition: cs-etm.h:57