Skip to content

Commit c0dd945

Browse files
captain5050acmel
authored andcommitted
perf pmu-events: Don't lower case MetricExpr
This patch changes MetricExpr to be written out in the same case. This enables events in metrics to use modifiers like 'G' which currently yield parse errors when made lower case. To keep tests passing the literal #smt_on is compared in a non-case sensitive way - #SMT_on is present in at least SkylakeX metrics. Signed-off-by: Ian Rogers <irogers@google.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: John Garry <john.garry@huawei.com> Cc: Kajol Jain <kjain@linux.ibm.com> Cc: Kan Liang <kan.liang@linux.intel.com> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Paul Clarke <pc@us.ibm.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lore.kernel.org/lkml/20211126071305.3733878-1-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
1 parent f56ef30 commit c0dd945

2 files changed

Lines changed: 1 addition & 3 deletions

File tree

tools/perf/pmu-events/jevents.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -672,8 +672,6 @@ static int json_events(const char *fn,
672672
addfield(map, &je.metric_constraint, "", "", val);
673673
} else if (json_streq(map, field, "MetricExpr")) {
674674
addfield(map, &je.metric_expr, "", "", val);
675-
for (s = je.metric_expr; *s; s++)
676-
*s = tolower(*s);
677675
} else if (json_streq(map, field, "ArchStdEvent")) {
678676
addfield(map, &arch_std, "", "", val);
679677
for (s = arch_std; *s; s++)

tools/perf/util/expr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ double expr__get_literal(const char *literal)
407407
static struct cpu_topology *topology;
408408
double result = NAN;
409409

410-
if (!strcmp("#smt_on", literal)) {
410+
if (!strcasecmp("#smt_on", literal)) {
411411
result = smt_on() > 0 ? 1.0 : 0.0;
412412
goto out;
413413
}

0 commit comments

Comments
 (0)