-
Notifications
You must be signed in to change notification settings - Fork 5
bpf: Add link_info support for uprobe multi link #657
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
base: bpf-next_base
Are you sure you want to change the base?
Conversation
|
Upstream branch: b4e59c1 |
d955544 to
dc3526c
Compare
|
Upstream branch: b4e59c1 |
6ec6e49 to
30160f4
Compare
902178a to
bc1b833
Compare
|
Upstream branch: 3815f89 |
30160f4 to
0bba472
Compare
bc1b833 to
0fbe9f3
Compare
|
Upstream branch: 3815f89 |
0bba472 to
202b850
Compare
0fbe9f3 to
b0d20d2
Compare
|
Upstream branch: 6f101db |
202b850 to
207907f
Compare
b0d20d2 to
1e02037
Compare
|
Upstream branch: 6f101db |
207907f to
bdb891b
Compare
1e02037 to
a98cbca
Compare
|
Upstream branch: e80742d |
bdb891b to
53cffee
Compare
a98cbca to
b7b6ef0
Compare
|
Upstream branch: e80742d |
53cffee to
d9db658
Compare
b7b6ef0 to
293e027
Compare
|
Upstream branch: e80742d |
d9db658 to
4c5a3e3
Compare
293e027 to
260b428
Compare
|
Upstream branch: e80742d |
4c5a3e3 to
f4bd31b
Compare
260b428 to
08949e6
Compare
|
Upstream branch: 155addf |
f4bd31b to
e02efad
Compare
08949e6 to
3a8c9bf
Compare
|
Upstream branch: 689b097 |
e02efad to
8fb821c
Compare
3a8c9bf to
32f9f95
Compare
We need to get offsets for static variables in following changes, so making elf_resolve_syms_offsets to take st_type value as argument and passing it to elf_sym_iter_new. Acked-by: Song Liu <[email protected]> Signed-off-by: Jiri Olsa <[email protected]> Acked-by: Andrii Nakryiko <[email protected]>
We will need to return ref_ctr_offsets values through link_info interface in following change, so we need to keep them around. Storing ref_ctr_offsets values directly into bpf_uprobe array. Acked-by: Song Liu <[email protected]> Signed-off-by: Jiri Olsa <[email protected]> Acked-by: Andrii Nakryiko <[email protected]>
Adding support to get uprobe_link details through bpf_link_info interface. Adding new struct uprobe_multi to struct bpf_link_info to carry the uprobe_multi link details. The uprobe_multi.count is passed from user space to denote size of array fields (offsets/ref_ctr_offsets/cookies). The actual array size is stored back to uprobe_multi.count (allowing user to find out the actual array size) and array fields are populated up to the user passed size. All the non-array fields (path/count/flags/pid) are always set. Signed-off-by: Jiri Olsa <[email protected]>
The fill_link_info test keeps skeleton open and just creates various links. We are wrongly calling bpf_link__detach after each test to close them, we need to call bpf_link__destroy. Signed-off-by: Jiri Olsa <[email protected]> Acked-by: Yafang Shao <[email protected]>
Adding fill_link_info test for uprobe_multi link. Setting up uprobes with bogus ref_ctr_offsets and cookie values to test all the bpf_link_info::uprobe_multi fields. Acked-by: Song Liu <[email protected]> Signed-off-by: Jiri Olsa <[email protected]>
|
Upstream branch: 9241176 |
Adding support to display details for uprobe_multi links,
both plain:
# bpftool link -p
...
24: uprobe_multi prog 126
uprobe.multi path /home/jolsa/bpf/test_progs func_cnt 3 pid 4143
offset ref_ctr_offset cookies
0xd1f88 0xf5d5a8 0xdead
0xd1f8f 0xf5d5aa 0xbeef
0xd1f96 0xf5d5ac 0xcafe
and json:
# bpftool link -p
[{
...
},{
"id": 24,
"type": "uprobe_multi",
"prog_id": 126,
"retprobe": false,
"path": "/home/jolsa/bpf/test_progs",
"func_cnt": 3,
"pid": 4143,
"funcs": [{
"offset": 860040,
"ref_ctr_offset": 16111016,
"cookie": 57005
},{
"offset": 860047,
"ref_ctr_offset": 16111018,
"cookie": 48879
},{
"offset": 860054,
"ref_ctr_offset": 16111020,
"cookie": 51966
}
]
}
]
Acked-by: Song Liu <[email protected]>
Reviewed-by: Quentin Monnet <[email protected]>
Signed-off-by: Jiri Olsa <[email protected]>
8fb821c to
6fbda3d
Compare
Pull request for series with
subject: bpf: Add link_info support for uprobe multi link
version: 1
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=799882