Linux Perf
bpf-loader.c File Reference
#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"
Include dependency graph for bpf-loader.c:

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_opbpf_map_op__new (struct parse_events_term *term)
 
static struct bpf_map_opbpf_map_op__clone (struct bpf_map_op *op)
 
static struct bpf_map_privbpf_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_opbpf_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]
 

Macro Definition Documentation

◆ bpf__for_each_map

#define bpf__for_each_map (   pos,
  obj,
  objtmp 
)
Value:
bpf_object__for_each_safe(obj, objtmp) \
bpf_map__for_each(pos, obj)

Definition at line 1526 of file bpf-loader.c.

◆ bpf__for_each_stdout_map

#define bpf__for_each_stdout_map (   pos,
  obj,
  objtmp 
)
Value:
bpf__for_each_map(pos, obj, objtmp) \
if (bpf_map__name(pos) && \
(strcmp("__bpf_stdout__", \
bpf_map__name(pos)) == 0))
#define bpf__for_each_map(pos, obj, objtmp)
Definition: bpf-loader.c:1526

Definition at line 1530 of file bpf-loader.c.

◆ bpf__strerror_end

#define bpf__strerror_end (   buf,
  size 
)
Value:
}\
buf[size - 1] = '\0';
size_t size
Definition: evsel.c:60

Definition at line 1687 of file bpf-loader.c.

◆ bpf__strerror_entry

#define bpf__strerror_entry (   val,
  fmt... 
)
Value:
case val: {\
scnprintf(buf, size, fmt);\
break;\
}
size_t size
Definition: evsel.c:60
const char * fmt
Definition: dso.c:193

Definition at line 1681 of file bpf-loader.c.

◆ bpf__strerror_head

#define bpf__strerror_head (   err,
  buf,
  size 
)
Value:
char sbuf[STRERR_BUFSIZE], *emsg;\
if (!size)\
return 0;\
if (err < 0)\
err = -err;\
bpf_loader_strerror(err, sbuf, sizeof(sbuf));\
emsg = sbuf;\
switch (err) {\
default:\
scnprintf(buf, size, "%s", emsg);\
break;
size_t size
Definition: evsel.c:60
int int err
Definition: 5sec.c:44
#define STRERR_BUFSIZE
Definition: debug.h:43

Definition at line 1668 of file bpf-loader.c.

◆ DEFINE_PRINT_FN

#define DEFINE_PRINT_FN (   name,
  level 
)
Value:
static int libbpf_##name(const char *fmt, ...) \
{ \
va_list args; \
int ret; \
\
va_start(args, fmt); \
ret = veprintf(level, verbose, pr_fmt(fmt), args);\
va_end(args); \
return ret; \
}
int veprintf(int level, int var, const char *fmt, va_list args)
Definition: debug.c:32
#define pr_fmt(fmt)
Definition: json.h:19
const char * name
const char * fmt
Definition: dso.c:193
int verbose
Definition: jevents.c:53

Definition at line 27 of file bpf-loader.c.

◆ ERRCODE_OFFSET

#define ERRCODE_OFFSET (   c)    ERRNO_OFFSET(BPF_LOADER_ERRNO__##c)

Definition at line 1608 of file bpf-loader.c.

◆ ERRNO_OFFSET

#define ERRNO_OFFSET (   e)    ((e) - __BPF_LOADER_ERRNO__START)

Definition at line 1607 of file bpf-loader.c.

◆ EVENTS_WRITE_BUFSIZE

#define EVENTS_WRITE_BUFSIZE   4096

Definition at line 703 of file bpf-loader.c.

◆ NR_ERRNO

Definition at line 1609 of file bpf-loader.c.

Typedef Documentation

◆ map_config_func_t

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.

Enumeration Type Documentation

◆ bpf_map_key_type

Enumerator
BPF_MAP_KEY_ALL 
BPF_MAP_KEY_RANGES 

Definition at line 816 of file bpf-loader.c.

◆ bpf_map_op_type

Enumerator
BPF_MAP_OP_SET_VALUE 
BPF_MAP_OP_SET_EVSEL 

Definition at line 811 of file bpf-loader.c.

Function Documentation

◆ __bpf_map__config_event()

static int __bpf_map__config_event ( struct bpf_map *  map,
struct parse_events_term term,
struct perf_evlist evlist 
)
static

Definition at line 1072 of file bpf-loader.c.

Here is the call graph for this function:

◆ __bpf_map__config_value()

static int __bpf_map__config_value ( struct bpf_map *  map,
struct parse_events_term term 
)
static

Definition at line 1012 of file bpf-loader.c.

Here is the call graph for this function:

◆ apply_config_evsel_for_key()

static int apply_config_evsel_for_key ( const char *  name,
int  map_fd,
void *  pkey,
struct perf_evsel evsel 
)
static

Definition at line 1413 of file bpf-loader.c.

Here is the call graph for this function:

◆ apply_config_value_for_key()

static int apply_config_value_for_key ( int  map_fd,
void *  pkey,
size_t  val_size,
u64  val 
)
static

Definition at line 1378 of file bpf-loader.c.

◆ apply_obj_config_map()

static int apply_obj_config_map ( struct bpf_map *  map)
static

Definition at line 1491 of file bpf-loader.c.

Here is the call graph for this function:

◆ apply_obj_config_map_for_key()

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

Definition at line 1466 of file bpf-loader.c.

Here is the call graph for this function:

◆ apply_obj_config_object()

static int apply_obj_config_object ( struct bpf_object *  obj)
static

Definition at line 1499 of file bpf-loader.c.

Here is the call graph for this function:

◆ bpf__apply_obj_config()

int bpf__apply_obj_config ( void  )

Definition at line 1512 of file bpf-loader.c.

Here is the call graph for this function:

◆ bpf__clear()

void bpf__clear ( void  )

Definition at line 120 of file bpf-loader.c.

Here is the call graph for this function:

◆ bpf__config_obj()

int bpf__config_obj ( struct bpf_object *  obj,
struct parse_events_term term,
struct perf_evlist evlist,
int *  error_pos 
)

Definition at line 1239 of file bpf-loader.c.

Here is the call graph for this function:

◆ bpf__foreach_event()

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.

◆ bpf__load()

int bpf__load ( struct bpf_object *  obj)

Definition at line 744 of file bpf-loader.c.

◆ bpf__obj_config_map()

static int bpf__obj_config_map ( struct bpf_object *  obj,
struct parse_events_term term,
struct perf_evlist evlist,
int *  key_scan_pos 
)
static

Definition at line 1180 of file bpf-loader.c.

Here is the call graph for this function:

◆ bpf__prepare_load()

struct bpf_object* bpf__prepare_load ( const char *  filename,
bool  source 
)

Definition at line 77 of file bpf-loader.c.

Here is the call graph for this function:

◆ bpf__prepare_load_buffer()

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.

◆ bpf__prepare_probe()

static int bpf__prepare_probe ( void  )
static

Definition at line 405 of file bpf-loader.c.

Here is the call graph for this function:

◆ bpf__probe()

int bpf__probe ( struct bpf_object *  obj)

Definition at line 643 of file bpf-loader.c.

Here is the call graph for this function:

◆ bpf__setup_stdout()

int bpf__setup_stdout ( struct perf_evlist evlist)

Definition at line 1536 of file bpf-loader.c.

Here is the call graph for this function:

◆ bpf__strerror_apply_obj_config()

int bpf__strerror_apply_obj_config ( int err  ,
char *  buf,
size_t  size 
)

Definition at line 1768 of file bpf-loader.c.

◆ bpf__strerror_config_obj()

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.

◆ bpf__strerror_load()

int bpf__strerror_load ( struct bpf_object *  obj,
int  err,
char *  buf,
size_t  size 
)

Definition at line 1727 of file bpf-loader.c.

Here is the call graph for this function:

◆ bpf__strerror_prepare_load()

int bpf__strerror_prepare_load ( const char *  filename,
bool  source,
int  err,
char *  buf,
size_t  size 
)

Definition at line 1691 of file bpf-loader.c.

Here is the call graph for this function:

◆ bpf__strerror_probe()

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.

◆ bpf__strerror_setup_stdout()

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.

◆ bpf__unprobe()

int bpf__unprobe ( struct bpf_object *  obj)

Definition at line 704 of file bpf-loader.c.

Here is the call graph for this function:

◆ bpf_loader_strerror()

static int bpf_loader_strerror ( int  err,
char *  buf,
size_t  size 
)
static

Definition at line 1638 of file bpf-loader.c.

◆ bpf_map__add_newop()

static struct bpf_map_op* bpf_map__add_newop ( struct bpf_map *  map,
struct parse_events_term term 
)
static

Definition at line 994 of file bpf-loader.c.

Here is the call graph for this function:

◆ bpf_map__add_op()

static int bpf_map__add_op ( struct bpf_map *  map,
struct bpf_map_op op 
)
static

Definition at line 965 of file bpf-loader.c.

Here is the call graph for this function:

◆ bpf_map__config_event()

static int bpf_map__config_event ( struct bpf_map *  map,
struct parse_events_term term,
struct perf_evlist evlist 
)
static

Definition at line 1114 of file bpf-loader.c.

Here is the call graph for this function:

◆ bpf_map__config_value()

static int bpf_map__config_value ( struct bpf_map *  map,
struct parse_events_term term,
struct perf_evlist *evlist  __maybe_unused 
)
static

Definition at line 1054 of file bpf-loader.c.

Here is the call graph for this function:

◆ bpf_map_config_foreach_key()

static int bpf_map_config_foreach_key ( struct bpf_map *  map,
map_config_func_t  func,
void *  arg 
)
static

Definition at line 1316 of file bpf-loader.c.

Here is the call graph for this function:

◆ bpf_map_op__clone()

static struct bpf_map_op* bpf_map_op__clone ( struct bpf_map_op op)
static

Definition at line 913 of file bpf-loader.c.

Here is the call graph for this function:

◆ bpf_map_op__delete()

static void bpf_map_op__delete ( struct bpf_map_op op)
static

Definition at line 839 of file bpf-loader.c.

Here is the call graph for this function:

◆ bpf_map_op__new()

static struct bpf_map_op* bpf_map_op__new ( struct parse_events_term term)
static

Definition at line 892 of file bpf-loader.c.

Here is the call graph for this function:

◆ bpf_map_op_setkey()

static int bpf_map_op_setkey ( struct bpf_map_op op,
struct parse_events_term term 
)
static

Definition at line 870 of file bpf-loader.c.

◆ bpf_map_priv__clear()

static void bpf_map_priv__clear ( struct bpf_map *map  __maybe_unused,
void *  _priv 
)
static

Definition at line 860 of file bpf-loader.c.

Here is the call graph for this function:

◆ bpf_map_priv__clone()

static struct bpf_map_priv* bpf_map_priv__clone ( struct bpf_map_priv priv)
static

Definition at line 940 of file bpf-loader.c.

Here is the call graph for this function:

◆ bpf_map_priv__purge()

static void bpf_map_priv__purge ( struct bpf_map_priv priv)
static

Definition at line 849 of file bpf-loader.c.

Here is the call graph for this function:

◆ clear_prog_priv()

static void clear_prog_priv ( struct bpf_program *prog  __maybe_unused,
void *  _priv 
)
static

Definition at line 131 of file bpf-loader.c.

Here is the call graph for this function:

◆ compare_tev_args()

static int compare_tev_args ( const void *  ptev1,
const void *  ptev2 
)
static

Definition at line 492 of file bpf-loader.c.

◆ config_bpf_program()

static int config_bpf_program ( struct bpf_program *  prog)
static

Definition at line 328 of file bpf-loader.c.

Here is the call graph for this function:

◆ config_map_indices_range_check()

static int config_map_indices_range_check ( struct parse_events_term term,
struct bpf_map *  map,
const char *  map_name 
)
static

Definition at line 1143 of file bpf-loader.c.

◆ do_prog_config()

static int do_prog_config ( const char *  key,
const char *  value,
struct perf_probe_event pev 
)
static

Definition at line 228 of file bpf-loader.c.

◆ foreach_key_array_all()

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

Definition at line 1269 of file bpf-loader.c.

◆ foreach_key_array_ranges()

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

Definition at line 1289 of file bpf-loader.c.

◆ hook_load_preprocessor()

static int hook_load_preprocessor ( struct bpf_program *  prog)
static

Definition at line 583 of file bpf-loader.c.

Here is the call graph for this function:

◆ map_prologue()

static int map_prologue ( struct perf_probe_event pev,
int *  mapping,
int *  nr_types 
)
static

Definition at line 539 of file bpf-loader.c.

Here is the call graph for this function:

◆ parse_prog_config()

static int parse_prog_config ( const char *  config_str,
const char **  p_main_str,
bool *  is_tp,
struct perf_probe_event pev 
)
static

Definition at line 292 of file bpf-loader.c.

Here is the call graph for this function:

◆ parse_prog_config_kvpair()

static const char* parse_prog_config_kvpair ( const char *  config_str,
struct perf_probe_event pev 
)
static

Definition at line 251 of file bpf-loader.c.

Here is the call graph for this function:

◆ preproc_gen_prologue()

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

Definition at line 427 of file bpf-loader.c.

Here is the call graph for this function:

◆ prog_config__bool()

static int prog_config__bool ( const char *  value,
bool *  pbool,
bool  invert 
)
static

Definition at line 165 of file bpf-loader.c.

◆ prog_config__exec()

static int prog_config__exec ( const char *  value,
struct perf_probe_event pev 
)
static

Definition at line 145 of file bpf-loader.c.

◆ prog_config__force()

static int prog_config__force ( const char *  value,
struct perf_probe_event *pev  __maybe_unused 
)
static

Definition at line 189 of file bpf-loader.c.

Here is the call graph for this function:

◆ prog_config__inlines()

static int prog_config__inlines ( const char *  value,
struct perf_probe_event *pev  __maybe_unused 
)
static

Definition at line 182 of file bpf-loader.c.

Here is the call graph for this function:

◆ prog_config__module()

static int prog_config__module ( const char *  value,
struct perf_probe_event pev 
)
static

Definition at line 155 of file bpf-loader.c.

Variable Documentation

◆ bpf_loader_strerror_table

const char* bpf_loader_strerror_table[NR_ERRNO]
static
Initial value:
= {
[ERRCODE_OFFSET(CONFIG)] = "Invalid config string",
[ERRCODE_OFFSET(GROUP)] = "Invalid group name",
[ERRCODE_OFFSET(EVENTNAME)] = "No event name found in config string",
[ERRCODE_OFFSET(INTERNAL)] = "BPF loader internal error",
[ERRCODE_OFFSET(COMPILE)] = "Error when compiling BPF scriptlet",
[ERRCODE_OFFSET(PROGCONF_TERM)] = "Invalid program config term in config string",
[ERRCODE_OFFSET(PROLOGUE)] = "Failed to generate prologue",
[ERRCODE_OFFSET(PROLOGUE2BIG)] = "Prologue too big for program",
[ERRCODE_OFFSET(PROLOGUEOOB)] = "Offset out of bound for prologue",
[ERRCODE_OFFSET(OBJCONF_OPT)] = "Invalid object config option",
[ERRCODE_OFFSET(OBJCONF_CONF)] = "Config value not set (missing '=')",
[ERRCODE_OFFSET(OBJCONF_MAP_OPT)] = "Invalid object map config option",
[ERRCODE_OFFSET(OBJCONF_MAP_NOTEXIST)] = "Target map doesn't exist",
[ERRCODE_OFFSET(OBJCONF_MAP_VALUE)] = "Incorrect value type for map",
[ERRCODE_OFFSET(OBJCONF_MAP_TYPE)] = "Incorrect map type",
[ERRCODE_OFFSET(OBJCONF_MAP_KEYSIZE)] = "Incorrect map key size",
[ERRCODE_OFFSET(OBJCONF_MAP_VALUESIZE)] = "Incorrect map value size",
[ERRCODE_OFFSET(OBJCONF_MAP_NOEVT)] = "Event not found for map setting",
[ERRCODE_OFFSET(OBJCONF_MAP_MAPSIZE)] = "Invalid map size for event setting",
[ERRCODE_OFFSET(OBJCONF_MAP_EVTDIM)] = "Event dimension too large",
[ERRCODE_OFFSET(OBJCONF_MAP_EVTINH)] = "Doesn't support inherit event",
[ERRCODE_OFFSET(OBJCONF_MAP_EVTTYPE)] = "Wrong event type for map",
[ERRCODE_OFFSET(OBJCONF_MAP_IDX2BIG)] = "Index too large",
}
#define ERRCODE_OFFSET(c)
Definition: bpf-loader.c:1608

Definition at line 1611 of file bpf-loader.c.

◆ bpf_obj_config__map_funcs

struct bpf_obj_config__map_func bpf_obj_config__map_funcs[]
Initial value:
= {
}
static int bpf_map__config_event(struct bpf_map *map, struct parse_events_term *term, struct perf_evlist *evlist)
Definition: bpf-loader.c:1114
static int bpf_map__config_value(struct bpf_map *map, struct parse_events_term *term, struct perf_evlist *evlist __maybe_unused)
Definition: bpf-loader.c:1054

Definition at line 1137 of file bpf-loader.c.

◆ bpf_prog_config_terms

struct { ... } bpf_prog_config_terms[]
Initial value:
= {
{
.key = "exec",
.usage = "exec=<full path of file>",
.desc = "Set uprobe target",
},
{
.key = "module",
.usage = "module=<module name> ",
.desc = "Set kprobe module",
},
{
.key = "inlines",
.usage = "inlines=[yes|no] ",
.desc = "Probe at inline symbol",
},
{
.key = "force",
.usage = "force=[yes|no] ",
.desc = "Forcibly add events with existing name",
},
}
static int prog_config__exec(const char *value, struct perf_probe_event *pev)
Definition: bpf-loader.c:145
static int prog_config__force(const char *value, struct perf_probe_event *pev __maybe_unused)
Definition: bpf-loader.c:189
static int prog_config__module(const char *value, struct perf_probe_event *pev)
Definition: bpf-loader.c:155
static int prog_config__inlines(const char *value, struct perf_probe_event *pev __maybe_unused)
Definition: bpf-loader.c:182

◆ desc

const char* desc

Definition at line 198 of file bpf-loader.c.

◆ func

int(* func) (const char *, struct perf_probe_event *)

Definition at line 199 of file bpf-loader.c.

◆ key

const char* key

Definition at line 196 of file bpf-loader.c.

◆ libbpf_initialized

bool libbpf_initialized
static

Definition at line 54 of file bpf-loader.c.

◆ usage

const char* usage

Definition at line 197 of file bpf-loader.c.