#include <bpf/libbpf.h>
#include "perf.h"
#include "debug.h"
#include "bpf-loader.h"
#include "bpf-prologue.h"
#include "probe-finder.h"
#include <errno.h>
#include <dwarf-regs.h>
#include <linux/filter.h>
Go to the source code of this file.
|
static int | pos_get_cnt (struct bpf_insn_pos *pos) |
|
static int | append_insn (struct bpf_insn new_insn, struct bpf_insn_pos *pos) |
|
static int | check_pos (struct bpf_insn_pos *pos) |
|
static int | argtype_to_ldx_size (const char *type) |
|
static const char * | insn_sz_to_str (int insn_sz) |
|
static int | gen_ldx_reg_from_ctx (struct bpf_insn_pos *pos, int ctx_reg, const char *reg, int target_reg) |
|
static int | gen_read_mem (struct bpf_insn_pos *pos, int src_base_addr_reg, int dst_addr_reg, long offset) |
|
static int | gen_prologue_fastpath (struct bpf_insn_pos *pos, struct probe_trace_arg *args, int nargs) |
|
static int | gen_prologue_slowpath (struct bpf_insn_pos *pos, struct probe_trace_arg *args, int nargs) |
|
static int | prologue_relocate (struct bpf_insn_pos *pos, struct bpf_insn *error_code, struct bpf_insn *success_code, struct bpf_insn *user_code) |
|
int | bpf__gen_prologue (struct probe_trace_arg *args, int nargs, struct bpf_insn *new_prog, size_t *new_cnt, size_t cnt_space) |
|
◆ BPF_REG_SIZE
◆ ins
◆ JMP_TO_ERROR_CODE
#define JMP_TO_ERROR_CODE -1 |
◆ JMP_TO_SUCCESS_CODE
#define JMP_TO_SUCCESS_CODE -2 |
◆ JMP_TO_USER_CODE
#define JMP_TO_USER_CODE -3 |
◆ append_insn()
static int append_insn |
( |
struct bpf_insn |
new_insn, |
|
|
struct bpf_insn_pos * |
pos |
|
) |
| |
|
static |
◆ argtype_to_ldx_size()
static int argtype_to_ldx_size |
( |
const char * |
type | ) |
|
|
static |
◆ bpf__gen_prologue()
int bpf__gen_prologue |
( |
struct probe_trace_arg * |
args, |
|
|
int |
nargs, |
|
|
struct bpf_insn * |
new_prog, |
|
|
size_t * |
new_cnt, |
|
|
size_t |
cnt_space |
|
) |
| |
◆ check_pos()
◆ gen_ldx_reg_from_ctx()
static int gen_ldx_reg_from_ctx |
( |
struct bpf_insn_pos * |
pos, |
|
|
int |
ctx_reg, |
|
|
const char * |
reg, |
|
|
int |
target_reg |
|
) |
| |
|
static |
◆ gen_prologue_fastpath()
◆ gen_prologue_slowpath()
◆ gen_read_mem()
static int gen_read_mem |
( |
struct bpf_insn_pos * |
pos, |
|
|
int |
src_base_addr_reg, |
|
|
int |
dst_addr_reg, |
|
|
long |
offset |
|
) |
| |
|
static |
◆ insn_sz_to_str()
static const char* insn_sz_to_str |
( |
int |
insn_sz | ) |
|
|
static |
◆ pos_get_cnt()
◆ prologue_relocate()
static int prologue_relocate |
( |
struct bpf_insn_pos * |
pos, |
|
|
struct bpf_insn * |
error_code, |
|
|
struct bpf_insn * |
success_code, |
|
|
struct bpf_insn * |
user_code |
|
) |
| |
|
static |