linux/tools
Alan Maguire 39f8dc43b7 libbpf: Add auto-attach for uprobes based on section name
Now that u[ret]probes can use name-based specification, it makes
sense to add support for auto-attach based on SEC() definition.
The format proposed is

        SEC("u[ret]probe/binary:[raw_offset|[function_name[+offset]]")

For example, to trace malloc() in libc:

        SEC("uprobe/libc.so.6:malloc")

...or to trace function foo2 in /usr/bin/foo:

        SEC("uprobe//usr/bin/foo:foo2")

Auto-attach is done for all tasks (pid -1).  prog can be an absolute
path or simply a program/library name; in the latter case, we use
PATH/LD_LIBRARY_PATH to resolve the full path, falling back to
standard locations (/usr/bin:/usr/sbin or /usr/lib64:/usr/lib) if
the file is not found via environment-variable specified locations.

Signed-off-by: Alan Maguire <alan.maguire@oracle.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/1648654000-21758-4-git-send-email-alan.maguire@oracle.com
2022-04-03 19:55:57 -07:00
..
accounting delayacct: track delays from memory compact 2022-01-20 08:52:55 +02:00
arch perf tools changes for v5.18: 1st batch 2022-03-27 13:42:32 -07:00
bootconfig
bpf bpftool: Fix generated code in codegen_asserts 2022-03-28 19:10:25 -07:00
build Merge remote-tracking branch 'torvalds/master' into perf/core 2022-01-13 10:20:59 -03:00
cgroup tools/cgroup/slabinfo: update to work with struct slab 2022-02-21 11:34:49 +01:00
counter
debugging
edid
firewire
firmware
gpio
hv
iio iio: introduce mag_referenced 2022-02-21 19:33:05 +00:00
include bpf: Correct the comment for BTF kind bitfield 2022-04-03 17:06:52 -07:00
io_uring
kvm/kvm_stat
laptop
leds
lib libbpf: Add auto-attach for uprobes based on section name 2022-04-03 19:55:57 -07:00
memory-model tools/memory-model: Explain syntactic and semantic dependencies 2022-02-01 17:32:30 -08:00
objtool objtool: Find unused ENDBR instructions 2022-03-15 10:32:47 +01:00
pci
pcmcia
perf perf tools changes for v5.18: 1st batch 2022-03-27 13:42:32 -07:00
power Thermal control updates for 5.18-rc1 2022-03-21 14:35:11 -07:00
rcu
scripts tools: Fix unavoidable GCC call in Clang builds 2022-03-08 23:36:37 +01:00
spi
testing libbpf: Add auto-attach for uprobes based on section name 2022-04-03 19:55:57 -07:00
thermal/tmon
time
tracing rtla: Tools main loop cleanup 2022-03-15 14:36:50 -04:00
usb
virtio tools/virtio: handle fallout from folio work 2022-03-06 06:06:50 -05:00
vm tools/vm/page_owner_sort.c: support for user-defined culling rules 2022-03-24 19:06:45 -07:00
wmi
Makefile