[SRU] change CONFIG_PERF_EVENTS_AMD_UNCORE from m to y

Bug #2033416 reported by Jeff Lane 
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Confirmed
Undecided
Unassigned
Mantic
Won't Fix
Undecided
Unassigned
Noble
Confirmed
Undecided
Unassigned

Bug Description

[Impact]
Ubuntu currently sets CONFIG_PERF_EVENTS_AMD_UNCORE=m for distro kernels.

However, unlike plug and play devices, there is no way to load uncore module when user tries to use uncore event.
Also, a primary motivation to add module support in uncore driver was to ease development (https://git.kernel.org/torvalds/c/05485745ad482).

Its not immediately apparent from perf tool output that the "amd-uncore" module is not loaded when opening "amd_df" or "amd_l3" events fail or when they do not show up in "perf list" despite using a compatible kernel. Since the primary motivation of the commit [1] that made it possible for this to be loaded as a module was to make development easier, CONFIG_PERF_EVENTS_AMD_UNCORE defaults to 'y' [2].

[1] https://git.kernel.org/torvalds/c/05485745ad482
[2] https://github.com/torvalds/linux/blob/master/arch/x86/events/Kconfig#L40

[Fix]

Change kernel config to CONFIG_PERF_EVENTS_AMD_UNCORE=y

[Test case]

(How can this change be tested/verified?)

[Where problems may occur]

(What side effects or regressions could this change create?)

Revision history for this message
Ubuntu Kernel Bot (ubuntu-kernel-bot) wrote : Missing required logs.

This bug is missing log files that will aid in diagnosing the problem. While running an Ubuntu kernel (not a mainline or third-party kernel) please enter the following command in a terminal window:

apport-collect 2033416

and then change the status of the bug to 'Confirmed'.

If, due to the nature of the issue you have encountered, you are unable to run this command, please add a comment stating that fact and change the bug status to 'Confirmed'.

This change has been made by an automated script, maintained by the Ubuntu Kernel Team.

Changed in linux (Ubuntu):
status: New → Incomplete
Revision history for this message
Jeff Lane  (bladernr) wrote : Re: change CONFIG_PERF_EVENTS_AMD_UNCORE from m to y

Logs not needed for this, it's a feature request for Mantic

Changed in linux (Ubuntu):
status: Incomplete → New
status: New → Confirmed
Revision history for this message
Zixian Cai (caizixian) wrote :

Yes, perf events are often used in performance analysis. Without loading the module, uncore events, such as `amd_l3`, are missing from perf list.

Revision history for this message
Sandipan Das (sandipan-amd) wrote :

Its not immediately apparent from perf tool output that the "amd-uncore" module is not loaded when opening "amd_df" or "amd_l3" events fail or when they do not show up in "perf list" despite using a compatible kernel. Since the primary motivation of the commit [1] that made it possible for this to be loaded as a module was to make development easier, CONFIG_PERF_EVENTS_AMD_UNCORE defaults to 'y' [2].

[1] https://git.kernel.org/torvalds/c/05485745ad482
[2] https://github.com/torvalds/linux/blob/master/arch/x86/events/Kconfig#L40

Jeff Lane  (bladernr)
summary: - change CONFIG_PERF_EVENTS_AMD_UNCORE from m to y
+ [SRU] change CONFIG_PERF_EVENTS_AMD_UNCORE from m to y
Changed in linux (Ubuntu Mantic):
status: New → Confirmed
description: updated
Revision history for this message
Sandipan Das (sandipan-amd) wrote (last edit ):

The following are some basic tests to compare results on a system before and after this change. For existing kernels built with CONFIG_PERF_EVENTS_AMD_UNCORE=m, the following will fail unless the "amd_uncore" module is loaded. For new kernels built with CONFIG_PERF_EVENTS_AMD_UNCORE=y, the following should pass without having to load a module.

1. The following sysfs directories will be present.
/sys/bus/event_source/devices/amd_l3
/sys/bus/event_source/devices/amd_df

2. Opening events on the L3 and DF PMUs should not return any errors.
sudo perf stat -e amd_l3// -a true
sudo perf stat -e amd_df// -a true

3. There are several named events and metrics in perf tool which use amd_l3 and amd_df events. To test if these are working after this change, one can run some tests from the built-in test suite. The tests of importance are

101: perf stat tests
102: perf all metricgroups test
103: perf all metrics test
104: perf all PMU test

Please note that the test numbering can vary but can be found by running "perf test list". Once the test numbers are known, they can be run individually as shown below. It is preferable to run these tests in verbose mode in order to get more information in case of a failure.

$ sudo perf test -v 101

I don't expect any side-effects since there are no functional changes in terms of how the uncore PMU events are handled.

Revision history for this message
Brian Murray (brian-murray) wrote :

Ubuntu 23.10 (Mantic Minotaur) has reached end of life, so this bug will not be fixed for that specific release.

Changed in linux (Ubuntu Mantic):
status: Confirmed → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.