Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove ListProgramNames API #183

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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