Linux Perf
parse-events.h File Reference
#include <linux/list.h>
#include <stdbool.h>
#include <linux/types.h>
#include <linux/perf_event.h>
#include <string.h>
Include dependency graph for parse-events.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  tracepoint_path
 
struct  perf_pmu_event_symbol
 
struct  parse_events_array
 
struct  parse_events_term
 
struct  parse_events_error
 
struct  parse_events_state
 
struct  event_symbol
 

Macros

#define EVENTS_HELP_MAX   (128*1024)
 

Enumerations

enum  perf_pmu_event_symbol_type { PMU_EVENT_SYMBOL_ERR, PMU_EVENT_SYMBOL, PMU_EVENT_SYMBOL_PREFIX, PMU_EVENT_SYMBOL_SUFFIX }
 
enum  { PARSE_EVENTS__TERM_TYPE_NUM, PARSE_EVENTS__TERM_TYPE_STR }
 
enum  {
  PARSE_EVENTS__TERM_TYPE_USER, PARSE_EVENTS__TERM_TYPE_CONFIG, PARSE_EVENTS__TERM_TYPE_CONFIG1, PARSE_EVENTS__TERM_TYPE_CONFIG2,
  PARSE_EVENTS__TERM_TYPE_NAME, PARSE_EVENTS__TERM_TYPE_SAMPLE_PERIOD, PARSE_EVENTS__TERM_TYPE_SAMPLE_FREQ, PARSE_EVENTS__TERM_TYPE_BRANCH_SAMPLE_TYPE,
  PARSE_EVENTS__TERM_TYPE_TIME, PARSE_EVENTS__TERM_TYPE_CALLGRAPH, PARSE_EVENTS__TERM_TYPE_STACKSIZE, PARSE_EVENTS__TERM_TYPE_NOINHERIT,
  PARSE_EVENTS__TERM_TYPE_INHERIT, PARSE_EVENTS__TERM_TYPE_MAX_STACK, PARSE_EVENTS__TERM_TYPE_NOOVERWRITE, PARSE_EVENTS__TERM_TYPE_OVERWRITE,
  PARSE_EVENTS__TERM_TYPE_DRV_CFG, __PARSE_EVENTS__TERM_TYPE_NR
}
 

Functions

struct tracepoint_pathtracepoint_id_to_path (u64 config)
 
struct tracepoint_pathtracepoint_name_to_path (const char *name)
 
bool have_tracepoints (struct list_head *evlist)
 
const char * event_type (int type)
 
int parse_events_option (const struct option *opt, const char *str, int unset)
 
int parse_events (struct perf_evlist *evlist, const char *str, struct parse_events_error *error)
 
int parse_events_terms (struct list_head *terms, const char *str)
 
int parse_filter (const struct option *opt, const char *str, int unset)
 
int exclude_perf (const struct option *opt, const char *arg, int unset)
 
void parse_events__shrink_config_terms (void)
 
int parse_events__is_hardcoded_term (struct parse_events_term *term)
 
int parse_events_term__num (struct parse_events_term **term, int type_term, char *config, u64 num, bool novalue, void *loc_term, void *loc_val)
 
int parse_events_term__str (struct parse_events_term **term, int type_term, char *config, char *str, void *loc_term, void *loc_val)
 
int parse_events_term__sym_hw (struct parse_events_term **term, char *config, unsigned idx)
 
int parse_events_term__clone (struct parse_events_term **new, struct parse_events_term *term)
 
void parse_events_terms__delete (struct list_head *terms)
 
void parse_events_terms__purge (struct list_head *terms)
 
void parse_events__clear_array (struct parse_events_array *a)
 
int parse_events__modifier_event (struct list_head *list, char *str, bool add)
 
int parse_events__modifier_group (struct list_head *list, char *event_mod)
 
int parse_events_name (struct list_head *list, char *name)
 
int parse_events_add_tracepoint (struct list_head *list, int *idx, const char *sys, const char *event, struct parse_events_error *error, struct list_head *head_config)
 
int parse_events_load_bpf (struct parse_events_state *parse_state, struct list_head *list, char *bpf_file_name, bool source, struct list_head *head_config)
 
int parse_events_load_bpf_obj (struct parse_events_state *parse_state, struct list_head *list, struct bpf_object *obj, struct list_head *head_config)
 
int parse_events_add_numeric (struct parse_events_state *parse_state, struct list_head *list, u32 type, u64 config, struct list_head *head_config)
 
int parse_events_add_cache (struct list_head *list, int *idx, char *type, char *op_result1, char *op_result2, struct parse_events_error *error, struct list_head *head_config)
 
int parse_events_add_breakpoint (struct list_head *list, int *idx, void *ptr, char *type, u64 len)
 
int parse_events_add_pmu (struct parse_events_state *parse_state, struct list_head *list, char *name, struct list_head *head_config, bool auto_merge_stats, bool use_alias)
 
int parse_events_multi_pmu_add (struct parse_events_state *parse_state, char *str, struct list_head **listp)
 
int parse_events_copy_term_list (struct list_head *old, struct list_head **new)
 
enum perf_pmu_event_symbol_type perf_pmu__parse_check (const char *name)
 
void parse_events__set_leader (char *name, struct list_head *list, struct parse_events_state *parse_state)
 
void parse_events_update_lists (struct list_head *list_event, struct list_head *list_all)
 
void parse_events_evlist_error (struct parse_events_state *parse_state, int idx, const char *str)
 
void print_events (const char *event_glob, bool name_only, bool quiet, bool long_desc, bool details_flag)
 
void print_symbol_events (const char *event_glob, unsigned type, struct event_symbol *syms, unsigned max, bool name_only)
 
void print_tracepoint_events (const char *subsys_glob, const char *event_glob, bool name_only)
 
int print_hwcache_events (const char *event_glob, bool name_only)
 
void print_sdt_events (const char *subsys_glob, const char *event_glob, bool name_only)
 
int is_valid_tracepoint (const char *event_string)
 
int valid_event_mount (const char *eventfs)
 
char * parse_events_formats_error_string (char *additional_terms)
 
void parse_events_print_error (struct parse_events_error *err, const char *event)
 
static bool is_sdt_event (char *str __maybe_unused)
 

Variables

struct event_symbol event_symbols_hw []
 
struct event_symbol event_symbols_sw []
 

Macro Definition Documentation

◆ EVENTS_HELP_MAX

#define EVENTS_HELP_MAX   (128*1024)

Definition at line 40 of file parse-events.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
PARSE_EVENTS__TERM_TYPE_NUM 
PARSE_EVENTS__TERM_TYPE_STR 

Definition at line 54 of file parse-events.h.

◆ anonymous enum

anonymous enum
Enumerator
PARSE_EVENTS__TERM_TYPE_USER 
PARSE_EVENTS__TERM_TYPE_CONFIG 
PARSE_EVENTS__TERM_TYPE_CONFIG1 
PARSE_EVENTS__TERM_TYPE_CONFIG2 
PARSE_EVENTS__TERM_TYPE_NAME 
PARSE_EVENTS__TERM_TYPE_SAMPLE_PERIOD 
PARSE_EVENTS__TERM_TYPE_SAMPLE_FREQ 
PARSE_EVENTS__TERM_TYPE_BRANCH_SAMPLE_TYPE 
PARSE_EVENTS__TERM_TYPE_TIME 
PARSE_EVENTS__TERM_TYPE_CALLGRAPH 
PARSE_EVENTS__TERM_TYPE_STACKSIZE 
PARSE_EVENTS__TERM_TYPE_NOINHERIT 
PARSE_EVENTS__TERM_TYPE_INHERIT 
PARSE_EVENTS__TERM_TYPE_MAX_STACK 
PARSE_EVENTS__TERM_TYPE_NOOVERWRITE 
PARSE_EVENTS__TERM_TYPE_OVERWRITE 
PARSE_EVENTS__TERM_TYPE_DRV_CFG 
__PARSE_EVENTS__TERM_TYPE_NR 

Definition at line 59 of file parse-events.h.

◆ perf_pmu_event_symbol_type

Enumerator
PMU_EVENT_SYMBOL_ERR 
PMU_EVENT_SYMBOL 
PMU_EVENT_SYMBOL_PREFIX 
PMU_EVENT_SYMBOL_SUFFIX 

Definition at line 42 of file parse-events.h.

Function Documentation

◆ event_type()

const char* event_type ( int  type)

Definition at line 275 of file parse-events.c.

◆ exclude_perf()

int exclude_perf ( const struct option *  opt,
const char *  arg,
int  unset 
)

◆ have_tracepoints()

bool have_tracepoints ( struct list_head *  evlist)

Definition at line 457 of file trace-event-info.c.

◆ is_sdt_event()

static bool is_sdt_event ( char *str  __maybe_unused)
inlinestatic

Definition at line 228 of file parse-events.h.

◆ is_valid_tracepoint()

int is_valid_tracepoint ( const char *  event_string)

Definition at line 2196 of file parse-events.c.

◆ parse_events()

int parse_events ( struct perf_evlist evlist,
const char *  str,
struct parse_events_error error 
)

Definition at line 1833 of file parse-events.c.

Here is the call graph for this function:

◆ parse_events__clear_array()

void parse_events__clear_array ( struct parse_events_array a)

Definition at line 2686 of file parse-events.c.

◆ parse_events__is_hardcoded_term()

int parse_events__is_hardcoded_term ( struct parse_events_term term)

Definition at line 2538 of file parse-events.c.

◆ parse_events__modifier_event()

int parse_events__modifier_event ( struct list_head *  list,
char *  str,
bool  add 
)

Definition at line 1628 of file parse-events.c.

Here is the call graph for this function:

◆ parse_events__modifier_group()

int parse_events__modifier_group ( struct list_head *  list,
char *  event_mod 
)

Definition at line 1352 of file parse-events.c.

Here is the call graph for this function:

◆ parse_events__set_leader()

void parse_events__set_leader ( char *  name,
struct list_head *  list,
struct parse_events_state parse_state 
)

Definition at line 1470 of file parse-events.c.

Here is the call graph for this function:

◆ parse_events__shrink_config_terms()

void parse_events__shrink_config_terms ( void  )

Definition at line 965 of file parse-events.c.

◆ parse_events_add_breakpoint()

int parse_events_add_breakpoint ( struct list_head *  list,
int *  idx,
void *  ptr,
char *  type,
u64  len 
)

Definition at line 867 of file parse-events.c.

Here is the call graph for this function:

◆ parse_events_add_cache()

int parse_events_add_cache ( struct list_head *  list,
int *  idx,
char *  type,
char *  op_result1,
char *  op_result2,
struct parse_events_error error,
struct list_head *  head_config 
)

Definition at line 383 of file parse-events.c.

Here is the call graph for this function:

◆ parse_events_add_numeric()

int parse_events_add_numeric ( struct parse_events_state parse_state,
struct list_head *  list,
u32  type,
u64  config,
struct list_head *  head_config 
)

Definition at line 1203 of file parse-events.c.

Here is the call graph for this function:

◆ parse_events_add_pmu()

int parse_events_add_pmu ( struct parse_events_state parse_state,
struct list_head *  list,
char *  name,
struct list_head *  head_config,
bool  auto_merge_stats,
bool  use_alias 
)

Definition at line 1228 of file parse-events.c.

Here is the call graph for this function:

◆ parse_events_add_tracepoint()

int parse_events_add_tracepoint ( struct list_head *  list,
int *  idx,
const char *  sys,
const char *  event,
struct parse_events_error error,
struct list_head *  head_config 
)

Definition at line 1182 of file parse-events.c.

Here is the call graph for this function:

◆ parse_events_copy_term_list()

int parse_events_copy_term_list ( struct list_head *  old,
struct list_head **  new 
)

Definition at line 2641 of file parse-events.c.

Here is the call graph for this function:

◆ parse_events_evlist_error()

void parse_events_evlist_error ( struct parse_events_state parse_state,
int  idx,
const char *  str 
)

Definition at line 2691 of file parse-events.c.

◆ parse_events_formats_error_string()

char* parse_events_formats_error_string ( char *  additional_terms)

Definition at line 2734 of file parse-events.c.

Here is the call graph for this function:

◆ parse_events_load_bpf()

int parse_events_load_bpf ( struct parse_events_state parse_state,
struct list_head *  list,
char *  bpf_file_name,
bool  source,
struct list_head *  head_config 
)

Definition at line 780 of file parse-events.c.

Here is the call graph for this function:

◆ parse_events_load_bpf_obj()

int parse_events_load_bpf_obj ( struct parse_events_state parse_state,
struct list_head *  list,
struct bpf_object *  obj,
struct list_head *  head_config 
)

Definition at line 650 of file parse-events.c.

Here is the call graph for this function:

◆ parse_events_multi_pmu_add()

int parse_events_multi_pmu_add ( struct parse_events_state parse_state,
char *  str,
struct list_head **  listp 
)

Definition at line 1305 of file parse-events.c.

Here is the call graph for this function:

◆ parse_events_name()

int parse_events_name ( struct list_head *  list,
char *  name 
)

Definition at line 1665 of file parse-events.c.

◆ parse_events_option()

int parse_events_option ( const struct option *  opt,
const char *  str,
int  unset 
)

Definition at line 1939 of file parse-events.c.

◆ parse_events_print_error()

void parse_events_print_error ( struct parse_events_error err,
const char *  event 
)

Definition at line 1879 of file parse-events.c.

Here is the call graph for this function:

◆ parse_events_term__clone()

int parse_events_term__clone ( struct parse_events_term **  new,
struct parse_events_term term 
)

Definition at line 2627 of file parse-events.c.

Here is the call graph for this function:

◆ parse_events_term__num()

int parse_events_term__num ( struct parse_events_term **  term,
int  type_term,
char *  config,
u64  num,
bool  novalue,
void *  loc_term,
void *  loc_val 
)

Definition at line 2573 of file parse-events.c.

Here is the call graph for this function:

◆ parse_events_term__str()

int parse_events_term__str ( struct parse_events_term **  term,
int  type_term,
char *  config,
char *  str,
void *  loc_term,
void *  loc_val 
)

Definition at line 2593 of file parse-events.c.

Here is the call graph for this function:

◆ parse_events_term__sym_hw()

int parse_events_term__sym_hw ( struct parse_events_term **  term,
char *  config,
unsigned  idx 
)

Definition at line 2611 of file parse-events.c.

Here is the call graph for this function:

◆ parse_events_terms()

int parse_events_terms ( struct list_head *  terms,
const char *  str 
)

Definition at line 1815 of file parse-events.c.

Here is the call graph for this function:

◆ parse_events_terms__delete()

void parse_events_terms__delete ( struct list_head *  terms)

Definition at line 2678 of file parse-events.c.

Here is the call graph for this function:

◆ parse_events_terms__purge()

void parse_events_terms__purge ( struct list_head *  terms)

Definition at line 2666 of file parse-events.c.

Here is the call graph for this function:

◆ parse_events_update_lists()

void parse_events_update_lists ( struct list_head *  list_event,
struct list_head *  list_all 
)

Definition at line 1489 of file parse-events.c.

Here is the call graph for this function:

◆ parse_filter()

int parse_filter ( const struct option *  opt,
const char *  str,
int  unset 
)

Definition at line 2035 of file parse-events.c.

Here is the call graph for this function:

◆ perf_pmu__parse_check()

enum perf_pmu_event_symbol_type perf_pmu__parse_check ( const char *  name)

Definition at line 1766 of file parse-events.c.

Here is the call graph for this function:

◆ print_events()

void print_events ( const char *  event_glob,
bool  name_only,
bool  quiet,
bool  long_desc,
bool  details_flag 
)

Definition at line 2497 of file parse-events.c.

Here is the call graph for this function:

◆ print_hwcache_events()

int print_hwcache_events ( const char *  event_glob,
bool  name_only 
)

Definition at line 2348 of file parse-events.c.

Here is the call graph for this function:

◆ print_sdt_events()

void print_sdt_events ( const char *  subsys_glob,
const char *  event_glob,
bool  name_only 
)

Definition at line 2269 of file parse-events.c.

Here is the call graph for this function:

◆ print_symbol_events()

void print_symbol_events ( const char *  event_glob,
unsigned  type,
struct event_symbol syms,
unsigned  max,
bool  name_only 
)

Definition at line 2422 of file parse-events.c.

Here is the call graph for this function:

◆ print_tracepoint_events()

void print_tracepoint_events ( const char *  subsys_glob,
const char *  event_glob,
bool  name_only 
)

Definition at line 2097 of file parse-events.c.

Here is the call graph for this function:

◆ tracepoint_id_to_path()

struct tracepoint_path* tracepoint_id_to_path ( u64  config)

Definition at line 183 of file parse-events.c.

Here is the call graph for this function:

◆ tracepoint_name_to_path()

struct tracepoint_path* tracepoint_name_to_path ( const char *  name)

Definition at line 253 of file parse-events.c.

Here is the call graph for this function:

◆ valid_event_mount()

int valid_event_mount ( const char *  eventfs)

Variable Documentation

◆ event_symbols_hw

struct event_symbol event_symbols_hw[]

Definition at line 55 of file parse-events.c.

◆ event_symbols_sw

struct event_symbol event_symbols_sw[]

Definition at line 98 of file parse-events.c.