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

perf expr: Add #target_cpu literal



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.

Signed-off-by: default avatarIan Rogers <irogers@google.com>
Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
parent c8035a49
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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);
	}