]> git.baikalelectronics.ru Git - kernel.git/commitdiff
tracing/probe: Fix bpf_task_fd_query() for kprobes and uprobes
authorJean-Philippe Brucker <jean-philippe@linaro.org>
Mon, 8 Jun 2020 12:45:32 +0000 (14:45 +0200)
committerAlexei Starovoitov <ast@kernel.org>
Tue, 9 Jun 2020 18:10:12 +0000 (11:10 -0700)
Commit 11e5f011ef39 ("tracing/probe: Split trace_event related data from
trace_probe") removed the trace_[ku]probe structure from the
trace_event_call->data pointer. As bpf_get_[ku]probe_info() were
forgotten in that change, fix them now. These functions are currently
only used by the bpf_task_fd_query() syscall handler to collect
information about a perf event.

Fixes: 11e5f011ef39 ("tracing/probe: Split trace_event related data from trace_probe")
Signed-off-by: Jean-Philippe Brucker <jean-philippe@linaro.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Yonghong Song <yhs@fb.com>
Acked-by: Masami Hiramatsu <mhiramat@kernel.org>
Link: https://lore.kernel.org/bpf/20200608124531.819838-1-jean-philippe@linaro.org
kernel/trace/trace_kprobe.c
kernel/trace/trace_uprobe.c

index 35989383ae1131e11e45a39e0a5333a57f4493e0..8eeb95e04bf5211512c163673ce753e30ec23966 100644 (file)
@@ -1629,7 +1629,7 @@ int bpf_get_kprobe_info(const struct perf_event *event, u32 *fd_type,
        if (perf_type_tracepoint)
                tk = find_trace_kprobe(pevent, group);
        else
-               tk = event->tp_event->data;
+               tk = trace_kprobe_primary_from_call(event->tp_event);
        if (!tk)
                return -EINVAL;
 
index 2a8e8e9c1c7541fe9ed0f194da2ac07e899bf0c9..fdd47f99b18fdb640346dcdaf0a76f1e1d15d116 100644 (file)
@@ -1412,7 +1412,7 @@ int bpf_get_uprobe_info(const struct perf_event *event, u32 *fd_type,
        if (perf_type_tracepoint)
                tu = find_probe_event(pevent, group);
        else
-               tu = event->tp_event->data;
+               tu = trace_uprobe_primary_from_call(event->tp_event);
        if (!tu)
                return -EINVAL;