Merge branch 'bpf: Support bpf_get_func_ip helper in uprobes'
authorMartin KaFai Lau <martin.lau@kernel.org>
Mon, 7 Aug 2023 23:42:58 +0000 (16:42 -0700)
committerMartin KaFai Lau <martin.lau@kernel.org>
Mon, 7 Aug 2023 23:43:01 +0000 (16:43 -0700)
Jiri Olsa says:

====================
adding support for bpf_get_func_ip helper for uprobe program to return
probed address for both uprobe and return uprobe as suggested by Andrii
in [1].

We agreed that uprobe can have special use of bpf_get_func_ip helper
that differs from kprobe.

The kprobe bpf_get_func_ip returns:
  - address of the function if probe is attach on function entry
    for both kprobe and return kprobe
  - 0 if the probe is not attach on function entry

The uprobe bpf_get_func_ip returns:
  - address of the probe for both uprobe and return uprobe

The reason for this semantic change is that kernel can't really tell
if the probe user space address is function entry.

v3 changes:
  - removed bpf_get_func_ip_uprobe helper function [Yonghong]

Also available at:
  https://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git
  uprobe_get_func_ip

[1] https://lore.kernel.org/bpf/CAEf4BzZ=xLVkG5eurEuvLU79wAMtwho7ReR+XJAgwhFF4M-7Cg@mail.gmail.com/
====================

Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>

Trivial merge