Linux Perf
cs-etm.c File Reference
#include <api/fs/fs.h>
#include <linux/bitops.h>
#include <linux/compiler.h>
#include <linux/coresight-pmu.h>
#include <linux/kernel.h>
#include <linux/log2.h>
#include <linux/types.h>
#include "cs-etm.h"
#include "../../perf.h"
#include "../../util/auxtrace.h"
#include "../../util/cpumap.h"
#include "../../util/evlist.h"
#include "../../util/evsel.h"
#include "../../util/pmu.h"
#include "../../util/thread_map.h"
#include "../../util/cs-etm.h"
#include <stdlib.h>
#include <sys/stat.h>
Include dependency graph for cs-etm.c:

Go to the source code of this file.

Classes

struct  cs_etm_recording
 

Macros

#define ENABLE_SINK_MAX   128
 
#define CS_BUS_DEVICE_PATH   "/bus/coresight/devices/"
 
#define BIT(N)   (1UL << (N))
 

Functions

static bool cs_etm_is_etmv4 (struct auxtrace_record *itr, int cpu)
 
static int cs_etm_parse_snapshot_options (struct auxtrace_record *itr, struct record_opts *opts, const char *str)
 
static int cs_etm_recording_options (struct auxtrace_record *itr, struct perf_evlist *evlist, struct record_opts *opts)
 
static u64 cs_etm_get_config (struct auxtrace_record *itr)
 
static u64 cs_etmv4_get_config (struct auxtrace_record *itr)
 
static size_t cs_etm_info_priv_size (struct auxtrace_record *itr __maybe_unused, struct perf_evlist *evlist __maybe_unused)
 
static int cs_etm_get_ro (struct perf_pmu *pmu, int cpu, const char *path)
 
static void cs_etm_get_metadata (int cpu, u32 *offset, struct auxtrace_record *itr, struct auxtrace_info_event *info)
 
static int cs_etm_info_fill (struct auxtrace_record *itr, struct perf_session *session, struct auxtrace_info_event *info, size_t priv_size)
 
static int cs_etm_find_snapshot (struct auxtrace_record *itr __maybe_unused, int idx, struct auxtrace_mmap *mm, unsigned char *data __maybe_unused, u64 *head, u64 *old)
 
static int cs_etm_snapshot_start (struct auxtrace_record *itr)
 
static int cs_etm_snapshot_finish (struct auxtrace_record *itr)
 
static u64 cs_etm_reference (struct auxtrace_record *itr __maybe_unused)
 
static void cs_etm_recording_free (struct auxtrace_record *itr)
 
static int cs_etm_read_finish (struct auxtrace_record *itr, int idx)
 
struct auxtrace_recordcs_etm_record_init (int *err)
 
static FILE * cs_device__open_file (const char *name)
 
static int __printf (2, 3)
 
int cs_etm_set_drv_config (struct perf_evsel_config_term *term)
 

Variables

static const char * metadata_etmv3_ro [CS_ETM_PRIV_MAX]
 
static const char * metadata_etmv4_ro [CS_ETMV4_PRIV_MAX]
 

Macro Definition Documentation

◆ BIT

#define BIT (   N)    (1UL << (N))

Definition at line 259 of file cs-etm.c.

◆ CS_BUS_DEVICE_PATH

#define CS_BUS_DEVICE_PATH   "/bus/coresight/devices/"

Definition at line 29 of file cs-etm.c.

◆ ENABLE_SINK_MAX

#define ENABLE_SINK_MAX   128

Definition at line 28 of file cs-etm.c.

Function Documentation

◆ __printf()

static int __printf ( ,
 
)
static

Definition at line 622 of file cs-etm.c.

Here is the call graph for this function:

◆ cs_device__open_file()

static FILE* cs_device__open_file ( const char *  name)
static

Definition at line 602 of file cs-etm.c.

◆ cs_etm_find_snapshot()

static int cs_etm_find_snapshot ( struct auxtrace_record *itr  __maybe_unused,
int  idx,
struct auxtrace_mmap mm,
unsigned char *data  __maybe_unused,
u64 *  head,
u64 *  old 
)
static

Definition at line 498 of file cs-etm.c.

◆ cs_etm_get_config()

static u64 cs_etm_get_config ( struct auxtrace_record itr)
static

Definition at line 231 of file cs-etm.c.

◆ cs_etm_get_metadata()

static void cs_etm_get_metadata ( int  cpu,
u32 *  offset,
struct auxtrace_record itr,
struct auxtrace_info_event info 
)
static

Definition at line 376 of file cs-etm.c.

Here is the call graph for this function:

◆ cs_etm_get_ro()

static int cs_etm_get_ro ( struct perf_pmu pmu,
int  cpu,
const char *  path 
)
static

Definition at line 360 of file cs-etm.c.

Here is the call graph for this function:

◆ cs_etm_info_fill()

static int cs_etm_info_fill ( struct auxtrace_record itr,
struct perf_session session,
struct auxtrace_info_event info,
size_t  priv_size 
)
static

Definition at line 441 of file cs-etm.c.

Here is the call graph for this function:

◆ cs_etm_info_priv_size()

static size_t cs_etm_info_priv_size ( struct auxtrace_record *itr  __maybe_unused,
struct perf_evlist *evlist  __maybe_unused 
)
static

Definition at line 285 of file cs-etm.c.

Here is the call graph for this function:

◆ cs_etm_is_etmv4()

static bool cs_etm_is_etmv4 ( struct auxtrace_record itr,
int  cpu 
)
static

Definition at line 338 of file cs-etm.c.

Here is the call graph for this function:

◆ cs_etm_parse_snapshot_options()

static int cs_etm_parse_snapshot_options ( struct auxtrace_record itr,
struct record_opts opts,
const char *  str 
)
static

Definition at line 41 of file cs-etm.c.

◆ cs_etm_read_finish()

static int cs_etm_read_finish ( struct auxtrace_record itr,
int  idx 
)
static

Definition at line 551 of file cs-etm.c.

Here is the call graph for this function:

◆ cs_etm_record_init()

struct auxtrace_record* cs_etm_record_init ( int *  err)

Definition at line 566 of file cs-etm.c.

Here is the call graph for this function:

◆ cs_etm_recording_free()

static void cs_etm_recording_free ( struct auxtrace_record itr)
static

Definition at line 544 of file cs-etm.c.

Here is the call graph for this function:

◆ cs_etm_recording_options()

static int cs_etm_recording_options ( struct auxtrace_record itr,
struct perf_evlist evlist,
struct record_opts opts 
)
static

Definition at line 63 of file cs-etm.c.

Here is the call graph for this function:

◆ cs_etm_reference()

static u64 cs_etm_reference ( struct auxtrace_record *itr  __maybe_unused)
static

Definition at line 538 of file cs-etm.c.

◆ cs_etm_set_drv_config()

int cs_etm_set_drv_config ( struct perf_evsel_config_term term)

Definition at line 638 of file cs-etm.c.

◆ cs_etm_snapshot_finish()

static int cs_etm_snapshot_finish ( struct auxtrace_record itr)
static

Definition at line 525 of file cs-etm.c.

Here is the call graph for this function:

◆ cs_etm_snapshot_start()

static int cs_etm_snapshot_start ( struct auxtrace_record itr)
static

Definition at line 512 of file cs-etm.c.

Here is the call graph for this function:

◆ cs_etmv4_get_config()

static u64 cs_etmv4_get_config ( struct auxtrace_record itr)
static

Definition at line 262 of file cs-etm.c.

Here is the call graph for this function:

Variable Documentation

◆ metadata_etmv3_ro

const char* metadata_etmv3_ro[CS_ETM_PRIV_MAX]
static
Initial value:
= {
[CS_ETM_ETMCCER] = "mgmt/etmccer",
[CS_ETM_ETMIDR] = "mgmt/etmidr",
}

Definition at line 325 of file cs-etm.c.

◆ metadata_etmv4_ro

const char* metadata_etmv4_ro[CS_ETMV4_PRIV_MAX]
static
Initial value:
= {
[CS_ETMV4_TRCIDR0] = "trcidr/trcidr0",
[CS_ETMV4_TRCIDR1] = "trcidr/trcidr1",
[CS_ETMV4_TRCIDR2] = "trcidr/trcidr2",
[CS_ETMV4_TRCIDR8] = "trcidr/trcidr8",
[CS_ETMV4_TRCAUTHSTATUS] = "mgmt/trcauthstatus",
}

Definition at line 330 of file cs-etm.c.