Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
parse-events.c File Reference
#include <linux/hw_breakpoint.h>
#include "util.h"
#include "../perf.h"
#include "evlist.h"
#include "evsel.h"
#include "parse-options.h"
#include "parse-events.h"
#include "exec_cmd.h"
#include "string.h"
#include "symbol.h"
#include "cache.h"
#include "header.h"
#include "debugfs.h"
#include "parse-events-bison.h"
#include "parse-events-flex.h"
#include "pmu.h"

Go to the source code of this file.

Data Structures

struct  event_symbol
 
struct  event_modifier
 

Macros

#define YY_EXTRA_TYPE   int
 
#define MAX_NAME_LEN   100
 
#define __PERF_EVENT_FIELD(config, name)   ((config & PERF_EVENT_##name##_MASK) >> PERF_EVENT_##name##_SHIFT)
 
#define PERF_EVENT_RAW(config)   __PERF_EVENT_FIELD(config, RAW)
 
#define PERF_EVENT_CONFIG(config)   __PERF_EVENT_FIELD(config, CONFIG)
 
#define PERF_EVENT_TYPE(config)   __PERF_EVENT_FIELD(config, TYPE)
 
#define PERF_EVENT_ID(config)   __PERF_EVENT_FIELD(config, EVENT)
 
#define for_each_subsystem(sys_dir, sys_dirent, sys_next)
 
#define for_each_event(sys_dirent, evt_dir, evt_dirent, evt_next)
 
#define MAX_EVENT_LENGTH   512
 
#define CHECK_SET_TYPE(bit)
 
#define CHECK_TYPE_VAL(type)
 

Functions

int parse_events_parse (void *data, void *scanner)
 
struct tracepoint_pathtracepoint_id_to_path (u64 config)
 
const charevent_type (int type)
 
int parse_events_add_cache (struct list_head **list, int *idx, char *type, char *op_result1, char *op_result2)
 
int parse_events_add_tracepoint (struct list_head **list, int *idx, char *sys, char *event)
 
int parse_events_add_breakpoint (struct list_head **list, int *idx, void *ptr, char *type)
 
int parse_events_add_numeric (struct list_head **list, int *idx, u32 type, u64 config, struct list_head *head_config)
 
int parse_events_add_pmu (struct list_head **list, int *idx, char *name, struct list_head *head_config)
 
int parse_events__modifier_group (struct list_head *list, char *event_mod)
 
void parse_events__set_leader (char *name, struct list_head *list)
 
void parse_events_update_lists (struct list_head *list_event, struct list_head *list_all)
 
int parse_events__modifier_event (struct list_head *list, char *str, bool add)
 
int parse_events_name (struct list_head *list, char *name)
 
int parse_events_terms (struct list_head *terms, const char *str)
 
int parse_events (struct perf_evlist *evlist, const char *str, int unset __maybe_unused)
 
int parse_events_option (const struct option *opt, const char *str, int unset __maybe_unused)
 
int parse_filter (const struct option *opt, const char *str, int unset __maybe_unused)
 
void print_tracepoint_events (const char *subsys_glob, const char *event_glob, bool name_only)
 
int is_valid_tracepoint (const char *event_string)
 
void print_events_type (u8 type)
 
int print_hwcache_events (const char *event_glob, bool name_only)
 
void print_events (const char *event_glob, bool name_only)
 
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)
 
int parse_events__term_str (struct parse_events__term **term, int type_term, char *config, char *str)
 
int parse_events__term_clone (struct parse_events__term **new, struct parse_events__term *term)
 
void parse_events__free_terms (struct list_head *terms)
 

Macro Definition Documentation

#define __PERF_EVENT_FIELD (   config,
  name 
)    ((config & PERF_EVENT_##name##_MASK) >> PERF_EVENT_##name##_SHIFT)

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

#define CHECK_SET_TYPE (   bit)
Value:
do { \
if (attr->bp_type & bit) \
return -EINVAL; \
else \
attr->bp_type |= bit; \
} while (0)
#define CHECK_TYPE_VAL (   type)
Value:
do { \
if (PARSE_EVENTS__TERM_TYPE_ ## type != term->type_val) \
return -EINVAL; \
} while (0)
#define for_each_event (   sys_dirent,
  evt_dir,
  evt_dirent,
  evt_next 
)
Value:
while (!readdir_r(evt_dir, &evt_dirent, &evt_next) && evt_next) \
if (evt_dirent.d_type == DT_DIR && \
(strcmp(evt_dirent.d_name, ".")) && \
(strcmp(evt_dirent.d_name, "..")) && \
(!tp_event_has_id(&sys_dirent, &evt_dirent)))

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

#define for_each_subsystem (   sys_dir,
  sys_dirent,
  sys_next 
)
Value:
while (!readdir_r(sys_dir, &sys_dirent, &sys_next) && sys_next) \
if (sys_dirent.d_type == DT_DIR && \
(strcmp(sys_dirent.d_name, ".")) && \
(strcmp(sys_dirent.d_name, "..")))

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

#define MAX_EVENT_LENGTH   512

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

#define MAX_NAME_LEN   100

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

#define PERF_EVENT_CONFIG (   config)    __PERF_EVENT_FIELD(config, CONFIG)

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

#define PERF_EVENT_ID (   config)    __PERF_EVENT_FIELD(config, EVENT)

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

#define PERF_EVENT_RAW (   config)    __PERF_EVENT_FIELD(config, RAW)

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

#define PERF_EVENT_TYPE (   config)    __PERF_EVENT_FIELD(config, TYPE)

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

#define YY_EXTRA_TYPE   int

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

Function Documentation

const char* event_type ( int  type)

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

int is_valid_tracepoint ( const char event_string)

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

int parse_events ( struct perf_evlist evlist,
const char str,
int unset  __maybe_unused 
)

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

void parse_events__free_terms ( struct list_head terms)

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

int parse_events__is_hardcoded_term ( struct parse_events__term term)

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

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

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

int parse_events__modifier_group ( struct list_head list,
char event_mod 
)

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

void parse_events__set_leader ( char name,
struct list_head list 
)

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

int parse_events__term_clone ( struct parse_events__term **  new,
struct parse_events__term term 
)

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

int parse_events__term_num ( struct parse_events__term **  term,
int  type_term,
char config,
u64  num 
)

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

int parse_events__term_str ( struct parse_events__term **  term,
int  type_term,
char config,
char str 
)

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

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

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

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

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

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

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

int parse_events_add_pmu ( struct list_head **  list,
int idx,
char name,
struct list_head head_config 
)

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

int parse_events_add_tracepoint ( struct list_head **  list,
int idx,
char sys,
char event 
)

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

int parse_events_name ( struct list_head list,
char name 
)

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

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

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

int parse_events_parse ( void data,
void scanner 
)
int parse_events_terms ( struct list_head terms,
const char str 
)

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

void parse_events_update_lists ( struct list_head list_event,
struct list_head list_all 
)

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

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

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

void print_events ( const char event_glob,
bool  name_only 
)

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

void print_events_type ( u8  type)

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

int print_hwcache_events ( const char event_glob,
bool  name_only 
)

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

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

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

struct tracepoint_path* tracepoint_id_to_path ( u64  config)
read

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