Linux Perf
bpf-loader.h File Reference
#include <linux/compiler.h>
#include <linux/err.h>
#include <string.h>
#include <bpf/libbpf.h>
#include "probe-event.h"
#include "evlist.h"
#include "debug.h"
#include <errno.h>
Include dependency graph for bpf-loader.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define PERF_BPF_PROBE_GROUP   "perf_bpf_probe"
 

Typedefs

typedef int(* bpf_prog_iter_callback_t) (const char *group, const char *event, int fd, void *arg)
 

Enumerations

enum  bpf_loader_errno {
  __BPF_LOADER_ERRNO__START = __LIBBPF_ERRNO__START - 100, BPF_LOADER_ERRNO__CONFIG = __BPF_LOADER_ERRNO__START, BPF_LOADER_ERRNO__GROUP, BPF_LOADER_ERRNO__EVENTNAME,
  BPF_LOADER_ERRNO__INTERNAL, BPF_LOADER_ERRNO__COMPILE, BPF_LOADER_ERRNO__PROGCONF_TERM, BPF_LOADER_ERRNO__PROLOGUE,
  BPF_LOADER_ERRNO__PROLOGUE2BIG, BPF_LOADER_ERRNO__PROLOGUEOOB, BPF_LOADER_ERRNO__OBJCONF_OPT, BPF_LOADER_ERRNO__OBJCONF_CONF,
  BPF_LOADER_ERRNO__OBJCONF_MAP_OPT, BPF_LOADER_ERRNO__OBJCONF_MAP_NOTEXIST, BPF_LOADER_ERRNO__OBJCONF_MAP_VALUE, BPF_LOADER_ERRNO__OBJCONF_MAP_TYPE,
  BPF_LOADER_ERRNO__OBJCONF_MAP_KEYSIZE, BPF_LOADER_ERRNO__OBJCONF_MAP_VALUESIZE, BPF_LOADER_ERRNO__OBJCONF_MAP_NOEVT, BPF_LOADER_ERRNO__OBJCONF_MAP_MAPSIZE,
  BPF_LOADER_ERRNO__OBJCONF_MAP_EVTDIM, BPF_LOADER_ERRNO__OBJCONF_MAP_EVTINH, BPF_LOADER_ERRNO__OBJCONF_MAP_EVTTYPE, BPF_LOADER_ERRNO__OBJCONF_MAP_IDX2BIG,
  __BPF_LOADER_ERRNO__END
}
 

Functions

static struct bpf_object * bpf__prepare_load (const char *filename __maybe_unused, bool source __maybe_unused)
 
static struct bpf_object * bpf__prepare_load_buffer (void *obj_buf __maybe_unused, size_t obj_buf_sz __maybe_unused)
 
static void bpf__clear (void)
 
static int bpf__probe (struct bpf_object *obj __maybe_unused)
 
static int bpf__unprobe (struct bpf_object *obj __maybe_unused)
 
static int bpf__load (struct bpf_object *obj __maybe_unused)
 
static int bpf__foreach_event (struct bpf_object *obj __maybe_unused, bpf_prog_iter_callback_t func __maybe_unused, void *arg __maybe_unused)
 
static int bpf__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)
 
static int bpf__apply_obj_config (void)
 
static int bpf__setup_stdout (struct perf_evlist *evlist __maybe_unused)
 
static int __bpf_strerror (char *buf, size_t size)
 
static int bpf__strerror_prepare_load (const char *filename __maybe_unused, bool source __maybe_unused, int err __maybe_unused, char *buf, size_t size)
 
static int bpf__strerror_probe (struct bpf_object *obj __maybe_unused, int err __maybe_unused, char *buf, size_t size)
 
static int bpf__strerror_load (struct bpf_object *obj __maybe_unused, int err __maybe_unused, char *buf, size_t size)
 
static 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 __maybe_unused, char *buf, size_t size)
 
static int bpf__strerror_apply_obj_config (int err __maybe_unused, char *buf, size_t size)
 
static int bpf__strerror_setup_stdout (struct perf_evlist *evlist __maybe_unused, int err __maybe_unused, char *buf, size_t size)
 

Macro Definition Documentation

◆ PERF_BPF_PROBE_GROUP

#define PERF_BPF_PROBE_GROUP   "perf_bpf_probe"

Definition at line 48 of file bpf-loader.h.

Typedef Documentation

◆ bpf_prog_iter_callback_t

typedef int(* bpf_prog_iter_callback_t) (const char *group, const char *event, int fd, void *arg)

Definition at line 50 of file bpf-loader.h.

Enumeration Type Documentation

◆ bpf_loader_errno

Enumerator
__BPF_LOADER_ERRNO__START 
BPF_LOADER_ERRNO__CONFIG 
BPF_LOADER_ERRNO__GROUP 
BPF_LOADER_ERRNO__EVENTNAME 
BPF_LOADER_ERRNO__INTERNAL 
BPF_LOADER_ERRNO__COMPILE 
BPF_LOADER_ERRNO__PROGCONF_TERM 
BPF_LOADER_ERRNO__PROLOGUE 
BPF_LOADER_ERRNO__PROLOGUE2BIG 
BPF_LOADER_ERRNO__PROLOGUEOOB 
BPF_LOADER_ERRNO__OBJCONF_OPT 
BPF_LOADER_ERRNO__OBJCONF_CONF 
BPF_LOADER_ERRNO__OBJCONF_MAP_OPT 
BPF_LOADER_ERRNO__OBJCONF_MAP_NOTEXIST 
BPF_LOADER_ERRNO__OBJCONF_MAP_VALUE 
BPF_LOADER_ERRNO__OBJCONF_MAP_TYPE 
BPF_LOADER_ERRNO__OBJCONF_MAP_KEYSIZE 
BPF_LOADER_ERRNO__OBJCONF_MAP_VALUESIZE 
BPF_LOADER_ERRNO__OBJCONF_MAP_NOEVT 
BPF_LOADER_ERRNO__OBJCONF_MAP_MAPSIZE 
BPF_LOADER_ERRNO__OBJCONF_MAP_EVTDIM 
BPF_LOADER_ERRNO__OBJCONF_MAP_EVTINH 
BPF_LOADER_ERRNO__OBJCONF_MAP_EVTTYPE 
BPF_LOADER_ERRNO__OBJCONF_MAP_IDX2BIG 
__BPF_LOADER_ERRNO__END 

Definition at line 17 of file bpf-loader.h.

Function Documentation

◆ __bpf_strerror()

static int __bpf_strerror ( char *  buf,
size_t  size 
)
inlinestatic

Definition at line 142 of file bpf-loader.h.

◆ bpf__apply_obj_config()

static int bpf__apply_obj_config ( void  )
inlinestatic

Definition at line 130 of file bpf-loader.h.

◆ bpf__clear()

static void bpf__clear ( void  )
inlinestatic

Definition at line 106 of file bpf-loader.h.

◆ bpf__config_obj()

static int bpf__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 
)
inlinestatic

Definition at line 121 of file bpf-loader.h.

◆ bpf__foreach_event()

static int bpf__foreach_event ( struct bpf_object *obj  __maybe_unused,
bpf_prog_iter_callback_t func  __maybe_unused,
void *arg  __maybe_unused 
)
inlinestatic

Definition at line 113 of file bpf-loader.h.

◆ bpf__load()

static int bpf__load ( struct bpf_object *obj  __maybe_unused)
inlinestatic

Definition at line 110 of file bpf-loader.h.

◆ bpf__prepare_load()

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

Definition at line 92 of file bpf-loader.h.

◆ bpf__prepare_load_buffer()

static struct bpf_object* bpf__prepare_load_buffer ( void *obj_buf  __maybe_unused,
size_t obj_buf_sz  __maybe_unused 
)
static

Definition at line 100 of file bpf-loader.h.

◆ bpf__probe()

static int bpf__probe ( struct bpf_object *obj  __maybe_unused)
inlinestatic

Definition at line 108 of file bpf-loader.h.

◆ bpf__setup_stdout()

static int bpf__setup_stdout ( struct perf_evlist *evlist  __maybe_unused)
inlinestatic

Definition at line 136 of file bpf-loader.h.

◆ bpf__strerror_apply_obj_config()

static int bpf__strerror_apply_obj_config ( int err  __maybe_unused,
char *  buf,
size_t  size 
)
inlinestatic

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

Here is the call graph for this function:

◆ bpf__strerror_config_obj()

static 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  __maybe_unused,
char *  buf,
size_t  size 
)
inlinestatic

Definition at line 178 of file bpf-loader.h.

Here is the call graph for this function:

◆ bpf__strerror_load()

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

Definition at line 170 of file bpf-loader.h.

Here is the call graph for this function:

◆ bpf__strerror_prepare_load()

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

Definition at line 154 of file bpf-loader.h.

Here is the call graph for this function:

◆ bpf__strerror_probe()

static int bpf__strerror_probe ( struct bpf_object *obj  __maybe_unused,
int err  __maybe_unused,
char *  buf,
size_t  size 
)
inlinestatic

Definition at line 163 of file bpf-loader.h.

Here is the call graph for this function:

◆ bpf__strerror_setup_stdout()

static int bpf__strerror_setup_stdout ( struct perf_evlist *evlist  __maybe_unused,
int err  __maybe_unused,
char *  buf,
size_t  size 
)
inlinestatic

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

Here is the call graph for this function:

◆ bpf__unprobe()

static int bpf__unprobe ( struct bpf_object *obj  __maybe_unused)
inlinestatic

Definition at line 109 of file bpf-loader.h.