summaryrefslogtreecommitdiff
path: root/include/uapi/linux
diff options
context:
space:
mode:
authorMartin KaFai Lau <martin.lau@kernel.org>2023-08-08 02:42:58 +0300
committerMartin KaFai Lau <martin.lau@kernel.org>2023-08-08 02:43:01 +0300
commiteb62e6aef940fcb1879100130068369d4638088f (patch)
tree1d59328a23a48b50a2714419b04a96f092cfae21 /include/uapi/linux
parenta5c0a42bd3746091777642d0588102a3a42ac031 (diff)
parent7febf573a58b55170782985c031dfaf805662297 (diff)
downloadlinux-eb62e6aef940fcb1879100130068369d4638088f.tar.xz
Merge branch 'bpf: Support bpf_get_func_ip helper in uprobes'
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>
Diffstat (limited to 'include/uapi/linux')
-rw-r--r--include/uapi/linux/bpf.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h
index 70da85200695..d21deb46f49f 100644
--- a/include/uapi/linux/bpf.h
+++ b/include/uapi/linux/bpf.h
@@ -5086,9 +5086,14 @@ union bpf_attr {
* u64 bpf_get_func_ip(void *ctx)
* Description
* Get address of the traced function (for tracing and kprobe programs).
+ *
+ * When called for kprobe program attached as uprobe it returns
+ * probe address for both entry and return uprobe.
+ *
* Return
- * Address of the traced function.
+ * Address of the traced function for kprobe.
* 0 for kprobes placed within the function (not at the entry).
+ * Address of the probe for uprobe and return uprobe.
*
* u64 bpf_get_attach_cookie(void *ctx)
* Description