bcc/tools: Introduce bpf_probe_read_user to the tools.
This is essential for architecture which do have overlapping address space.
- bpf_probe_read_kernel() shall be used for reading data from kernel space
to the bpf vm.
- bpf_probe_read_user() shall be used for reading data from user space
to the bpf vm.
Signed-off-by: Sumanth Korikkar <sumanthk@linux.ibm.com>
diff --git a/tools/lib/ucalls.py b/tools/lib/ucalls.py
index 307df25..396d56e 100755
--- a/tools/lib/ucalls.py
+++ b/tools/lib/ucalls.py
@@ -158,9 +158,9 @@
#endif
READ_CLASS
READ_METHOD
- bpf_probe_read(&data.method.clazz, sizeof(data.method.clazz),
+ bpf_probe_read_user(&data.method.clazz, sizeof(data.method.clazz),
(void *)clazz);
- bpf_probe_read(&data.method.method, sizeof(data.method.method),
+ bpf_probe_read_user(&data.method.method, sizeof(data.method.method),
(void *)method);
#ifndef LATENCY
valp = counts.lookup_or_try_init(&data.method, &val);
@@ -182,9 +182,9 @@
data.pid = bpf_get_current_pid_tgid();
READ_CLASS
READ_METHOD
- bpf_probe_read(&data.method.clazz, sizeof(data.method.clazz),
+ bpf_probe_read_user(&data.method.clazz, sizeof(data.method.clazz),
(void *)clazz);
- bpf_probe_read(&data.method.method, sizeof(data.method.method),
+ bpf_probe_read_user(&data.method.method, sizeof(data.method.method),
(void *)method);
entry_timestamp = entry.lookup(&data);
if (!entry_timestamp) {