perf vendor events: Use more flexible pattern matching for CPU identification for...
authorWilliam Cohen <wcohen@redhat.com>
Mon, 4 Dec 2017 14:57:28 +0000 (09:57 -0500)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 5 Dec 2017 18:43:55 +0000 (15:43 -0300)
commitfbc2844e84038ce3687d203ac80b66194e9f21e6
treec249dd72fd51f175574177adce7ddafc4e7b824e
parent0125195268a0f9886b582c7e73da98f89029796f
perf vendor events: Use more flexible pattern matching for CPU identification for mapfile.csv

The powerpc cpuid information includes chip revision information.
Changes between chip revisions are usually minor bug fixes and usually
do not affect the operation of the performance monitoring hardware.

The original mapfile.csv matching requires enumerating every possible
cpuid string.  When a new minor chip revision is produced a new entry
has to be added to the mapfile.csv and the code recompiled to allow perf
to have the implementation specific perf events for this new minor
revision.  For users of various distibutions of Linux having to wait for
a new release of the kernel's perf tool to be built with these trivial
patches is inconvenient.

Using regular expressions rather than exactly string matching of the
entire cpuid string allows developers to write mapfile.csv files that do
not require patches and recompiles for each of these minor version
changes.  If special cases need to be made for some particular versions,
they can be placed earlier in the mapfile.csv file before the more
general matches.

Signed-off-by: William Cohen <wcohen@redhat.com>
Tested-by: Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Michael Petlan <mpetlan@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Shriya <shriyak@linux.vnet.ibm.com>
Link: http://lkml.kernel.org/r/20171204145728.16792-1-wcohen@redhat.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/pmu-events/arch/powerpc/mapfile.csv
tools/perf/pmu-events/arch/x86/mapfile.csv
tools/perf/pmu-events/jevents.c
tools/perf/util/pmu.c