[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aQmHfya8SYIcVGcg@google.com>
Date: Mon, 3 Nov 2025 20:56:31 -0800
From: Namhyung Kim <namhyung@...nel.org>
To: Ian Rogers <irogers@...gle.com>
Cc: Peter Zijlstra <peterz@...radead.org>, Ingo Molnar <mingo@...hat.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Jiri Olsa <jolsa@...nel.org>,
Adrian Hunter <adrian.hunter@...el.com>,
James Clark <james.clark@...aro.org>, Xu Yang <xu.yang_2@....com>,
Chun-Tse Shao <ctshao@...gle.com>,
Thomas Richter <tmricht@...ux.ibm.com>,
Sumanth Korikkar <sumanthk@...ux.ibm.com>,
Collin Funk <collin.funk1@...il.com>,
Thomas Falcon <thomas.falcon@...el.com>,
Howard Chu <howardchu95@...il.com>,
Dapeng Mi <dapeng1.mi@...ux.intel.com>,
Levi Yun <yeoreum.yun@....com>,
Yang Li <yang.lee@...ux.alibaba.com>, linux-kernel@...r.kernel.org,
linux-perf-users@...r.kernel.org
Subject: Re: [PATCH v1 07/22] perf expr: Add #target_cpu literal
On Fri, Oct 24, 2025 at 10:58:42AM -0700, Ian Rogers wrote:
> For CPU nanoseconds a lot of the stat-shadow metrics use either
> task-clock or cpu-clock, the latter being used when
> target__has_cpu. Add a #target_cpu literal so that json metrics can
> perform the same test.
Do we have documentation for the literals and metric expressions in
general? I think it's getting complex and we should provide one.
Thanks,
Namhyung
>
> Signed-off-by: Ian Rogers <irogers@...gle.com>
> ---
> tools/perf/util/expr.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/tools/perf/util/expr.c b/tools/perf/util/expr.c
> index 7fda0ff89c16..4df56f2b283d 100644
> --- a/tools/perf/util/expr.c
> +++ b/tools/perf/util/expr.c
> @@ -409,6 +409,9 @@ double expr__get_literal(const char *literal, const struct expr_scanner_ctx *ctx
> } else if (!strcmp("#core_wide", literal)) {
> result = core_wide(ctx->system_wide, ctx->user_requested_cpu_list)
> ? 1.0 : 0.0;
> + } else if (!strcmp("#target_cpu", literal)) {
> + result = (ctx->system_wide || ctx->user_requested_cpu_list)
> + ? 1.0 : 0.0;
> } else {
> pr_err("Unrecognized literal '%s'", literal);
> }
> --
> 2.51.1.821.gb6fe4d2222-goog
>
Powered by blists - more mailing lists