Skip to content

Commit

Permalink
samples/bpf: bpf_load.h document steps helpers perform
Browse files Browse the repository at this point in the history
  • Loading branch information
netoptimizer committed Feb 25, 2017
1 parent 6a681c3 commit 7d677fb
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions kernel/samples/bpf/bpf_load.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,22 @@ extern int prog_cnt;
/* parses elf file compiled by llvm .c->.o
* . parses 'maps' section and creates maps via BPF syscall
* . parses 'license' section and passes it to syscall
*/
int load_bpf_elf_sections(int fd);
/*
* . parses elf relocations for BPF maps and adjusts BPF_LD_IMM64 insns by
* storing map_fd into insn->imm and marking such insns as BPF_PSEUDO_MAP_FD
* . loads eBPF programs via BPF syscall
*
*/
int load_bpf_relocate_maps_and_attach(int fd);
/*
* One ELF file can contain multiple BPF programs which will be loaded
* and their FDs stored stored in prog_fd array
*
* returns zero on success
*/
int load_bpf_file(char *path);

/* Helpers to splitup load_bpf_file */
int load_bpf_elf_sections(int fd);
int load_bpf_relocate_maps_and_attach(int fd);

void read_trace_pipe(void);
struct ksym {
Expand Down

0 comments on commit 7d677fb

Please sign in to comment.