diff options
| author | Stephane Eranian <[email protected]> | 2015-01-13 22:59:53 +0000 |
|---|---|---|
| committer | Ingo Molnar <[email protected]> | 2015-01-16 08:06:58 +0000 |
| commit | 433678bdc6ed39f053c55da96b51de5bf0aeebb1 (patch) | |
| tree | 4f8d1cb9a64d8d4f6b8836099c40d666553ba592 /tools/perf/config/feature-checks/test-libpython-version.c | |
| parent | Merge branch 'thermal-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/r... (diff) | |
| download | kernel-433678bdc6ed39f053c55da96b51de5bf0aeebb1.tar.gz kernel-433678bdc6ed39f053c55da96b51de5bf0aeebb1.zip | |
perf/rapl: Fix sysfs_show() initialization for RAPL PMU
This patch fixes a problem with the initialization of the
sysfs_show() routine for the RAPL PMU.
The current code was wrongly relying on the EVENT_ATTR_STR()
macro which uses the events_sysfs_show() function in the x86
PMU code. That function itself was relying on the x86_pmu data
structure. Yet RAPL and the core PMU (x86_pmu) have nothing to
do with each other. They should therefore not interact with
each other.
The x86_pmu structure is initialized at boot time based on
the host CPU model. When the host CPU is not supported, the
x86_pmu remains uninitialized and some of the callbacks it
contains are NULL.
The false dependency with x86_pmu could potentially cause crashes
in case the x86_pmu is not initialized while the RAPL PMU is. This
may, for instance, be the case in virtualized environments.
This patch fixes the problem by using a private sysfs_show()
routine for exporting the RAPL PMU events.
Signed-off-by: Stephane Eranian <[email protected]>
Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
Link: http://lkml.kernel.org/r/20150113225953.GA21525@thinkpad
Cc: [email protected]
Cc: [email protected]
Cc: Arnaldo Carvalho de Melo <[email protected]>
Cc: Linus Torvalds <[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>
Diffstat (limited to 'tools/perf/config/feature-checks/test-libpython-version.c')
0 files changed, 0 insertions, 0 deletions
