NMI (Perf Event) and some
softirq context, the helper returns the correct result.
Signed-off-by: Teng Qin
---
kernel/trace/bpf_trace.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/kernel/trace/bpf_trace.c b/kernel/trace/bpf_trace.c
index 56ba0f2..f94890c 100644
--- a/kernel/trace
Currently, the bpf_current_task_under_cgroup helper has a check where if
the BPF program is running in_interrupt(), it will return -EINVAL. This
prevents the helper to be used in many useful scenarios, particularly
BPF programs attached to Perf Events.
This commit removes the check. Tested a few N
memory access or
lock acquire pattern.
Teng Qin (2):
bpf: add support to read sample address in bpf program
samples/bpf: add example to test reading address
include/uapi/linux/bpf_perf_event.h | 1 +
kernel/trace/bpf_trace.c| 20
samples/bpf
en calling perf_event_open.
Signed-off-by: Teng Qin
---
include/uapi/linux/bpf_perf_event.h | 1 +
kernel/trace/bpf_trace.c| 20
2 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/include/uapi/linux/bpf_perf_event.h
b/include/uapi/linux/bpf_perf_eve
This commit adds additional test in the trace_event example, by
attaching the bpf program to MEM_UOPS_RETIRED.LOCK_LOADS event with
PERF_SAMPLE_ADDR requested, and print the lock address value read from
the bpf program to trace_pipe.
Signed-off-by: Teng Qin
---
samples/bpf/trace_event_kern.c
On 5/22/17, 20:08, "David Miller" wrote:
From: Teng Qin
Date: Tue, 23 May 2017 00:39:34 +
> diff --git a/samples/bpf/bpf_helpers.h b/samples/bpf/bpf_helpers.h
> index 9a9c95f..a94ce42 100644
> --- a/samples/bpf/bpf_helpers.h
> +++ b/sam
From: Teng Qin
This commit updates function signature of the bpf_perf_event_output and
bpf_perf_event_read helpers to match their implementation. Also updates
their documentation in the header files.
Signed-off-by: Teng Qin
Acked-by: Alexei Starovoitov
---
include/uapi/linux/bpf.h | 11