Skip to content

Commit

Permalink
perf pmu-events: Don't lower case MetricExpr
Browse files Browse the repository at this point in the history
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 <[email protected]>
Cc: Alexander Shishkin <[email protected]>
Cc: Andi Kleen <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: John Garry <[email protected]>
Cc: Kajol Jain <[email protected]>
Cc: Kan Liang <[email protected]>
Cc: Mark Rutland <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Paul Clarke <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Stephane Eranian <[email protected]>
Link: http://lore.kernel.org/lkml/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
  • Loading branch information
captain5050 authored and acmel committed Jan 12, 2022
1 parent f56ef30 commit c0dd945
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 0 additions & 2 deletions tools/perf/pmu-events/jevents.c
Original file line number Diff line number Diff line change
Expand Up @@ -672,8 +672,6 @@ static int json_events(const char *fn,
addfield(map, &je.metric_constraint, "", "", val);
} else if (json_streq(map, field, "MetricExpr")) {
addfield(map, &je.metric_expr, "", "", val);
for (s = je.metric_expr; *s; s++)
*s = tolower(*s);
} else if (json_streq(map, field, "ArchStdEvent")) {
addfield(map, &arch_std, "", "", val);
for (s = arch_std; *s; s++)
Expand Down
2 changes: 1 addition & 1 deletion tools/perf/util/expr.c
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ double expr__get_literal(const char *literal)
static struct cpu_topology *topology;
double result = NAN;

if (!strcmp("#smt_on", literal)) {
if (!strcasecmp("#smt_on", literal)) {
result = smt_on() > 0 ? 1.0 : 0.0;
goto out;
}
Expand Down

0 comments on commit c0dd945

Please sign in to comment.