forked from iovisor/bcc
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bpf: Add support for prog_name and map_name
This patch adds support for prog_name and map_name. For libbpf.{h,c}, the new functions, bpf_prog_load_name() and bpf_create_map_name() is created to avoid breaking the existing libbpf.{a,so} user. libbcc.py is also modified accordingly to reflect the availability of the new functions in libbpf. clang/b_frontend_action.cc, b/codegen_llvm.cc and BPF.cc are modified to take advantage of the prog and map name also. Run the following tests in new and old kernel (old kernel in the sense that it does not support the prog/map name): 1) tools/trace.py -K sys_clone 2) examples/cpp/HelloWorld Here is the output of the bpf (BPF Snapshot) that will be introduced in the later patch: [root@arch-fb-vm1 bcc]# ./tools/biosnoop.py [root@arch-fb-vm1 bcc]# ./build/introspection/bps BID TYPE UID #MAPS LoadTime NAME 113 kprobe 0 1 Oct20/13:11 trace_pid_start 114 kprobe 0 1 Oct20/13:11 trace_req_start 115 kprobe 0 3 Oct20/13:11 trace_req_compl [root@arch-fb-vm1 bcc]# ./build/introspection/bps 113 BID TYPE UID #MAPS LoadTime NAME 113 kprobe 0 1 Oct20/13:11 trace_pid_start MID TYPE FLAGS KeySz ValueSz MaxEnts NAME 186 hash 0x0 8 20 10240 infobyreq Signed-off-by: Martin KaFai Lau <kafai@fb.com>
- Loading branch information
Showing
9 changed files
with
44 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters