Skip to content
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

bpf: Add link_info support for uprobe multi link #5885

Closed

Conversation

kernel-patches-daemon-bpf[bot]
Copy link

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=796571

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 22360fa
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=796571
version: 1

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: c421c12
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=796571
version: 1

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 37db10b
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=796571
version: 1

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: f17a62f
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=796571
version: 1

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 399f618
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=796571
version: 1

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 3de07b9
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=796571
version: 1

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: ea41b88
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=796571
version: 1

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: ea41b88
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=796571
version: 1

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: ea41b88
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=796571
version: 1

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 6808918
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=796571
version: 1

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 6808918
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=796571
version: 1

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 6808918
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=796571
version: 1

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: f1c7339
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=796571
version: 1

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.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Acked-by: Song Liu <song@kernel.org>
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.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Acked-by: Song Liu <song@kernel.org>
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 <jolsa@kernel.org>
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.

Also we need to set the link NULL so the skeleton destroy
won't try to destroy them again.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Acked-by: Yafang Shao <laoar.shao@gmail.com>
Acked-by: Song Liu <song@kernel.org>
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.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Acked-by: Song Liu <song@kernel.org>
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 | jq
  [{
  ...
      },{
          "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
              }
          ]
      }
  ]

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Acked-by: Song Liu <song@kernel.org>
Reviewed-by: Quentin Monnet <quentin@isovalent.com>
@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: f2fbb90
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=796571
version: 1

@kernel-patches-daemon-bpf
Copy link
Author

At least one diff in series https://patchwork.kernel.org/project/netdevbpf/list/?series=796571 expired. Closing PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant