[PATCH 1/4] tools/power turbostat: Exit on unsupported Intel models
From: Zhang Rui
Date: Tue Dec 03 2024 - 02:51:31 EST
Turbostat requires per-platform enabling for Intel CPU models due to
platform-specific features. When running on unsupported Intel CPU
models, turbostat currently operates with limited default features,
which can lead to users unknowingly using an outdated version of the
tool.
Enhance turbostat to exit by default when run on unsupported Intel CPU
models, with a clear message to users, informing them that their CPU
model is not supported and advising them to update to the latest version
of turbostat for full functionality.
Signed-off-by: Zhang Rui <rui.zhang@xxxxxxxxx>
---
tools/power/x86/turbostat/turbostat.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/tools/power/x86/turbostat/turbostat.c b/tools/power/x86/turbostat/turbostat.c
index e203f109dd2e..bb65c5e1273c 100644
--- a/tools/power/x86/turbostat/turbostat.c
+++ b/tools/power/x86/turbostat/turbostat.c
@@ -1079,6 +1079,13 @@ void probe_platform_features(unsigned int family, unsigned int model)
return;
}
}
+
+ fprintf(stderr, "Unsupported platform detected.\n"
+ "\tTo get latest turbostat support, please contact\n"
+ "\t lenb@xxxxxxxxxx\n"
+ "\tor pull from\n"
+ "\t https://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux.git turbostat\n");
+ exit(1);
}
/* Model specific support End */
--
2.43.0