[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20251118083510.GI3245006@noisy.programming.kicks-ass.net>
Date: Tue, 18 Nov 2025 09:35:10 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: Steven Rostedt <rostedt@...nel.org>
Cc: linux-kernel@...r.kernel.org, linux-trace-kernel@...r.kernel.org,
Masami Hiramatsu <mhiramat@...nel.org>,
Mark Rutland <mark.rutland@....com>,
Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Thomas Gleixner <tglx@...utronix.de>,
Ian Rogers <irogers@...gle.com>, Namhyung Kim <namhyung@...nel.org>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
Jiri Olsa <jolsa@...nel.org>,
Douglas Raillard <douglas.raillard@....com>
Subject: Re: [POC][RFC][PATCH 1/3] tracing: Add perf events
On Mon, Nov 17, 2025 at 07:29:51PM -0500, Steven Rostedt wrote:
> +u64 do_trace_perf_event(int type)
> +{
> + struct trace_perf_event __percpu **pevents;
> + struct trace_perf_event __percpu *events;
> + struct perf_event *e;
> + int *count;
> + int cpu;
> +
> + if (set_perf_type(type, NULL, NULL, &count, &pevents) < 0)
> + return 0;
> +
> + if (!*count)
> + return 0;
> +
> + guard(preempt)();
> +
> + events = READ_ONCE(*pevents);
> + if (!events)
> + return 0;
> +
> + cpu = smp_processor_id();
> +
> + e = per_cpu_ptr(events, cpu)->event;
> + if (!e)
> + return 0;
> +
> + e->pmu->read(e);
> + return local64_read(&e->count);
> +}
NAK, wtf do you think its okay to use internal stuff like that? And
wrongly while at it.
What you wanted to use was perf_event_read_local().
Powered by blists - more mailing lists