Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The BPF metadata feature [see commit](torvalds/linux@ffa915f) allows to define variables that start with the `bpf_metadata_` prefix that can be read with several tools, including `bpftool`: ``` $ sudo bpftool prog | grep perf -A20 1832: perf_event name do_sample tag 6ce6efa2110df18f gpl loaded_at 2022-04-13T08:15:16-0700 uid 0 xlated 416B jited 432B memlock 4096B map_ids 3489,3490,3492 btf_id 1409 pids parca_agent_by_(470302) metadata: name = "parca-agent (https://github.com/parca-dev/parca-agent)" ``` By exposing a name for our BPF program, as well as the version[1] in the future, we can quickly find out which exact program and version of the BPF code we are running. Under the hood, they are backed by an BPF array: ``` $ sudo bpftool map dump id 3492 [{ "value": { ".rodata": [{ "bpf_metadata_name": "parca-agent (https://github.com/parca-dev/parca-agent)" },{ "bpf_metadata_version": "v0.7.0" } ] } } ] ``` [1]: Once `.rodata` support [lands in libbpfgo](aquasecurity/libbpfgo#27) we will be able to replace it with the actual Git revision!
- Loading branch information