From 9da779c324db87ca340e0eb1259c949874f17bed Mon Sep 17 00:00:00 2001 From: Prarit Bhargava Date: Wed, 25 Oct 2017 09:51:32 -0400 Subject: cpupower: Fix no-rounding MHz frequency output 'cpupower frequency-info -ln' returns kHz values on systems with MHz range minimum CPU frequency range. For example, on a 800MHz to 4.20GHz system the command returns hardware limits: 800000 MHz - 4.200000 GHz The code that causes this error can be removed. The next else if clause will handle the output correctly such that hardware limits: 800.000 MHz - 4.200000 GHz is displayed correctly. [v2]: Remove two lines instead of fixing broken code. Signed-off-by: Prarit Bhargava Cc: Thomas Renninger Cc: Stafford Horne Cc: Shuah Khan Reviewed-by: Stafford Horne Signed-off-by: Shuah Khan --- tools/power/cpupower/utils/cpufreq-info.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'tools') diff --git a/tools/power/cpupower/utils/cpufreq-info.c b/tools/power/cpupower/utils/cpufreq-info.c index 3e701f0e9c14..df43cd45d810 100644 --- a/tools/power/cpupower/utils/cpufreq-info.c +++ b/tools/power/cpupower/utils/cpufreq-info.c @@ -93,8 +93,6 @@ static void print_speed(unsigned long speed) if (speed > 1000000) printf("%u.%06u GHz", ((unsigned int) speed/1000000), ((unsigned int) speed%1000000)); - else if (speed > 100000) - printf("%u MHz", (unsigned int) speed); else if (speed > 1000) printf("%u.%03u MHz", ((unsigned int) speed/1000), (unsigned int) (speed%1000)); -- cgit v1.2.3-58-ga151 From d4dbfa4bb4c624636eeef9efc6d87c4b7bf2c611 Mon Sep 17 00:00:00 2001 From: Prarit Bhargava Date: Wed, 1 Nov 2017 20:48:17 -0400 Subject: tools/power/cpupower: Add 64 bit library detection The kernel-tools-lib rpm is installing the library to /usr/lib64, and not /usr/lib as the cpupower Makefile is doing in the kernel tree. This resulted in a conflict between the two libraries. After looking at how other tools installed libraries, and looking at the perf code in tools/perf it looks like installing to /usr/lib64 for 64-bit arches is the correct thing to do. Checks with 'ldd cpupower' on SLES, RHEL, Fedora, and Ubuntu result in the correct binary AFAICT: [root@testsystem cpupower]# ldd cpupower | grep cpupower libcpupower.so.0 => /lib64/libcpupower.so.0 (0x00007f1dab447000) Commit ac5a181d065d ("cpupower: Add cpuidle parts into library") added a new cpupower library version. On Fedora, executing the cpupower binary then resulted in this error [root@testsystem cpupower]# ./cpupower monitor ./cpupower: symbol lookup error: ./cpupower: undefined symbol: get_cpu_topology 64-bit libraries should be installed to /usr/lib64, and other libraries should be installed to /usr/lib. This code was taken from the perf Makefile.config which supports /usr/lib and /usr/lib64. Signed-off-by: Prarit Bhargava Cc: Shuah Khan Signed-off-by: Shuah Khan --- tools/power/cpupower/Makefile | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tools') diff --git a/tools/power/cpupower/Makefile b/tools/power/cpupower/Makefile index d6e1c02ddcfe..da205d1fa03c 100644 --- a/tools/power/cpupower/Makefile +++ b/tools/power/cpupower/Makefile @@ -30,6 +30,8 @@ OUTDIR := $(shell cd $(OUTPUT) && /bin/pwd) $(if $(OUTDIR),, $(error output directory "$(OUTPUT)" does not exist)) endif +include ../../scripts/Makefile.arch + # --- CONFIGURATION BEGIN --- # Set the following to `true' to make a unstripped, unoptimized @@ -79,7 +81,11 @@ bindir ?= /usr/bin sbindir ?= /usr/sbin mandir ?= /usr/man includedir ?= /usr/include +ifeq ($(IS_64_BIT), 1) +libdir ?= /usr/lib64 +else libdir ?= /usr/lib +endif localedir ?= /usr/share/locale docdir ?= /usr/share/doc/packages/cpupower confdir ?= /etc/ -- cgit v1.2.3-58-ga151 From 69b6f8a9b7961efd7dcc11ab9b1d5be55ed8a15e Mon Sep 17 00:00:00 2001 From: Prarit Bhargava Date: Wed, 1 Nov 2017 20:48:32 -0400 Subject: tools/power/cpupower: add libcpupower.so.0.0.1 to .gitignore Commit ac5a181d065d ("cpupower: Add cpuidle parts into library") added libcpupower.so.0.0.1 which should be hidden from git commands. This patch changes the ignore to all libcpupower.so.* . Signed-off-by: Prarit Bhargava Cc: Shuah Khan Signed-off-by: Shuah Khan --- tools/power/cpupower/.gitignore | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'tools') diff --git a/tools/power/cpupower/.gitignore b/tools/power/cpupower/.gitignore index d42073f12609..1f9977cc609c 100644 --- a/tools/power/cpupower/.gitignore +++ b/tools/power/cpupower/.gitignore @@ -1,7 +1,6 @@ .libs libcpupower.so -libcpupower.so.0 -libcpupower.so.0.0.0 +libcpupower.so.* build/ccdv cpufreq-info cpufreq-set -- cgit v1.2.3-58-ga151