Commit b4c658d4 authored by Ian Rogers's avatar Ian Rogers Committed by Namhyung Kim
Browse files

perf target: Remove uid from target



Gathering threads with a uid by scanning /proc is inherently racy
leading to perf_event_open failures that quit perf. All users of the
functionality now use BPF filters, so remove uid and uid_str from
target.

Signed-off-by: default avatarIan Rogers <irogers@google.com>
Link: https://lore.kernel.org/r/20250604174545.2853620-10-irogers@google.com


Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
parent 278538dd
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -1663,7 +1663,6 @@ int cmd_ftrace(int argc, const char **argv)
	int (*cmd_func)(struct perf_ftrace *) = NULL;
	struct perf_ftrace ftrace = {
		.tracer = DEFAULT_TRACER,
		.target = { .uid = UINT_MAX, },
	};
	const struct option common_options[] = {
	OPT_STRING('p', "pid", &ftrace.target.pid, "pid",
+0 −2
Original line number Diff line number Diff line
@@ -1871,8 +1871,6 @@ static int kvm_events_live(struct perf_kvm_stat *kvm,
	kvm->opts.user_interval = 1;
	kvm->opts.mmap_pages = 512;
	kvm->opts.target.uses_mmap = false;
	kvm->opts.target.uid_str = NULL;
	kvm->opts.target.uid = UINT_MAX;

	symbol__init(NULL);
	disable_buildid_cache();
+1 −3
Original line number Diff line number Diff line
@@ -108,9 +108,7 @@ static struct parse_events_option_args parse_events_option_args = {

static bool all_counters_use_bpf = true;

static struct target target = {
	.uid	= UINT_MAX,
};
static struct target target;

static volatile sig_atomic_t	child_pid			= -1;
static int			detailed_run			=  0;
+0 −1
Original line number Diff line number Diff line
@@ -5399,7 +5399,6 @@ int cmd_trace(int argc, const char **argv)
	struct trace trace = {
		.opts = {
			.target = {
				.uid	   = UINT_MAX,
				.uses_mmap = true,
			},
			.user_freq     = UINT_MAX,
+0 −1
Original line number Diff line number Diff line
@@ -91,7 +91,6 @@ static int test__backward_ring_buffer(struct test_suite *test __maybe_unused, in
	struct parse_events_error parse_error;
	struct record_opts opts = {
		.target = {
			.uid = UINT_MAX,
			.uses_mmap = true,
		},
		.freq	      = 0,
Loading