perf jevents: Add test for arch std events
authorJohn Garry <john.garry@huawei.com>
Thu, 22 Oct 2020 11:02:27 +0000 (19:02 +0800)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 4 Nov 2020 12:42:41 +0000 (09:42 -0300)
commit644bf4b0f7acde641d3db200b4db66977e96c3bd
tree62c1d04ca3469a8c7989bb374d7e4eb3cd6747eb
parentfa1b41a74d1136cbdd6960f36d7b9c7aa35c8139
perf jevents: Add test for arch std events

Recently there was an undetected breakage for std arch event support.

Add support in "PMU events" testcase to detect such breakages.

For this, the "test" arch needs has support added to process std arch
events. And a test event is added for the test, ifself.

Also add a few code comments to help understand the code a bit better.

Committer testing:

Before:

  # perf test -vv pmu  |& grep l3_cache_rd
  #

After:

  # perf test -vv pmu  |& grep l3_cache_rd
  testing event table l3_cache_rd: pass
  testing aliases PMU cpu: matched event l3_cache_rd
  #

Signed-off-by: John Garry <john.garry@huawei.com>
Reviewed-By: Kajol Jain<kjain@linux.ibm.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Link: https://lore.kernel.org/r/1603364547-197086-3-git-send-email-john.garry@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/pmu-events/arch/test/arch-std-events.json [new file with mode: 0644]
tools/perf/pmu-events/arch/test/test_cpu/cache.json [new file with mode: 0644]
tools/perf/pmu-events/jevents.c
tools/perf/tests/pmu-events.c