[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240807153843.3231451-2-howardchu95@gmail.com>
Date: Wed, 7 Aug 2024 23:38:35 +0800
From: Howard Chu <howardchu95@...il.com>
To: namhyung@...nel.org
Cc: irogers@...gle.com,
acme@...nel.org,
adrian.hunter@...el.com,
jolsa@...nel.org,
kan.liang@...ux.intel.com,
linux-perf-users@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH v4 1/9] perf evsel: Set BPF output to system-wide
pid = -1 for bpf-output event.
This makes perf record -p <PID> --off-cpu work. Otherwise bpf-output
cannot be collected.
Signed-off-by: Howard Chu <howardchu95@...il.com>
---
tools/perf/util/evsel.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index bc603193c477..b961467133cf 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -2282,6 +2282,10 @@ static int evsel__open_cpu(struct evsel *evsel, struct perf_cpu_map *cpus,
test_attr__ready();
+ /* BPF output event can only be system-wide */
+ if (evsel__is_bpf_output(evsel))
+ pid = -1;
+
/* Debug message used by test scripts */
pr_debug2_peo("sys_perf_event_open: pid %d cpu %d group_fd %d flags %#lx",
pid, perf_cpu_map__cpu(cpus, idx).cpu, group_fd, evsel->open_flags);
--
2.45.2
Powered by blists - more mailing lists