[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200608124531.819838-1-jean-philippe@linaro.org>
Date: Mon, 8 Jun 2020 14:45:32 +0200
From: Jean-Philippe Brucker <jean-philippe@...aro.org>
To: linux-kernel@...r.kernel.org, bpf@...r.kernel.org
Cc: mhiramat@...nel.org, rostedt@...dmis.org, mingo@...hat.com,
ast@...nel.org, daniel@...earbox.net, kafai@...com,
songliubraving@...com, yhs@...com, andriin@...com,
john.fastabend@...il.com, kpsingh@...omium.org,
Jean-Philippe Brucker <jean-philippe@...aro.org>
Subject: [PATCH] tracing/probe: Fix bpf_task_fd_query() for kprobes and uprobes
Commit 60d53e2c3b75 ("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: 60d53e2c3b75 ("tracing/probe: Split trace_event related data from trace_probe")
Signed-off-by: Jean-Philippe Brucker <jean-philippe@...aro.org>
---
Found while trying to run the task_fd_query BPF sample. I intend to try
and move that sample to kselftests since it seems like a useful
regression test.
---
kernel/trace/trace_kprobe.c | 2 +-
kernel/trace/trace_uprobe.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/kernel/trace/trace_kprobe.c b/kernel/trace/trace_kprobe.c
index 35989383ae113..8eeb95e04bf52 100644
--- a/kernel/trace/trace_kprobe.c
+++ b/kernel/trace/trace_kprobe.c
@@ -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;
diff --git a/kernel/trace/trace_uprobe.c b/kernel/trace/trace_uprobe.c
index 2a8e8e9c1c754..fdd47f99b18fd 100644
--- a/kernel/trace/trace_uprobe.c
+++ b/kernel/trace/trace_uprobe.c
@@ -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;
--
2.27.0
Powered by blists - more mailing lists