Skip to content

Commit

Permalink
Remove ListProgramNames API (#183)
Browse files Browse the repository at this point in the history
Signed-off-by: grantseltzer <grantseltzer@gmail.com>
  • Loading branch information
grantseltzer committed Jun 27, 2022
1 parent 649bcf3 commit 8e7dbe4
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 19 deletions.
16 changes: 0 additions & 16 deletions libbpfgo.go
Expand Up @@ -70,18 +70,6 @@ struct ring_buffer * init_ring_buf(int map_fd, uintptr_t ctx)
return rb;
}
void list_programs(struct bpf_object* obj) {
struct bpf_program *pos;
const char *cs;
const char *css;
bpf_object__for_each_program(pos, obj) {
cs = bpf_program__section_name(pos);
css = bpf_program__name(pos);
printf("section: %s\tname: %s\n", cs, css);
}
}
struct perf_buffer * init_perf_buf(int map_fd, int page_cnt, uintptr_t ctx)
{
struct perf_buffer_opts pb_opts = {};
Expand Down Expand Up @@ -1086,10 +1074,6 @@ func (m *Module) GetProgram(progName string) (*BPFProg, error) {
}, nil
}

func (m *Module) ListProgramNames() {
C.list_programs(m.obj)
}

func (p *BPFProg) GetFd() int {
return int(C.bpf_program__fd(p.prog))
}
Expand Down
1 change: 0 additions & 1 deletion samples/fentry/main.go
Expand Up @@ -25,7 +25,6 @@ func main() {
os.Exit(-1)
}

bpfModule.ListProgramNames()
prog1, err := bpfModule.GetProgram("commit_creds")
if err != nil {
fmt.Fprintln(os.Stderr, err)
Expand Down
2 changes: 0 additions & 2 deletions selftest/set-attach/main.go
Expand Up @@ -22,8 +22,6 @@ func main() {
}
defer bpfModule.Close()

bpfModule.ListProgramNames()

prog, err := bpfModule.GetProgram("foobar")
if err != nil {
fmt.Fprintln(os.Stderr, err)
Expand Down

0 comments on commit 8e7dbe4

Please sign in to comment.