|
Linux Perf
|
#include <linux/bpf.h>#include <bpf/libbpf.h>#include <bpf/bpf.h>#include <linux/err.h>#include <linux/kernel.h>#include <linux/string.h>#include <errno.h>#include "perf.h"#include "debug.h"#include "bpf-loader.h"#include "bpf-prologue.h"#include "probe-event.h"#include "probe-finder.h"#include "parse-events.h"#include "strfilter.h"#include "llvm-utils.h"#include "c++/clang-c.h"
Go to the source code of this file.
Classes | |
| struct | bpf_prog_priv |
| struct | bpf_map_op |
| struct | bpf_map_priv |
| struct | bpf_obj_config__map_func |
Macros | |
| #define | DEFINE_PRINT_FN(name, level) |
| #define | EVENTS_WRITE_BUFSIZE 4096 |
| #define | bpf__for_each_map(pos, obj, objtmp) |
| #define | bpf__for_each_stdout_map(pos, obj, objtmp) |
| #define | ERRNO_OFFSET(e) ((e) - __BPF_LOADER_ERRNO__START) |
| #define | ERRCODE_OFFSET(c) ERRNO_OFFSET(BPF_LOADER_ERRNO__##c) |
| #define | NR_ERRNO (__BPF_LOADER_ERRNO__END - __BPF_LOADER_ERRNO__START) |
| #define | bpf__strerror_head(err, buf, size) |
| #define | bpf__strerror_entry(val, fmt...) |
| #define | bpf__strerror_end(buf, size) |
Typedefs | |
| typedef int(* | map_config_func_t) (const char *name, int map_fd, const struct bpf_map_def *pdef, struct bpf_map_op *op, void *pkey, void *arg) |
Enumerations | |
| enum | bpf_map_op_type { BPF_MAP_OP_SET_VALUE, BPF_MAP_OP_SET_EVSEL } |
| enum | bpf_map_key_type { BPF_MAP_KEY_ALL, BPF_MAP_KEY_RANGES } |
Functions | |
| struct bpf_object * | bpf__prepare_load_buffer (void *obj_buf, size_t obj_buf_sz, const char *name) |
| struct bpf_object * | bpf__prepare_load (const char *filename, bool source) |
| void | bpf__clear (void) |
| static void | clear_prog_priv (struct bpf_program *prog __maybe_unused, void *_priv) |
| static int | prog_config__exec (const char *value, struct perf_probe_event *pev) |
| static int | prog_config__module (const char *value, struct perf_probe_event *pev) |
| static int | prog_config__bool (const char *value, bool *pbool, bool invert) |
| static int | prog_config__inlines (const char *value, struct perf_probe_event *pev __maybe_unused) |
| static int | prog_config__force (const char *value, struct perf_probe_event *pev __maybe_unused) |
| static int | do_prog_config (const char *key, const char *value, struct perf_probe_event *pev) |
| static const char * | parse_prog_config_kvpair (const char *config_str, struct perf_probe_event *pev) |
| static int | parse_prog_config (const char *config_str, const char **p_main_str, bool *is_tp, struct perf_probe_event *pev) |
| static int | config_bpf_program (struct bpf_program *prog) |
| static int | bpf__prepare_probe (void) |
| static int | preproc_gen_prologue (struct bpf_program *prog, int n, struct bpf_insn *orig_insns, int orig_insns_cnt, struct bpf_prog_prep_result *res) |
| static int | compare_tev_args (const void *ptev1, const void *ptev2) |
| static int | map_prologue (struct perf_probe_event *pev, int *mapping, int *nr_types) |
| static int | hook_load_preprocessor (struct bpf_program *prog) |
| int | bpf__probe (struct bpf_object *obj) |
| int | bpf__unprobe (struct bpf_object *obj) |
| int | bpf__load (struct bpf_object *obj) |
| int | bpf__foreach_event (struct bpf_object *obj, bpf_prog_iter_callback_t func, void *arg) |
| static void | bpf_map_op__delete (struct bpf_map_op *op) |
| static void | bpf_map_priv__purge (struct bpf_map_priv *priv) |
| static void | bpf_map_priv__clear (struct bpf_map *map __maybe_unused, void *_priv) |
| static int | bpf_map_op_setkey (struct bpf_map_op *op, struct parse_events_term *term) |
| static struct bpf_map_op * | bpf_map_op__new (struct parse_events_term *term) |
| static struct bpf_map_op * | bpf_map_op__clone (struct bpf_map_op *op) |
| static struct bpf_map_priv * | bpf_map_priv__clone (struct bpf_map_priv *priv) |
| static int | bpf_map__add_op (struct bpf_map *map, struct bpf_map_op *op) |
| static struct bpf_map_op * | bpf_map__add_newop (struct bpf_map *map, struct parse_events_term *term) |
| static int | __bpf_map__config_value (struct bpf_map *map, struct parse_events_term *term) |
| static int | bpf_map__config_value (struct bpf_map *map, struct parse_events_term *term, struct perf_evlist *evlist __maybe_unused) |
| static int | __bpf_map__config_event (struct bpf_map *map, struct parse_events_term *term, struct perf_evlist *evlist) |
| static int | bpf_map__config_event (struct bpf_map *map, struct parse_events_term *term, struct perf_evlist *evlist) |
| static int | config_map_indices_range_check (struct parse_events_term *term, struct bpf_map *map, const char *map_name) |
| static int | bpf__obj_config_map (struct bpf_object *obj, struct parse_events_term *term, struct perf_evlist *evlist, int *key_scan_pos) |
| int | bpf__config_obj (struct bpf_object *obj, struct parse_events_term *term, struct perf_evlist *evlist, int *error_pos) |
| static int | foreach_key_array_all (map_config_func_t func, void *arg, const char *name, int map_fd, const struct bpf_map_def *pdef, struct bpf_map_op *op) |
| static int | foreach_key_array_ranges (map_config_func_t func, void *arg, const char *name, int map_fd, const struct bpf_map_def *pdef, struct bpf_map_op *op) |
| static int | bpf_map_config_foreach_key (struct bpf_map *map, map_config_func_t func, void *arg) |
| static int | apply_config_value_for_key (int map_fd, void *pkey, size_t val_size, u64 val) |
| static int | apply_config_evsel_for_key (const char *name, int map_fd, void *pkey, struct perf_evsel *evsel) |
| static int | apply_obj_config_map_for_key (const char *name, int map_fd, const struct bpf_map_def *pdef, struct bpf_map_op *op, void *pkey, void *arg __maybe_unused) |
| static int | apply_obj_config_map (struct bpf_map *map) |
| static int | apply_obj_config_object (struct bpf_object *obj) |
| int | bpf__apply_obj_config (void) |
| int | bpf__setup_stdout (struct perf_evlist *evlist) |
| static int | bpf_loader_strerror (int err, char *buf, size_t size) |
| int | bpf__strerror_prepare_load (const char *filename, bool source, int err, char *buf, size_t size) |
| int | bpf__strerror_probe (struct bpf_object *obj __maybe_unused, int err, char *buf, size_t size) |
| int | bpf__strerror_load (struct bpf_object *obj, int err, char *buf, size_t size) |
| int | bpf__strerror_config_obj (struct bpf_object *obj __maybe_unused, struct parse_events_term *term __maybe_unused, struct perf_evlist *evlist __maybe_unused, int *error_pos __maybe_unused, int err, char *buf, size_t size) |
| int | bpf__strerror_apply_obj_config (int err, char *buf, size_t size) |
| int | bpf__strerror_setup_stdout (struct perf_evlist *evlist __maybe_unused, int err, char *buf, size_t size) |
Variables | |
| static bool | libbpf_initialized |
| struct { | |
| const char * key | |
| const char * usage | |
| const char * desc | |
| int(* func )(const char *, struct perf_probe_event *) | |
| } | bpf_prog_config_terms [] |
| struct bpf_obj_config__map_func | bpf_obj_config__map_funcs [] |
| static const char * | bpf_loader_strerror_table [NR_ERRNO] |
| #define bpf__for_each_map | ( | pos, | |
| obj, | |||
| objtmp | |||
| ) |
Definition at line 1526 of file bpf-loader.c.
| #define bpf__for_each_stdout_map | ( | pos, | |
| obj, | |||
| objtmp | |||
| ) |
Definition at line 1530 of file bpf-loader.c.
| #define bpf__strerror_end | ( | buf, | |
| size | |||
| ) |
Definition at line 1687 of file bpf-loader.c.
| #define bpf__strerror_entry | ( | val, | |
| fmt... | |||
| ) |
Definition at line 1681 of file bpf-loader.c.
Definition at line 1668 of file bpf-loader.c.
| #define DEFINE_PRINT_FN | ( | name, | |
| level | |||
| ) |
Definition at line 27 of file bpf-loader.c.
| #define ERRCODE_OFFSET | ( | c | ) | ERRNO_OFFSET(BPF_LOADER_ERRNO__##c) |
Definition at line 1608 of file bpf-loader.c.
| #define ERRNO_OFFSET | ( | e | ) | ((e) - __BPF_LOADER_ERRNO__START) |
Definition at line 1607 of file bpf-loader.c.
| #define EVENTS_WRITE_BUFSIZE 4096 |
Definition at line 703 of file bpf-loader.c.
| #define NR_ERRNO (__BPF_LOADER_ERRNO__END - __BPF_LOADER_ERRNO__START) |
Definition at line 1609 of file bpf-loader.c.
| typedef int(* map_config_func_t) (const char *name, int map_fd, const struct bpf_map_def *pdef, struct bpf_map_op *op, void *pkey, void *arg) |
Definition at line 1263 of file bpf-loader.c.
| enum bpf_map_key_type |
| Enumerator | |
|---|---|
| BPF_MAP_KEY_ALL | |
| BPF_MAP_KEY_RANGES | |
Definition at line 816 of file bpf-loader.c.
| enum bpf_map_op_type |
| Enumerator | |
|---|---|
| BPF_MAP_OP_SET_VALUE | |
| BPF_MAP_OP_SET_EVSEL | |
Definition at line 811 of file bpf-loader.c.
|
static |
|
static |
|
static |
|
static |
Definition at line 1378 of file bpf-loader.c.
|
static |
|
static |
|
static |
| int bpf__apply_obj_config | ( | void | ) |
| void bpf__clear | ( | void | ) |
| int bpf__config_obj | ( | struct bpf_object * | obj, |
| struct parse_events_term * | term, | ||
| struct perf_evlist * | evlist, | ||
| int * | error_pos | ||
| ) |
| int bpf__foreach_event | ( | struct bpf_object * | obj, |
| bpf_prog_iter_callback_t | func, | ||
| void * | arg | ||
| ) |
Definition at line 756 of file bpf-loader.c.
| int bpf__load | ( | struct bpf_object * | obj | ) |
Definition at line 744 of file bpf-loader.c.
|
static |
| struct bpf_object* bpf__prepare_load | ( | const char * | filename, |
| bool | source | ||
| ) |
| struct bpf_object* bpf__prepare_load_buffer | ( | void * | obj_buf, |
| size_t | obj_buf_sz, | ||
| const char * | name | ||
| ) |
Definition at line 57 of file bpf-loader.c.
|
static |
| int bpf__probe | ( | struct bpf_object * | obj | ) |
| int bpf__setup_stdout | ( | struct perf_evlist * | evlist | ) |
| int bpf__strerror_apply_obj_config | ( | int err | , |
| char * | buf, | ||
| size_t | size | ||
| ) |
Definition at line 1768 of file bpf-loader.c.
| int bpf__strerror_config_obj | ( | struct bpf_object *obj | __maybe_unused, |
| struct parse_events_term *term | __maybe_unused, | ||
| struct perf_evlist *evlist | __maybe_unused, | ||
| int *error_pos | __maybe_unused, | ||
| int err | , | ||
| char * | buf, | ||
| size_t | size | ||
| ) |
Definition at line 1755 of file bpf-loader.c.
| int bpf__strerror_load | ( | struct bpf_object * | obj, |
| int | err, | ||
| char * | buf, | ||
| size_t | size | ||
| ) |
| int bpf__strerror_prepare_load | ( | const char * | filename, |
| bool | source, | ||
| int | err, | ||
| char * | buf, | ||
| size_t | size | ||
| ) |
| int bpf__strerror_probe | ( | struct bpf_object *obj | __maybe_unused, |
| int err | , | ||
| char * | buf, | ||
| size_t | size | ||
| ) |
Definition at line 1711 of file bpf-loader.c.
| int bpf__strerror_setup_stdout | ( | struct perf_evlist *evlist | __maybe_unused, |
| int err | , | ||
| char * | buf, | ||
| size_t | size | ||
| ) |
Definition at line 1781 of file bpf-loader.c.
| int bpf__unprobe | ( | struct bpf_object * | obj | ) |
|
static |
Definition at line 1638 of file bpf-loader.c.
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Definition at line 870 of file bpf-loader.c.
|
static |
|
static |
|
static |
|
static |
|
static |
Definition at line 492 of file bpf-loader.c.
|
static |
|
static |
Definition at line 1143 of file bpf-loader.c.
|
static |
Definition at line 228 of file bpf-loader.c.
|
static |
Definition at line 1269 of file bpf-loader.c.
|
static |
Definition at line 1289 of file bpf-loader.c.
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Definition at line 165 of file bpf-loader.c.
|
static |
Definition at line 145 of file bpf-loader.c.
|
static |
|
static |
|
static |
Definition at line 155 of file bpf-loader.c.
|
static |
Definition at line 1611 of file bpf-loader.c.
| struct bpf_obj_config__map_func bpf_obj_config__map_funcs[] |
Definition at line 1137 of file bpf-loader.c.
| struct { ... } bpf_prog_config_terms[] |
| const char* desc |
Definition at line 198 of file bpf-loader.c.
| int(* func) (const char *, struct perf_probe_event *) |
Definition at line 199 of file bpf-loader.c.
| const char* key |
Definition at line 196 of file bpf-loader.c.
|
static |
Definition at line 54 of file bpf-loader.c.
| const char* usage |
Definition at line 197 of file bpf-loader.c.