diff mbox series

[1/4] tools/power turbostat: Exit on unsupported Intel models

Message ID 20241203075119.584419-2-rui.zhang@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Len Brown
Headers show
Series tools/power turbostat: Improve handling for unsupported platforms | expand

Commit Message

Zhang Rui Dec. 3, 2024, 7:51 a.m. UTC
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@intel.com>
---
 tools/power/x86/turbostat/turbostat.c | 7 +++++++
 1 file changed, 7 insertions(+)

Comments

Len Brown Dec. 3, 2024, 4:43 p.m. UTC | #1
On Tue, Dec 3, 2024 at 2:51 AM Zhang Rui <rui.zhang@intel.com> wrote:

> +               "\tTo get latest turbostat support, please contact\n" ...

"\t Please refer to turbostat(8) to find the latest version of turbostat.\n"


I'll create a patch to turbostat.8 to with clear instructions.

thanks!
-Len
diff mbox series

Patch

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@kernel.org\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 */