Need a way to modify the section name for a read program object

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi All,

I'm trying to write an xdpdump like utility and have some missing part in libbpf to change the fentry/FUNCTION section name before loading the trace program.

In short, I have an eBPF program that has a section name like "fentry/FUNCTION" where FUNCTION needs to be replaced by the name of the XDP program loaded in the interfaces its start function.

The code for loading the ftrace part is something like:

	open_opts.attach_prog_fd = bpf_prog_get_fd_by_id(info.id);
	trace_obj = bpf_object__open_file("xdpdump_bpf.o", &open_opts);

trace_prog_fentry = bpf_object__find_program_by_title(trace_obj, "fentry/FUNCTION");

/* Here I need to replace the trace_prog_fentry->section_name = "fentry/<INTERFACE PROG NAME> */

	bpf_object__load(trace_obj);
	trace_link_fentry = bpf_program__attach_trace(trace_prog_fentry);


See the above, I would like to change the section_name but there is no API to do this, and of course, the struct bpf_program is implementation-specific.

Any idea how I would work around this, or what extension to libbpf can be suggested to support this?

Cheers,

Eelco




[Index of Archives]     [Linux Networking Development]     [Fedora Linux Users]     [Linux SCTP]     [DCCP]     [Gimp]     [Yosemite Campsites]

  Powered by Linux