From 660cde12c743be673f1c4505800e65eecbff8b01 Mon Sep 17 00:00:00 2001 From: Xorg Date: Sat, 4 Mar 2017 19:04:17 +0100 Subject: [PATCH 1/2] cpuid_tool: fix multipliers format since 6ae7e344bec0e37dacd9589d4d87fd7cb4dd68ef --- cpuid_tool/cpuid_tool.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cpuid_tool/cpuid_tool.c b/cpuid_tool/cpuid_tool.c index bd64ce1..6717f1a 100644 --- a/cpuid_tool/cpuid_tool.c +++ b/cpuid_tool/cpuid_tool.c @@ -447,11 +447,11 @@ static void print_info(output_data_switch query, struct cpu_raw_data_t* raw, if ((value = cpu_msrinfo(handle, INFO_APERF)) != CPU_INVALID_VALUE) fprintf(fout, " MSR.aperf : %d MHz\n", value); if ((value = cpu_msrinfo(handle, INFO_MIN_MULTIPLIER)) != CPU_INVALID_VALUE) - fprintf(fout, " min. multi.: %d\n", value / 100.0); + fprintf(fout, " min. multi.: %.2lf\n", value / 100.0); if ((value = cpu_msrinfo(handle, INFO_CUR_MULTIPLIER)) != CPU_INVALID_VALUE) - fprintf(fout, " cur. multi.: %d\n", value / 100.0); + fprintf(fout, " cur. multi.: %.2lf\n", value / 100.0); if ((value = cpu_msrinfo(handle, INFO_MAX_MULTIPLIER)) != CPU_INVALID_VALUE) - fprintf(fout, " max. multi.: %d\n", value / 100.0); + fprintf(fout, " max. multi.: %.2lf\n", value / 100.0); if ((value = cpu_msrinfo(handle, INFO_TEMPERATURE)) != CPU_INVALID_VALUE) fprintf(fout, " temperature: %d degrees Celsius\n", value); if ((value = cpu_msrinfo(handle, INFO_THROTTLING)) != CPU_INVALID_VALUE) From 45158da967e59a4f3181f9221c965bfe20d614c0 Mon Sep 17 00:00:00 2001 From: Xorg Date: Sat, 4 Mar 2017 19:06:27 +0100 Subject: [PATCH 2/2] RDMSR: fix wrong values after using cpu_msr_driver_close() --- libcpuid/rdmsr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libcpuid/rdmsr.c b/libcpuid/rdmsr.c index ee8fec8..e204813 100644 --- a/libcpuid/rdmsr.c +++ b/libcpuid/rdmsr.c @@ -936,11 +936,11 @@ int cpu_msrinfo(struct msr_driver_t* handle, cpu_msrinfo_request_t which) return CPU_INVALID_VALUE; } + info.handle = handle; if (!init) { err = cpuid_get_raw_data(&raw); err += cpu_ident_internal(&raw, &id, &internal); info.cpu_clock = cpu_clock_measure(250, 1); - info.handle = handle; info.id = &id; info.internal = &internal; init = 1;