perf test: Avoid counting commas in json linter
authorIan Rogers <irogers@google.com>
Thu, 23 Feb 2023 07:18:18 +0000 (23:18 -0800)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Thu, 23 Feb 2023 13:31:28 +0000 (10:31 -0300)
commit3de34f85bf437e47556044191f0bd7d0eb644e21
tree6249ef9c21372fcf1cea821e08ea38f18f5fe50d
parentd3e104bb024e01a7da6af3b270a7b46054b74ac9
perf test: Avoid counting commas in json linter

Commas may appear in events like:

  cpu/INT_MISC.RECOVERY_CYCLES,cmask=1,edge/

which causes the count of commas to see more items than expected. Switch
to counting the entries in the dictionary, which is 1 more than the
number of commas.

Signed-off-by: Ian Rogers <irogers@google.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
Cc: Claire Jensen <cjense@google.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Sumanth Korikkar <sumanthk@linux.ibm.com>
Cc: Thomas Richter <tmricht@linux.ibm.com>
Link: https://lore.kernel.org/r/20230223071818.329671-2-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/tests/shell/lib/perf_json_output_lint.py