Skip to content

Commit

Permalink
tools/power/turbostat: Improve probe_platform_features() logic
Browse files Browse the repository at this point in the history
AMD/Hygon platforms that don't have RAPL use 'amd_features' to describe
the platform features. Unknown Intel platforms use 'default_features' to
describe the platform features.

As none of the platform feature is set for 'amd_features' or
'default_features', there is no need to maintain both of them.

Remove 'amd_features' structure and improve the logic in
probe_platform_features().

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Reviewed-by: Len Brown <len.brown@intel.com>
  • Loading branch information
zhang-rui committed Sep 27, 2023
1 parent d085b3b commit 32e8c61
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions tools/power/x86/turbostat/turbostat.c
Original file line number Diff line number Diff line change
Expand Up @@ -767,9 +767,6 @@ static const struct platform_features knl_features = {
static const struct platform_features default_features = {
};

static const struct platform_features amd_features = {
};

static const struct platform_features amd_features_with_rapl = {
.rapl_msrs = RAPL_AMD_F17H,
.has_per_core_rapl = 1,
Expand Down Expand Up @@ -849,9 +846,9 @@ void probe_platform_features(unsigned int family, unsigned int model)
{
int i;

if (authentic_amd || hygon_genuine) {
platform = &amd_features;
platform = &default_features;

if (authentic_amd || hygon_genuine) {
if (max_extended_level >= 0x80000007) {
unsigned int eax, ebx, ecx, edx;

Expand All @@ -863,8 +860,6 @@ void probe_platform_features(unsigned int family, unsigned int model)
return;
}

platform = &default_features;

if (!genuine_intel || family != 6)
return;

Expand Down

0 comments on commit 32e8c61

Please sign in to comment.