Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for AMD Zen 4 processors #65

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

sandip4n
Copy link

@sandip4n sandip4n commented Mar 6, 2024

Add support for AMD Genoa and Bergamo processors (EPYC 4th generation) based on the Zen 4 microarchitecture. The series includes discovery of AMD uncore PMUs, addition of platform-specific events and metrics, reporting of these metrics and some paltform-specific quirks.

Add capabilities for discovering uncore PMUs on modern AMD platforms
and filtering events accordingly. The prefix used in the PMU name is
"amd_" instead of "uncore_". The PMUs are also different.

Co-developed-by: Phaneeshwar M <[email protected]>
Signed-off-by: Sandipan Das <[email protected]>
Add initial support for collecting events on Zen 4 based AMD server SoCs
codenamed "Genoa" and "Bergamo". The events used are defined in the
"Guidance for Common Performance Statistics with Complex Event Selects"
and "Guidance for Pipeline Utilization Analysis Statistics" tables in
the Processor Programming Reference (PPR) for AMD Family 19h Model 11h,
Revision B1 processors.

Link: https://bugzilla.kernel.org/attachment.cgi?id=303986
Signed-off-by: Sandipan Das <[email protected]>
Add capabilities for filtering AMD uncore PMU events on the basis of the
mode in which data was collected.

Co-developed-by: Phaneeshwar M <[email protected]>
Signed-off-by: Sandipan Das <[email protected]>
Add initial support for generating metrics on Zen 4 based AMD server
SoCs codenamed "Genoa" and "Bergamo". The metrics used are defined in
the "Guidance for Common Performance Statistics with Complex Event
Selects" and "Guidance for Pipeline Utilization Analysis Statistics"
tables in the Processor Programming Reference (PPR) for AMD Family 19h
Model 11h, Revision B1 processors.

Link: https://bugzilla.kernel.org/attachment.cgi?id=303986
Signed-off-by: Sandipan Das <[email protected]>
The metrics used in the HTML report can vary on the basis of the
microarchitecture. The graphs can also be different. Hence, move
the current base html as it only caters to Intel processors in
preparation for adding support for processors from other vendors.

Signed-off-by: Sandipan Das <[email protected]>
Add initial support for showing charts and graphs which specifically
cater to Zen 4 based AMD server SoCs codenamed "Genoa" and "Bergamo".

Signed-off-by: Sandipan Das <[email protected]>
The event encoding format for Data Fabric (amd_df) events has changed in
Zen 4 processors such as Genoa and Bergamo. Even if an older kernel runs
on these processors, it might be programming the counters incorrectly
and this can lead to unexpected results. There is no easy way to detect
this using kernel versions as distro kernels, while using an older base,
may have backports of the upstream patches. Hence, use strict checks for
the event and umask formats that the kernel advertises for the device.

Signed-off-by: Sandipan Das <[email protected]>
On AMD platforms, uncore events will not be used in the following cases.

  * Running the tool inside a guest (VM).
  * Running the tool on bare-metal but without the "amd-uncore" driver.
  * Running the tool on bare-metal with the "amd-uncore" driver but it
    is found that the driver does not have the right level of support
    for the uncore PMUs specific to the processor.

For all these cases, the tool assumes that it is running inside a VM and
applies additional event filtering as seen in commit 9b62dfc ("limit
cycles filter to vm only (not in older kernels)"). This breaks grouping
if "cpu-cycles" is the last event in a group as such groups get merged
with the next group because the entire line, which contains both the
event and the group separator, is ignored.

As a result, some groups are too large, as in, they have more events
than the number of available hardware counters, and hence are invalid,
or as perf tool reports, "<not supported>", as they can never be
scheduled in.

For such groups, redefine the cpu-cycles event as "ls_not_halted_cyc",
its architectural alias, so that it does not get filtered out.

Signed-off-by: Sandipan Das <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant