Linux Perf
evsel.c File Reference
#include <byteswap.h>
#include <errno.h>
#include <inttypes.h>
#include <linux/bitops.h>
#include <api/fs/fs.h>
#include <api/fs/tracing_path.h>
#include <traceevent/event-parse.h>
#include <linux/hw_breakpoint.h>
#include <linux/perf_event.h>
#include <linux/compiler.h>
#include <linux/err.h>
#include <sys/ioctl.h>
#include <sys/resource.h>
#include <sys/types.h>
#include <dirent.h>
#include "asm/bug.h"
#include "callchain.h"
#include "cgroup.h"
#include "event.h"
#include "evsel.h"
#include "evlist.h"
#include "util.h"
#include "cpumap.h"
#include "thread_map.h"
#include "target.h"
#include "perf_regs.h"
#include "debug.h"
#include "trace-event.h"
#include "stat.h"
#include "memswap.h"
#include "util/parse-branch-options.h"
#include "sane_ctype.h"
Include dependency graph for evsel.c:

Go to the source code of this file.

Classes

struct  bit_names
 

Macros

#define FD(e, x, y)   (*(int *)xyarray__entry(e->fd, x, y))
 
#define FUNCTION_EVENT   "ftrace:function"
 
#define MOD_PRINT(context, mod)
 
#define C(x)   PERF_COUNT_HW_CACHE_##x
 
#define CACHE_READ   (1 << C(OP_READ))
 
#define CACHE_WRITE   (1 << C(OP_WRITE))
 
#define CACHE_PREFETCH   (1 << C(OP_PREFETCH))
 
#define COP(x)   (1 << x)
 
#define bit_name(n)   { PERF_SAMPLE_##n, #n }
 
#define bit_name(n)   { PERF_SAMPLE_BRANCH_##n, #n }
 
#define bit_name(n)   { PERF_FORMAT_##n, #n }
 
#define BUF_SIZE   1024
 
#define p_hex(val)   snprintf(buf, BUF_SIZE, "%#"PRIx64, (uint64_t)(val))
 
#define p_unsigned(val)   snprintf(buf, BUF_SIZE, "%"PRIu64, (uint64_t)(val))
 
#define p_signed(val)   snprintf(buf, BUF_SIZE, "%"PRId64, (int64_t)(val))
 
#define p_sample_type(val)   __p_sample_type(buf, BUF_SIZE, val)
 
#define p_branch_sample_type(val)   __p_branch_sample_type(buf, BUF_SIZE, val)
 
#define p_read_format(val)   __p_read_format(buf, BUF_SIZE, val)
 
#define PRINT_ATTRn(_n, _f, _p)
 
#define PRINT_ATTRf(_f, _p)   PRINT_ATTRn(#_f, _f, _p)
 
#define OVERFLOW_CHECK(offset, size, max_size)
 
#define OVERFLOW_CHECK_u64(offset)   OVERFLOW_CHECK(offset, sizeof(u64), sizeof(u64))
 

Functions

static int perf_evsel__no_extra_init (struct perf_evsel *evsel __maybe_unused)
 
void __weak test_attr__ready (void)
 
static void perf_evsel__no_extra_fini (struct perf_evsel *evsel __maybe_unused)
 
int perf_evsel__object_config (size_t object_size, int(*init)(struct perf_evsel *evsel), void(*fini)(struct perf_evsel *evsel))
 
int __perf_evsel__sample_size (u64 sample_type)
 
static int __perf_evsel__calc_id_pos (u64 sample_type)
 
static int __perf_evsel__calc_is_pos (u64 sample_type)
 
void perf_evsel__calc_id_pos (struct perf_evsel *evsel)
 
void __perf_evsel__set_sample_bit (struct perf_evsel *evsel, enum perf_event_sample_format bit)
 
void __perf_evsel__reset_sample_bit (struct perf_evsel *evsel, enum perf_event_sample_format bit)
 
void perf_evsel__set_sample_id (struct perf_evsel *evsel, bool can_sample_identifier)
 
bool perf_evsel__is_function_event (struct perf_evsel *evsel)
 
void perf_evsel__init (struct perf_evsel *evsel, struct perf_event_attr *attr, int idx)
 
struct perf_evselperf_evsel__new_idx (struct perf_event_attr *attr, int idx)
 
static bool perf_event_can_profile_kernel (void)
 
struct perf_evselperf_evsel__new_cycles (bool precise)
 
struct perf_evselperf_evsel__newtp_idx (const char *sys, const char *name, int idx)
 
static const char * __perf_evsel__hw_name (u64 config)
 
static int perf_evsel__add_modifiers (struct perf_evsel *evsel, char *bf, size_t size)
 
static int perf_evsel__hw_name (struct perf_evsel *evsel, char *bf, size_t size)
 
static const char * __perf_evsel__sw_name (u64 config)
 
static int perf_evsel__sw_name (struct perf_evsel *evsel, char *bf, size_t size)
 
static int __perf_evsel__bp_name (char *bf, size_t size, u64 addr, u64 type)
 
static int perf_evsel__bp_name (struct perf_evsel *evsel, char *bf, size_t size)
 
bool perf_evsel__is_cache_op_valid (u8 type, u8 op)
 
int __perf_evsel__hw_cache_type_op_res_name (u8 type, u8 op, u8 result, char *bf, size_t size)
 
static int __perf_evsel__hw_cache_name (u64 config, char *bf, size_t size)
 
static int perf_evsel__hw_cache_name (struct perf_evsel *evsel, char *bf, size_t size)
 
static int perf_evsel__raw_name (struct perf_evsel *evsel, char *bf, size_t size)
 
const char * perf_evsel__name (struct perf_evsel *evsel)
 
const char * perf_evsel__group_name (struct perf_evsel *evsel)
 
int perf_evsel__group_desc (struct perf_evsel *evsel, char *buf, size_t size)
 
static void __perf_evsel__config_callchain (struct perf_evsel *evsel, struct record_opts *opts, struct callchain_param *param)
 
void perf_evsel__config_callchain (struct perf_evsel *evsel, struct record_opts *opts, struct callchain_param *param)
 
static void perf_evsel__reset_callgraph (struct perf_evsel *evsel, struct callchain_param *param)
 
static void apply_config_terms (struct perf_evsel *evsel, struct record_opts *opts, bool track)
 
void perf_evsel__config (struct perf_evsel *evsel, struct record_opts *opts, struct callchain_param *callchain)
 
static int perf_evsel__alloc_fd (struct perf_evsel *evsel, int ncpus, int nthreads)
 
static int perf_evsel__run_ioctl (struct perf_evsel *evsel, int ioc, void *arg)
 
int perf_evsel__apply_filter (struct perf_evsel *evsel, const char *filter)
 
int perf_evsel__set_filter (struct perf_evsel *evsel, const char *filter)
 
static int perf_evsel__append_filter (struct perf_evsel *evsel, const char *fmt, const char *filter)
 
int perf_evsel__append_tp_filter (struct perf_evsel *evsel, const char *filter)
 
int perf_evsel__append_addr_filter (struct perf_evsel *evsel, const char *filter)
 
int perf_evsel__enable (struct perf_evsel *evsel)
 
int perf_evsel__disable (struct perf_evsel *evsel)
 
int perf_evsel__alloc_id (struct perf_evsel *evsel, int ncpus, int nthreads)
 
static void perf_evsel__free_fd (struct perf_evsel *evsel)
 
static void perf_evsel__free_id (struct perf_evsel *evsel)
 
static void perf_evsel__free_config_terms (struct perf_evsel *evsel)
 
void perf_evsel__close_fd (struct perf_evsel *evsel)
 
void perf_evsel__exit (struct perf_evsel *evsel)
 
void perf_evsel__delete (struct perf_evsel *evsel)
 
void perf_evsel__compute_deltas (struct perf_evsel *evsel, int cpu, int thread, struct perf_counts_values *count)
 
void perf_counts_values__scale (struct perf_counts_values *count, bool scale, s8 *pscaled)
 
static int perf_evsel__read_size (struct perf_evsel *evsel)
 
int perf_evsel__read (struct perf_evsel *evsel, int cpu, int thread, struct perf_counts_values *count)
 
static int perf_evsel__read_one (struct perf_evsel *evsel, int cpu, int thread)
 
static void perf_evsel__set_count (struct perf_evsel *counter, int cpu, int thread, u64 val, u64 ena, u64 run)
 
static int perf_evsel__process_group_data (struct perf_evsel *leader, int cpu, int thread, u64 *data)
 
static int perf_evsel__read_group (struct perf_evsel *leader, int cpu, int thread)
 
int perf_evsel__read_counter (struct perf_evsel *evsel, int cpu, int thread)
 
int __perf_evsel__read_on_cpu (struct perf_evsel *evsel, int cpu, int thread, bool scale)
 
static int get_group_fd (struct perf_evsel *evsel, int cpu, int thread)
 
static void __p_bits (char *buf, size_t size, u64 value, struct bit_names *bits)
 
static void __p_sample_type (char *buf, size_t size, u64 value)
 
static void __p_branch_sample_type (char *buf, size_t size, u64 value)
 
static void __p_read_format (char *buf, size_t size, u64 value)
 
int perf_event_attr__fprintf (FILE *fp, struct perf_event_attr *attr, attr__fprintf_f attr__fprintf, void *priv)
 
static int __open_attr__fprintf (FILE *fp, const char *name, const char *val, void *priv __maybe_unused)
 
static void perf_evsel__remove_fd (struct perf_evsel *pos, int nr_cpus, int nr_threads, int thread_idx)
 
static int update_fds (struct perf_evsel *evsel, int nr_cpus, int cpu_idx, int nr_threads, int thread_idx)
 
static bool ignore_missing_thread (struct perf_evsel *evsel, int nr_cpus, int cpu, struct thread_map *threads, int thread, int err)
 
int perf_evsel__open (struct perf_evsel *evsel, struct cpu_map *cpus, struct thread_map *threads)
 
void perf_evsel__close (struct perf_evsel *evsel)
 
int perf_evsel__open_per_cpu (struct perf_evsel *evsel, struct cpu_map *cpus)
 
int perf_evsel__open_per_thread (struct perf_evsel *evsel, struct thread_map *threads)
 
static int perf_evsel__parse_id_sample (const struct perf_evsel *evsel, const union perf_event *event, struct perf_sample *sample)
 
static bool overflow (const void *endp, u16 max_size, const void *offset, u64 size)
 
static int perf_event__check_size (union perf_event *event, unsigned int sample_size)
 
int perf_evsel__parse_sample (struct perf_evsel *evsel, union perf_event *event, struct perf_sample *data)
 
int perf_evsel__parse_sample_timestamp (struct perf_evsel *evsel, union perf_event *event, u64 *timestamp)
 
size_t perf_event__sample_event_size (const struct perf_sample *sample, u64 type, u64 read_format)
 
int perf_event__synthesize_sample (union perf_event *event, u64 type, u64 read_format, const struct perf_sample *sample)
 
struct format_field * perf_evsel__field (struct perf_evsel *evsel, const char *name)
 
void * perf_evsel__rawptr (struct perf_evsel *evsel, struct perf_sample *sample, const char *name)
 
u64 format_field__intval (struct format_field *field, struct perf_sample *sample, bool needs_swap)
 
u64 perf_evsel__intval (struct perf_evsel *evsel, struct perf_sample *sample, const char *name)
 
bool perf_evsel__fallback (struct perf_evsel *evsel, int err, char *msg, size_t msgsize)
 
static bool find_process (const char *name)
 
int perf_evsel__open_strerror (struct perf_evsel *evsel, struct target *target, int err, char *msg, size_t size)
 
struct perf_envperf_evsel__env (struct perf_evsel *evsel)
 

Variables

struct perf_missing_features perf_missing_features
 
static clockid_t clockid
 
struct {
   size_t   size
 
   int(*   init )(struct perf_evsel *evsel)
 
   void(*   fini )(struct perf_evsel *evsel)
 
perf_evsel__object
 
const char * perf_evsel__hw_names [PERF_COUNT_HW_MAX]
 
const char * perf_evsel__sw_names [PERF_COUNT_SW_MAX]
 
const char * perf_evsel__hw_cache [PERF_COUNT_HW_CACHE_MAX][PERF_EVSEL__MAX_ALIASES]
 
const char * perf_evsel__hw_cache_op [PERF_COUNT_HW_CACHE_OP_MAX][PERF_EVSEL__MAX_ALIASES]
 
const char * perf_evsel__hw_cache_result [PERF_COUNT_HW_CACHE_RESULT_MAX][PERF_EVSEL__MAX_ALIASES]
 
static unsigned long perf_evsel__hw_cache_stat [C(MAX)]
 

Macro Definition Documentation

◆ bit_name [1/3]

#define bit_name (   n)    { PERF_SAMPLE_##n, #n }

◆ bit_name [2/3]

#define bit_name (   n)    { PERF_SAMPLE_BRANCH_##n, #n }

◆ bit_name [3/3]

#define bit_name (   n)    { PERF_FORMAT_##n, #n }

◆ BUF_SIZE

#define BUF_SIZE   1024

Definition at line 1552 of file evsel.c.

◆ C

#define C (   x)    PERF_COUNT_HW_CACHE_##x

Definition at line 496 of file evsel.c.

◆ CACHE_PREFETCH

#define CACHE_PREFETCH   (1 << C(OP_PREFETCH))

Definition at line 499 of file evsel.c.

◆ CACHE_READ

#define CACHE_READ   (1 << C(OP_READ))

Definition at line 497 of file evsel.c.

◆ CACHE_WRITE

#define CACHE_WRITE   (1 << C(OP_WRITE))

Definition at line 498 of file evsel.c.

◆ COP

#define COP (   x)    (1 << x)

Definition at line 500 of file evsel.c.

◆ FD

#define FD (   e,
  x,
 
)    (*(int *)xyarray__entry(e->fd, x, y))

Definition at line 92 of file evsel.c.

◆ FUNCTION_EVENT

#define FUNCTION_EVENT   "ftrace:function"

◆ MOD_PRINT

#define MOD_PRINT (   context,
  mod 
)
Value:
do { \
if (!attr->exclude_##context) { \
if (!colon) colon = ++r; \
r += scnprintf(bf + r, size - r, "%c", mod); \
} } while(0)
size_t size
Definition: evsel.c:60
Definition: attr.py:1

◆ OVERFLOW_CHECK

#define OVERFLOW_CHECK (   offset,
  size,
  max_size 
)
Value:
do { \
if (overflow(endp, (max_size), (offset), (size))) \
return -EFAULT; \
} while (0)
size_t size
Definition: evsel.c:60
static bool overflow(const void *endp, u16 max_size, const void *offset, u64 size)
Definition: evsel.c:2030
int offset
Definition: beauty.h:10

Definition at line 2036 of file evsel.c.

◆ OVERFLOW_CHECK_u64

#define OVERFLOW_CHECK_u64 (   offset)    OVERFLOW_CHECK(offset, sizeof(u64), sizeof(u64))

Definition at line 2042 of file evsel.c.

◆ p_branch_sample_type

#define p_branch_sample_type (   val)    __p_branch_sample_type(buf, BUF_SIZE, val)

Definition at line 1558 of file evsel.c.

◆ p_hex

#define p_hex (   val)    snprintf(buf, BUF_SIZE, "%#"PRIx64, (uint64_t)(val))

Definition at line 1554 of file evsel.c.

◆ p_read_format

#define p_read_format (   val)    __p_read_format(buf, BUF_SIZE, val)

Definition at line 1559 of file evsel.c.

◆ p_sample_type

#define p_sample_type (   val)    __p_sample_type(buf, BUF_SIZE, val)

Definition at line 1557 of file evsel.c.

◆ p_signed

#define p_signed (   val)    snprintf(buf, BUF_SIZE, "%"PRId64, (int64_t)(val))

Definition at line 1556 of file evsel.c.

◆ p_unsigned

#define p_unsigned (   val)    snprintf(buf, BUF_SIZE, "%"PRIu64, (uint64_t)(val))

Definition at line 1555 of file evsel.c.

◆ PRINT_ATTRf

#define PRINT_ATTRf (   _f,
  _p 
)    PRINT_ATTRn(#_f, _f, _p)

Definition at line 1569 of file evsel.c.

◆ PRINT_ATTRn

#define PRINT_ATTRn (   _n,
  _f,
  _p 
)
Value:
do { \
if (attr->_f) { \
_p(attr->_f); \
ret += attr__fprintf(fp, _n, buf, priv);\
} \
} while (0)
Definition: attr.py:1

Definition at line 1561 of file evsel.c.

Function Documentation

◆ __open_attr__fprintf()

static int __open_attr__fprintf ( FILE *  fp,
const char *  name,
const char *  val,
void *priv  __maybe_unused 
)
static

Definition at line 1628 of file evsel.c.

◆ __p_bits()

static void __p_bits ( char *  buf,
size_t  size,
u64  value,
struct bit_names bits 
)
static

Definition at line 1496 of file evsel.c.

◆ __p_branch_sample_type()

static void __p_branch_sample_type ( char *  buf,
size_t  size,
u64  value 
)
static

Definition at line 1525 of file evsel.c.

Here is the call graph for this function:

◆ __p_read_format()

static void __p_read_format ( char *  buf,
size_t  size,
u64  value 
)
static

Definition at line 1540 of file evsel.c.

Here is the call graph for this function:

◆ __p_sample_type()

static void __p_sample_type ( char *  buf,
size_t  size,
u64  value 
)
static

Definition at line 1509 of file evsel.c.

Here is the call graph for this function:

◆ __perf_evsel__bp_name()

static int __perf_evsel__bp_name ( char *  bf,
size_t  size,
u64  addr,
u64  type 
)
static

Definition at line 447 of file evsel.c.

◆ __perf_evsel__calc_id_pos()

static int __perf_evsel__calc_id_pos ( u64  sample_type)
static

__perf_evsel__calc_id_pos - calculate id_pos. : sample type

This function returns the position of the event id (PERF_SAMPLE_ID or PERF_SAMPLE_IDENTIFIER) in a sample event i.e. in the array of struct sample_event.

Definition at line 118 of file evsel.c.

◆ __perf_evsel__calc_is_pos()

static int __perf_evsel__calc_is_pos ( u64  sample_type)
static

__perf_evsel__calc_is_pos - calculate is_pos. : sample type

This function returns the position (counting backwards) of the event id (PERF_SAMPLE_ID or PERF_SAMPLE_IDENTIFIER) in a non-sample event i.e. if sample_id_all is used there is an id sample appended to non-sample events.

Definition at line 151 of file evsel.c.

◆ __perf_evsel__config_callchain()

static void __perf_evsel__config_callchain ( struct perf_evsel evsel,
struct record_opts opts,
struct callchain_param param 
)
static

Definition at line 657 of file evsel.c.

Here is the call graph for this function:

◆ __perf_evsel__hw_cache_name()

static int __perf_evsel__hw_cache_name ( u64  config,
char *  bf,
size_t  size 
)
static

Definition at line 538 of file evsel.c.

Here is the call graph for this function:

◆ __perf_evsel__hw_cache_type_op_res_name()

int __perf_evsel__hw_cache_type_op_res_name ( u8  type,
u8  op,
u8  result,
char *  bf,
size_t  size 
)

Definition at line 525 of file evsel.c.

◆ __perf_evsel__hw_name()

static const char* __perf_evsel__hw_name ( u64  config)
static

Definition at line 371 of file evsel.c.

◆ __perf_evsel__read_on_cpu()

int __perf_evsel__read_on_cpu ( struct perf_evsel evsel,
int  cpu,
int  thread,
bool  scale 
)

Definition at line 1450 of file evsel.c.

Here is the call graph for this function:

◆ __perf_evsel__reset_sample_bit()

void __perf_evsel__reset_sample_bit ( struct perf_evsel evsel,
enum perf_event_sample_format  bit 
)

Definition at line 186 of file evsel.c.

Here is the call graph for this function:

◆ __perf_evsel__sample_size()

int __perf_evsel__sample_size ( u64  sample_type)

Definition at line 94 of file evsel.c.

◆ __perf_evsel__set_sample_bit()

void __perf_evsel__set_sample_bit ( struct perf_evsel evsel,
enum perf_event_sample_format  bit 
)

Definition at line 176 of file evsel.c.

Here is the call graph for this function:

◆ __perf_evsel__sw_name()

static const char* __perf_evsel__sw_name ( u64  config)
static

Definition at line 434 of file evsel.c.

◆ apply_config_terms()

static void apply_config_terms ( struct perf_evsel evsel,
struct record_opts opts,
bool  track 
)
static

Definition at line 731 of file evsel.c.

Here is the call graph for this function:

◆ find_process()

static bool find_process ( const char *  name)
static

Definition at line 2784 of file evsel.c.

Here is the call graph for this function:

◆ format_field__intval()

u64 format_field__intval ( struct format_field *  field,
struct perf_sample sample,
bool  needs_swap 
)

Definition at line 2683 of file evsel.c.

Here is the call graph for this function:

◆ get_group_fd()

static int get_group_fd ( struct perf_evsel evsel,
int  cpu,
int  thread 
)
static

Definition at line 1471 of file evsel.c.

Here is the call graph for this function:

◆ ignore_missing_thread()

static bool ignore_missing_thread ( struct perf_evsel evsel,
int  nr_cpus,
int  cpu,
struct thread_map threads,
int  thread,
int  err 
)
static

Definition at line 1667 of file evsel.c.

Here is the call graph for this function:

◆ overflow()

static bool overflow ( const void *  endp,
u16  max_size,
const void *  offset,
u64  size 
)
inlinestatic

Definition at line 2030 of file evsel.c.

◆ perf_counts_values__scale()

void perf_counts_values__scale ( struct perf_counts_values count,
bool  scale,
s8 *  pscaled 
)

Definition at line 1288 of file evsel.c.

◆ perf_event__check_size()

static int perf_event__check_size ( union perf_event event,
unsigned int  sample_size 
)
static

Definition at line 2046 of file evsel.c.

◆ perf_event__sample_event_size()

size_t perf_event__sample_event_size ( const struct perf_sample sample,
u64  type,
u64  read_format 
)

Definition at line 2382 of file evsel.c.

◆ perf_event__synthesize_sample()

int perf_event__synthesize_sample ( union perf_event event,
u64  type,
u64  read_format,
const struct perf_sample sample 
)

Definition at line 2490 of file evsel.c.

Here is the call graph for this function:

◆ perf_event_attr__fprintf()

int perf_event_attr__fprintf ( FILE *  fp,
struct perf_event_attr *  attr,
attr__fprintf_f  attr__fprintf,
void *  priv 
)

Definition at line 1571 of file evsel.c.

◆ perf_event_can_profile_kernel()

static bool perf_event_can_profile_kernel ( void  )
static

Definition at line 266 of file evsel.c.

Here is the call graph for this function:

◆ perf_evsel__add_modifiers()

static int perf_evsel__add_modifiers ( struct perf_evsel evsel,
char *  bf,
size_t  size 
)
static

Definition at line 379 of file evsel.c.

◆ perf_evsel__alloc_fd()

static int perf_evsel__alloc_fd ( struct perf_evsel evsel,
int  ncpus,
int  nthreads 
)
static

Definition at line 1091 of file evsel.c.

Here is the call graph for this function:

◆ perf_evsel__alloc_id()

int perf_evsel__alloc_id ( struct perf_evsel evsel,
int  ncpus,
int  nthreads 
)

Definition at line 1189 of file evsel.c.

Here is the call graph for this function:

◆ perf_evsel__append_addr_filter()

int perf_evsel__append_addr_filter ( struct perf_evsel evsel,
const char *  filter 
)

Definition at line 1170 of file evsel.c.

Here is the call graph for this function:

◆ perf_evsel__append_filter()

static int perf_evsel__append_filter ( struct perf_evsel evsel,
const char *  fmt,
const char *  filter 
)
static

Definition at line 1148 of file evsel.c.

Here is the call graph for this function:

◆ perf_evsel__append_tp_filter()

int perf_evsel__append_tp_filter ( struct perf_evsel evsel,
const char *  filter 
)

Definition at line 1165 of file evsel.c.

Here is the call graph for this function:

◆ perf_evsel__apply_filter()

int perf_evsel__apply_filter ( struct perf_evsel evsel,
const char *  filter 
)

Definition at line 1128 of file evsel.c.

Here is the call graph for this function:

◆ perf_evsel__bp_name()

static int perf_evsel__bp_name ( struct perf_evsel evsel,
char *  bf,
size_t  size 
)
static

Definition at line 465 of file evsel.c.

Here is the call graph for this function:

◆ perf_evsel__calc_id_pos()

void perf_evsel__calc_id_pos ( struct perf_evsel evsel)

Definition at line 170 of file evsel.c.

Here is the call graph for this function:

◆ perf_evsel__close()

void perf_evsel__close ( struct perf_evsel evsel)

Definition at line 1948 of file evsel.c.

Here is the call graph for this function:

◆ perf_evsel__close_fd()

void perf_evsel__close_fd ( struct perf_evsel evsel)

Definition at line 1234 of file evsel.c.

Here is the call graph for this function:

◆ perf_evsel__compute_deltas()

void perf_evsel__compute_deltas ( struct perf_evsel evsel,
int  cpu,
int  thread,
struct perf_counts_values count 
)

Definition at line 1267 of file evsel.c.

Here is the call graph for this function:

◆ perf_evsel__config()

void perf_evsel__config ( struct perf_evsel evsel,
struct record_opts opts,
struct callchain_param callchain 
)

Definition at line 879 of file evsel.c.

Here is the call graph for this function:

◆ perf_evsel__config_callchain()

void perf_evsel__config_callchain ( struct perf_evsel evsel,
struct record_opts opts,
struct callchain_param param 
)

Definition at line 705 of file evsel.c.

Here is the call graph for this function:

◆ perf_evsel__delete()

void perf_evsel__delete ( struct perf_evsel evsel)

Definition at line 1261 of file evsel.c.

Here is the call graph for this function:

◆ perf_evsel__disable()

int perf_evsel__disable ( struct perf_evsel evsel)

Definition at line 1182 of file evsel.c.

Here is the call graph for this function:

◆ perf_evsel__enable()

int perf_evsel__enable ( struct perf_evsel evsel)

Definition at line 1175 of file evsel.c.

Here is the call graph for this function:

◆ perf_evsel__env()

struct perf_env* perf_evsel__env ( struct perf_evsel evsel)

Definition at line 2911 of file evsel.c.

◆ perf_evsel__exit()

void perf_evsel__exit ( struct perf_evsel evsel)

Definition at line 1245 of file evsel.c.

Here is the call graph for this function:

◆ perf_evsel__fallback()

bool perf_evsel__fallback ( struct perf_evsel evsel,
int  err,
char *  msg,
size_t  msgsize 
)

Definition at line 2733 of file evsel.c.

Here is the call graph for this function:

◆ perf_evsel__field()

struct format_field* perf_evsel__field ( struct perf_evsel evsel,
const char *  name 
)

Definition at line 2659 of file evsel.c.

◆ perf_evsel__free_config_terms()

static void perf_evsel__free_config_terms ( struct perf_evsel evsel)
static

Definition at line 1224 of file evsel.c.

Here is the call graph for this function:

◆ perf_evsel__free_fd()

static void perf_evsel__free_fd ( struct perf_evsel evsel)
static

Definition at line 1211 of file evsel.c.

Here is the call graph for this function:

◆ perf_evsel__free_id()

static void perf_evsel__free_id ( struct perf_evsel evsel)
static

Definition at line 1217 of file evsel.c.

Here is the call graph for this function:

◆ perf_evsel__group_desc()

int perf_evsel__group_desc ( struct perf_evsel evsel,
char *  buf,
size_t  size 
)

Definition at line 635 of file evsel.c.

Here is the call graph for this function:

◆ perf_evsel__group_name()

const char* perf_evsel__group_name ( struct perf_evsel evsel)

Definition at line 620 of file evsel.c.

◆ perf_evsel__hw_cache_name()

static int perf_evsel__hw_cache_name ( struct perf_evsel evsel,
char *  bf,
size_t  size 
)
static

Definition at line 565 of file evsel.c.

Here is the call graph for this function:

◆ perf_evsel__hw_name()

static int perf_evsel__hw_name ( struct perf_evsel evsel,
char *  bf,
size_t  size 
)
static

Definition at line 415 of file evsel.c.

Here is the call graph for this function:

◆ perf_evsel__init()

void perf_evsel__init ( struct perf_evsel evsel,
struct perf_event_attr *  attr,
int  idx 
)

Definition at line 226 of file evsel.c.

Here is the call graph for this function:

◆ perf_evsel__intval()

u64 perf_evsel__intval ( struct perf_evsel evsel,
struct perf_sample sample,
const char *  name 
)

Definition at line 2722 of file evsel.c.

Here is the call graph for this function:

◆ perf_evsel__is_cache_op_valid()

bool perf_evsel__is_cache_op_valid ( u8  type,
u8  op 
)

Definition at line 517 of file evsel.c.

◆ perf_evsel__is_function_event()

bool perf_evsel__is_function_event ( struct perf_evsel evsel)

perf_evsel__is_function_event - Return whether given evsel is a function trace event

- evsel selector to be tested

Return true if event is function trace event

Definition at line 216 of file evsel.c.

◆ perf_evsel__name()

const char* perf_evsel__name ( struct perf_evsel evsel)

Definition at line 577 of file evsel.c.

Here is the call graph for this function:

◆ perf_evsel__new_cycles()

struct perf_evsel* perf_evsel__new_cycles ( bool  precise)

Definition at line 271 of file evsel.c.

Here is the call graph for this function:

◆ perf_evsel__new_idx()

struct perf_evsel* perf_evsel__new_idx ( struct perf_event_attr *  attr,
int  idx 
)

Definition at line 250 of file evsel.c.

Here is the call graph for this function:

◆ perf_evsel__newtp_idx()

struct perf_evsel* perf_evsel__newtp_idx ( const char *  sys,
const char *  name,
int  idx 
)

Definition at line 320 of file evsel.c.

Here is the call graph for this function:

◆ perf_evsel__no_extra_fini()

static void perf_evsel__no_extra_fini ( struct perf_evsel *evsel  __maybe_unused)
static

Definition at line 55 of file evsel.c.

◆ perf_evsel__no_extra_init()

static int perf_evsel__no_extra_init ( struct perf_evsel *evsel  __maybe_unused)
static

Definition at line 48 of file evsel.c.

◆ perf_evsel__object_config()

int perf_evsel__object_config ( size_t  object_size,
int(*)(struct perf_evsel *evsel)  init,
void(*)(struct perf_evsel *evsel)  fini 
)

Definition at line 69 of file evsel.c.

◆ perf_evsel__open()

int perf_evsel__open ( struct perf_evsel evsel,
struct cpu_map cpus,
struct thread_map threads 
)

Definition at line 1704 of file evsel.c.

Here is the call graph for this function:

◆ perf_evsel__open_per_cpu()

int perf_evsel__open_per_cpu ( struct perf_evsel evsel,
struct cpu_map cpus 
)

Definition at line 1957 of file evsel.c.

Here is the call graph for this function:

◆ perf_evsel__open_per_thread()

int perf_evsel__open_per_thread ( struct perf_evsel evsel,
struct thread_map threads 
)

Definition at line 1963 of file evsel.c.

Here is the call graph for this function:

◆ perf_evsel__open_strerror()

int perf_evsel__open_strerror ( struct perf_evsel evsel,
struct target target,
int  err,
char *  msg,
size_t  size 
)

Definition at line 2820 of file evsel.c.

Here is the call graph for this function:

◆ perf_evsel__parse_id_sample()

static int perf_evsel__parse_id_sample ( const struct perf_evsel evsel,
const union perf_event event,
struct perf_sample sample 
)
static

Definition at line 1969 of file evsel.c.

◆ perf_evsel__parse_sample()

int perf_evsel__parse_sample ( struct perf_evsel evsel,
union perf_event event,
struct perf_sample data 
)

Definition at line 2059 of file evsel.c.

Here is the call graph for this function:

◆ perf_evsel__parse_sample_timestamp()

int perf_evsel__parse_sample_timestamp ( struct perf_evsel evsel,
union perf_event event,
u64 *  timestamp 
)

Definition at line 2338 of file evsel.c.

Here is the call graph for this function:

◆ perf_evsel__process_group_data()

static int perf_evsel__process_group_data ( struct perf_evsel leader,
int  cpu,
int  thread,
u64 *  data 
)
static

Definition at line 1372 of file evsel.c.

Here is the call graph for this function:

◆ perf_evsel__raw_name()

static int perf_evsel__raw_name ( struct perf_evsel evsel,
char *  bf,
size_t  size 
)
static

Definition at line 571 of file evsel.c.

Here is the call graph for this function:

◆ perf_evsel__rawptr()

void* perf_evsel__rawptr ( struct perf_evsel evsel,
struct perf_sample sample,
const char *  name 
)

Definition at line 2664 of file evsel.c.

Here is the call graph for this function:

◆ perf_evsel__read()

int perf_evsel__read ( struct perf_evsel evsel,
int  cpu,
int  thread,
struct perf_counts_values count 
)

Definition at line 1333 of file evsel.c.

Here is the call graph for this function:

◆ perf_evsel__read_counter()

int perf_evsel__read_counter ( struct perf_evsel evsel,
int  cpu,
int  thread 
)

Definition at line 1440 of file evsel.c.

Here is the call graph for this function:

◆ perf_evsel__read_group()

static int perf_evsel__read_group ( struct perf_evsel leader,
int  cpu,
int  thread 
)
static

Definition at line 1410 of file evsel.c.

Here is the call graph for this function:

◆ perf_evsel__read_one()

static int perf_evsel__read_one ( struct perf_evsel evsel,
int  cpu,
int  thread 
)
static

Definition at line 1350 of file evsel.c.

Here is the call graph for this function:

◆ perf_evsel__read_size()

static int perf_evsel__read_size ( struct perf_evsel evsel)
static

Definition at line 1308 of file evsel.c.

Here is the call graph for this function:

◆ perf_evsel__remove_fd()

static void perf_evsel__remove_fd ( struct perf_evsel pos,
int  nr_cpus,
int  nr_threads,
int  thread_idx 
)
static

Definition at line 1634 of file evsel.c.

◆ perf_evsel__reset_callgraph()

static void perf_evsel__reset_callgraph ( struct perf_evsel evsel,
struct callchain_param param 
)
static

Definition at line 714 of file evsel.c.

◆ perf_evsel__run_ioctl()

static int perf_evsel__run_ioctl ( struct perf_evsel evsel,
int  ioc,
void *  arg 
)
static

Definition at line 1110 of file evsel.c.

Here is the call graph for this function:

◆ perf_evsel__set_count()

static void perf_evsel__set_count ( struct perf_evsel counter,
int  cpu,
int  thread,
u64  val,
u64  ena,
u64  run 
)
static

Definition at line 1358 of file evsel.c.

Here is the call graph for this function:

◆ perf_evsel__set_filter()

int perf_evsel__set_filter ( struct perf_evsel evsel,
const char *  filter 
)

Definition at line 1135 of file evsel.c.

Here is the call graph for this function:

◆ perf_evsel__set_sample_id()

void perf_evsel__set_sample_id ( struct perf_evsel evsel,
bool  can_sample_identifier 
)

Definition at line 196 of file evsel.c.

◆ perf_evsel__sw_name()

static int perf_evsel__sw_name ( struct perf_evsel evsel,
char *  bf,
size_t  size 
)
static

Definition at line 441 of file evsel.c.

Here is the call graph for this function:

◆ test_attr__ready()

void __weak test_attr__ready ( void  )

Definition at line 53 of file evsel.c.

◆ update_fds()

static int update_fds ( struct perf_evsel evsel,
int  nr_cpus,
int  cpu_idx,
int  nr_threads,
int  thread_idx 
)
static

Definition at line 1643 of file evsel.c.

Here is the call graph for this function:

Variable Documentation

◆ clockid

clockid_t clockid
static

Definition at line 46 of file evsel.c.

◆ fini

void(* fini) (struct perf_evsel *evsel)

Definition at line 62 of file evsel.c.

◆ init

int(* init) (struct perf_evsel *evsel)

Definition at line 61 of file evsel.c.

◆ perf_evsel__hw_cache

const char* perf_evsel__hw_cache[PERF_COUNT_HW_CACHE_MAX][PERF_EVSEL__MAX_ALIASES]
Initial value:
= {
{ "L1-dcache", "l1-d", "l1d", "L1-data", },
{ "L1-icache", "l1-i", "l1i", "L1-instruction", },
{ "LLC", "L2", },
{ "dTLB", "d-tlb", "Data-TLB", },
{ "iTLB", "i-tlb", "Instruction-TLB", },
{ "branch", "branches", "bpu", "btb", "bpc", },
{ "node", },
}

Definition at line 473 of file evsel.c.

◆ perf_evsel__hw_cache_op

const char* perf_evsel__hw_cache_op[PERF_COUNT_HW_CACHE_OP_MAX][PERF_EVSEL__MAX_ALIASES]
Initial value:
= {
{ "load", "loads", "read", },
{ "store", "stores", "write", },
{ "prefetch", "prefetches", "speculative-read", "speculative-load", },
}

Definition at line 484 of file evsel.c.

◆ perf_evsel__hw_cache_result

const char* perf_evsel__hw_cache_result[PERF_COUNT_HW_CACHE_RESULT_MAX][PERF_EVSEL__MAX_ALIASES]
Initial value:
= {
{ "refs", "Reference", "ops", "access", },
{ "misses", "miss", },
}

Definition at line 491 of file evsel.c.

◆ perf_evsel__hw_cache_stat

unsigned long perf_evsel__hw_cache_stat[C(MAX)]
static
Initial value:
= {
[C(L1I)] = (CACHE_READ | CACHE_PREFETCH),
[C(ITLB)] = (CACHE_READ),
[C(BPU)] = (CACHE_READ),
}
#define CACHE_READ
Definition: evsel.c:497
#define C(x)
Definition: evsel.c:496
#define CACHE_PREFETCH
Definition: evsel.c:499
#define CACHE_WRITE
Definition: evsel.c:498

Definition at line 507 of file evsel.c.

◆ perf_evsel__hw_names

const char* perf_evsel__hw_names[PERF_COUNT_HW_MAX]
Initial value:
= {
"cycles",
"instructions",
"cache-references",
"cache-misses",
"branches",
"branch-misses",
"bus-cycles",
"stalled-cycles-frontend",
"stalled-cycles-backend",
"ref-cycles",
}

Definition at line 358 of file evsel.c.

◆ perf_evsel__object

struct { ... } perf_evsel__object
Initial value:
= {
.size = sizeof(struct perf_evsel),
}
static int perf_evsel__no_extra_init(struct perf_evsel *evsel __maybe_unused)
Definition: evsel.c:48
static void perf_evsel__no_extra_fini(struct perf_evsel *evsel __maybe_unused)
Definition: evsel.c:55
int(* init)(struct perf_evsel *evsel)
Definition: evsel.c:61

◆ perf_evsel__sw_names

const char* perf_evsel__sw_names[PERF_COUNT_SW_MAX]
Initial value:
= {
"cpu-clock",
"task-clock",
"page-faults",
"context-switches",
"cpu-migrations",
"minor-faults",
"major-faults",
"alignment-faults",
"emulation-faults",
"dummy",
}

Definition at line 421 of file evsel.c.

◆ perf_missing_features

Definition at line 44 of file evsel.c.

◆ size

size_t size

Definition at line 60 of file evsel.c.