Skip to contentSkip to conversation

Rename cpufrequtils into cpupowerutils and provide some basic cpuidle functionality

PATCH New Thomas Renninger 2 participants 13 messages Sep 23, 2010 – Oct 2, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hi Dominik,

here my latest patchset.
If this isn't totally wrong, I'd appreciate if you could push these already (into a separate branch for now?) and I can provide on-top patches/fix-ups.

I do not want to pollute other lists for now.
If you accept this and I did some further testing, packaging, cleanup, etc., I'd like to announce this work on some more lists (lesswatts, linux-pm, acpi, ...).

Thanks a lot,

Thomas

#1 lore raw

PATCH 1/4 cpufrequtils: Prepare for non-cpufreq related power features by renaming files

aperf.c -> cpufreq-aperf.c
info.c -> cpufreq-info.c
set.c -> cpufreq-set.c

Creating UTIL_BINS variable in the Makefile seem to have the effect that all util binaries are rebuild, even if only one got modified.
This still was the nicest way I found, could get cleaned up by someone who is more familiar with Makefiles than I am.

---
 Makefile              |   17 +-
 utils/aperf.c         |  431 ---------------------------------
 utils/cpufreq-aperf.c |  431 +++++++++++++++++++++++++++++++++
 utils/cpufreq-info.c  |  629 +++++++++++++++++++++++++++++++++++++++++++++++++
 utils/cpufreq-set.c   |  375 +++++++++++++++++++++++++++++
 utils/info.c          |  629 -------------------------------------------------
 utils/set.c           |  375 -----------------------------
 7 files changed, 1443 insertions(+), 1444 deletions(-)
 delete mode 100644 utils/aperf.c
 create mode 100644 utils/cpufreq-aperf.c
 create mode 100644 utils/cpufreq-info.c
 create mode 100644 utils/cpufreq-set.c
 delete mode 100644 utils/info.c
 delete mode 100644 utils/set.c
Makefile +8 -9
index e23c644..aa4b9ff 100644
@@ -111,7 +111,8 @@ WARNINGS += -Wshadow
 CPPFLAGS += -DVERSION=\"$(VERSION)\" -DPACKAGE=\"$(PACKAGE)\" \
 		-DPACKAGE_BUGREPORT=\"$(PACKAGE_BUGREPORT)\" -D_GNU_SOURCE
 
-UTIL_SRC = 	utils/info.c utils/set.c utils/aperf.c utils/cpuid.h
+UTIL_SRC = 	utils/cpufreq-info.c utils/cpufreq-set.c utils/cpufreq-aperf.c utils/cpuid.h
+UTIL_BINS = 	utils/cpufreq-info utils/cpufreq-set utils/cpufreq-aperf
 LIB_HEADERS = 	lib/cpufreq.h lib/sysfs.h
 LIB_SRC = 	lib/cpufreq.c lib/sysfs.c
 LIB_OBJS = 	lib/cpufreq.o lib/sysfs.o
@@ -171,12 +172,12 @@ libcpufreq.so.$(LIB_MAJ): $(LIB_OBJS)
 
 libcpufreq: libcpufreq.so.$(LIB_MAJ)
 
-cpufreq-%: libcpufreq.so.$(LIB_MAJ) $(UTIL_SRC)
-	$(QUIET) $(CC) $(CPPFLAGS) $(CFLAGS) -I. -I./lib/ -c -o utils/[email protected] utils/$*.c
-	$(QUIET) $(CC) $(CFLAGS) $(LDFLAGS) -L. -o $@ utils/[email protected] -lcpufreq
+$(UTIL_BINS): libcpufreq.so.$(LIB_MAJ) $(UTIL_SRC)
+	$(QUIET) $(CC) $(CPPFLAGS) $(CFLAGS) -I. -I./lib/ -c [email protected] -o [email protected]
+	$(QUIET) $(CC) $(CFLAGS) $(LDFLAGS) -L. -o $@ [email protected] -lcpufreq
 	$(QUIET) $(STRIPCMD) $@
 
-utils: cpufreq-info cpufreq-set cpufreq-aperf
+utils: $(UTIL_BINS)
 
 po/$(PACKAGE).pot: $(UTIL_SRC)
 	@xgettext --default-domain=$(PACKAGE) --add-comments \
@@ -203,7 +204,7 @@ compile-bench: libcpufreq
 clean:
 	-find . \( -not -type d \) -and \( -name '*~' -o -name '*.[oas]' \) -type f -print \
 	 | xargs rm -f
-	-rm -f cpufreq-info cpufreq-set cpufreq-aperf
+	-rm -f $(UTIL_BINS)
 	-rm -f libcpufreq.so*
 	-rm -f build/ccdv
 	-rm -rf po/*.gmo po/*.pot
@@ -218,9 +219,7 @@ install-lib:
 
 install-tools:
 	$(INSTALL) -d $(DESTDIR)${bindir}
-	$(INSTALL_PROGRAM) cpufreq-set $(DESTDIR)${bindir}/cpufreq-set
-	$(INSTALL_PROGRAM) cpufreq-info $(DESTDIR)${bindir}/cpufreq-info
-	$(INSTALL_PROGRAM) cpufreq-aperf $(DESTDIR)${bindir}/cpufreq-aperf
+	$(INSTALL_PROGRAM) $(UTIL_BINS) $(DESTDIR)${bindir}
 
 install-man:
 	$(INSTALL_DATA) -D man/cpufreq-set.1 $(DESTDIR)${mandir}/man1/cpufreq-set.1
utils/aperf.c deleted +0 -431

431 lines not on this page · raw message

utils/cpufreq-aperf.c new file +431 -0

431 lines not on this page · raw message

utils/cpufreq-info.c new file +629 -0

629 lines not on this page · raw message

utils/cpufreq-set.c new file +375 -0

375 lines not on this page · raw message

utils/info.c deleted +0 -629

629 lines not on this page · raw message

utils/set.c deleted +0 -375

375 lines not on this page · raw message

Signature · 1 line
1.6.4.2
#2 lore raw

PATCH 2/4 cpufrequtils: Add cpuidle-info tool with some cstate library functions

In reply to Thomas Renninger

lib/cpuidle.c is doing it very similar to lib/cpufreq.c Most info is retrieved from:
/sys/devices/system/cpu/cpu0/cpuidle/state* /sys/devices/system/cpu/cpuidle/*

The output is not meant to be fixed yet, but should be at some point. Please provide suggestions how this could get enhanced!

default cpuidle-info reports:

--------------------------------

#> ./utils/cpuidle-info --silent -c0
CPUidle driver: acpi_idle
CPUidle governor: menu
Analyzing CPU 0:
Cstates: 4
Available C-states: C1 C2 C3

--------------------------------

#> /utils/cpuidle-info -c0
CPUidle driver: acpi_idle
CPUidle governor: menu
Analyzing CPU 0:
Cstates: 4
Available C-states: C1 C2 C3
C1:
Flags/Description: ACPI FFH INTEL MWAIT 0x0
Latency: 1
Usage: 366131
Duration: 379777661
C2:
Flags/Description: ACPI FFH INTEL MWAIT 0x10
Latency: 64
Usage: 1050392
Duration: 667633395
C3:
Flags/Description: ACPI FFH INTEL MWAIT 0x20
Latency: 96
Usage: 57846995
Duration: 868424861184

--------------------------------

#> ./utils/cpuidle-info --proc -c0

active state:            C0
max_cstate:              C3
maximum allowed latency: 2000000000 usec
states:
    C1:                  type[C1] promotion[--] demotion[--] latency[001] usage[00366132] duration[00000000000379777813]
    C2:                  type[C2] promotion[--] demotion[--] latency[064] usage[01050393] duration[00000000000667633592]
    C3:                  type[C3] promotion[--] demotion[--] latency[096] usage[57848625] duration[00000000868446911164]

--------------------------------

Notes to --proc compatible output:
active state is hardcoded to be C0 -> proc also always reports zero.

Same for promotion/demotion, it's also hardcoded in the kernel for some time and returns zero info: [--]

max_cstate provides some sane info, instead of always C8 (proc).

maximum allowed latency is hardcoded, but it may make sense that cpuidle exports this to userspace, cpuidle at least still uses the qos interface for its decisions.

type which should differ ACPI exported and real C-state type is hardcoded for now.

latency, usage and duration are retrieved from cpuidle.
Strange is that latency is the same, usage is the same, but the duration is a rather different value when retrieved through cpuidle. /proc seem to be broken, I could even get negativ values there. So better use cpuidle-info -o instead reading out /proc/acpi/processor/*/power.

---
 Makefile             |   13 +-
 lib/cpufreq.c        |   26 ++--
 lib/cpuidle.c        |   59 +++++++
 lib/cpuidle.h        |   32 ++++
 lib/sysfs.c          |  440 +++++++++++++++++++++++++++++++++++++++++---------
 lib/sysfs.h          |   42 ++++--
 utils/cpuidle-info.c |  305 ++++++++++++++++++++++++++++++++++
 7 files changed, 805 insertions(+), 112 deletions(-)
 create mode 100644 lib/cpuidle.c
 create mode 100644 lib/cpuidle.h
 create mode 100644 utils/cpuidle-info.c
Makefile +6 -7
index aa4b9ff..07637ed 100644
@@ -111,11 +111,11 @@ WARNINGS += -Wshadow
 CPPFLAGS += -DVERSION=\"$(VERSION)\" -DPACKAGE=\"$(PACKAGE)\" \
 		-DPACKAGE_BUGREPORT=\"$(PACKAGE_BUGREPORT)\" -D_GNU_SOURCE
 
-UTIL_SRC = 	utils/cpufreq-info.c utils/cpufreq-set.c utils/cpufreq-aperf.c utils/cpuid.h
-UTIL_BINS = 	utils/cpufreq-info utils/cpufreq-set utils/cpufreq-aperf
-LIB_HEADERS = 	lib/cpufreq.h lib/sysfs.h
-LIB_SRC = 	lib/cpufreq.c lib/sysfs.c
-LIB_OBJS = 	lib/cpufreq.o lib/sysfs.o
+UTIL_SRC = 	utils/cpufreq-info.c utils/cpufreq-set.c utils/cpufreq-aperf.c utils/cpuidle-info.c utils/cpuid.h
+UTIL_BINS = 	utils/cpufreq-info utils/cpufreq-set utils/cpufreq-aperf utils/cpuidle-info
+LIB_HEADERS = 	lib/cpufreq.h lib/cpuidle.h lib/sysfs.h
+LIB_SRC = 	lib/cpufreq.c lib/cpuidle.c lib/sysfs.c
+LIB_OBJS = 	lib/cpufreq.o lib/cpuidle.o lib/sysfs.o
 
 CFLAGS +=	-pipe
 
@@ -150,8 +150,6 @@ else
 endif
 
 
-
-
 # the actual make rules
 
 all: ccdv libcpufreq utils $(COMPILE_NLS) $(COMPILE_BENCH)
@@ -244,6 +242,7 @@ uninstall:
 	- rm -f $(DESTDIR)${bindir}/cpufreq-set
 	- rm -f $(DESTDIR)${bindir}/cpufreq-info
 	- rm -f $(DESTDIR)${bindir}/cpufreq-aperf
+	- rm -f $(DESTDIR)${bindir}/cpuidle-info
 	- rm -f $(DESTDIR)${mandir}/man1/cpufreq-set.1
 	- rm -f $(DESTDIR)${mandir}/man1/cpufreq-info.1
 	- for HLANG in $(LANGUAGES); do \
lib/cpufreq.c +13 -13
index 603dbf8..ae7d8c5 100644
@@ -30,7 +30,7 @@ unsigned long cpufreq_get_freq_hardware(unsigned int cpu)
 
 unsigned long cpufreq_get_transition_latency(unsigned int cpu)
 {
-	return sysfs_get_transition_latency(cpu);
+	return sysfs_get_freq_transition_latency(cpu);
 }
 
 int cpufreq_get_hardware_limits(unsigned int cpu,
@@ -39,11 +39,11 @@ int cpufreq_get_hardware_limits(unsigned int cpu,
 {
 	if ((!min) || (!max))
 		return -EINVAL;
-	return sysfs_get_hardware_limits(cpu, min, max);
+	return sysfs_get_freq_hardware_limits(cpu, min, max);
 }
 
 char * cpufreq_get_driver(unsigned int cpu) {
-	return sysfs_get_driver(cpu);
+	return sysfs_get_freq_driver(cpu);
 }
 
 void cpufreq_put_driver(char * ptr) {
@@ -53,7 +53,7 @@ void cpufreq_put_driver(char * ptr) {
 }
 
 struct cpufreq_policy * cpufreq_get_policy(unsigned int cpu) {
-	return sysfs_get_policy(cpu);
+	return sysfs_get_freq_policy(cpu);
 }
 
 void cpufreq_put_policy(struct cpufreq_policy *policy) {
@@ -66,7 +66,7 @@ void cpufreq_put_policy(struct cpufreq_policy *policy) {
 }
 
 struct cpufreq_available_governors * cpufreq_get_available_governors(unsigned int cpu) {
-	return sysfs_get_available_governors(cpu);
+	return sysfs_get_freq_available_governors(cpu);
 }
 
 void cpufreq_put_available_governors(struct cpufreq_available_governors *any) {
@@ -106,7 +106,7 @@ void cpufreq_put_available_frequencies(struct cpufreq_available_frequencies *any
 
 
 struct cpufreq_affected_cpus * cpufreq_get_affected_cpus(unsigned int cpu) {
-	return sysfs_get_affected_cpus(cpu);
+	return sysfs_get_freq_affected_cpus(cpu);
 }
 
 void cpufreq_put_affected_cpus(struct cpufreq_affected_cpus *any) {
@@ -125,7 +125,7 @@ void cpufreq_put_affected_cpus(struct cpufreq_affected_cpus *any) {
 
 
 struct cpufreq_affected_cpus * cpufreq_get_related_cpus(unsigned int cpu) {
-	return sysfs_get_related_cpus(cpu);
+	return sysfs_get_freq_related_cpus(cpu);
 }
 
 void cpufreq_put_related_cpus(struct cpufreq_affected_cpus *any) {
@@ -137,17 +137,17 @@ int cpufreq_set_policy(unsigned int cpu, struct cpufreq_policy *policy) {
 	if (!policy || !(policy->governor))
 		return -EINVAL;
 
-	return sysfs_set_policy(cpu, policy);
+	return sysfs_set_freq_policy(cpu, policy);
 }
 
 
 int cpufreq_modify_policy_min(unsigned int cpu, unsigned long min_freq) {
-	return sysfs_modify_policy_min(cpu, min_freq);
+	return sysfs_modify_freq_policy_min(cpu, min_freq);
 }
 
 
 int cpufreq_modify_policy_max(unsigned int cpu, unsigned long max_freq) {
-	return sysfs_modify_policy_max(cpu, max_freq);
+	return sysfs_modify_freq_policy_max(cpu, max_freq);
 }
 
 
@@ -155,7 +155,7 @@ int cpufreq_modify_policy_governor(unsigned int cpu, char *governor) {
 	if ((!governor) || (strlen(governor) > 19))
 		return -EINVAL;
 
-	return sysfs_modify_policy_governor(cpu, governor);
+	return sysfs_modify_freq_policy_governor(cpu, governor);
 }
 
 int cpufreq_set_frequency(unsigned int cpu, unsigned long target_frequency) {
@@ -165,7 +165,7 @@ int cpufreq_set_frequency(unsigned int cpu, unsigned long target_frequency) {
 struct cpufreq_stats * cpufreq_get_stats(unsigned int cpu, unsigned long long *total_time) {
 	struct cpufreq_stats *ret;
 
-	ret = sysfs_get_stats(cpu, total_time);
+	ret = sysfs_get_freq_stats(cpu, total_time);
 	return (ret);
 }
 
@@ -184,7 +184,7 @@ void cpufreq_put_stats(struct cpufreq_stats *any) {
 }
 
 unsigned long cpufreq_get_transitions(unsigned int cpu) {
-	unsigned long ret = sysfs_get_transitions(cpu);
+	unsigned long ret = sysfs_get_freq_transitions(cpu);
 
 	return (ret);
 }
lib/cpuidle.c new file +59 -0

59 lines not on this page · raw message

lib/cpuidle.h new file +32 -0
new file mode 100644
index 0000000..78263fb
@@ -0,0 +1,32 @@
+/*
+ *  cpuidle.h - definitions for libcpupower
+ *
+ *  Copyright (C) 2010  Thomas Renninger <[email protected]>
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, version 2 of the License.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+extern int cpuidle_get_cstate_count(unsigned int cpu);
+extern unsigned long cpuidle_get_cstate_latency(unsigned int cpu,
+						unsigned int cstate);
+extern unsigned long cpuidle_get_cstate_usage(unsigned int cpu,
+					      unsigned int cstate);
+extern unsigned long long cpuidle_get_cstate_time(unsigned int cpu,
+					   unsigned int cstate);
+extern char * cpuidle_get_cstate_name(unsigned int cpu, unsigned int cstate);
+extern char * cpuidle_get_cstate_desc(unsigned int cpu, unsigned int cstate);
+extern char * cpuidle_get_driver(void);
+extern char * cpuidle_get_governor(void);
+
+
lib/sysfs.c +361 -79

689 lines not on this page · raw message

lib/sysfs.h +29 -13

48 lines not on this page · raw message

utils/cpuidle-info.c new file +305 -0

305 lines not on this page · raw message

Signature · 1 line
1.6.4.2
#3 lore raw

PATCH 3/4 cpufrequtils: Rename libcpufreq to libcpupower

In reply to Thomas Renninger

But still provide libcpufreq which links against the new libcpupower now.

Like that binaries linking with -lcpufreq will still work. Getting this (-l cpufreq) deprecated should work at packaging layer then.

---
 Makefile |   30 +++++++++++++++++++++---------
 1 files changed, 21 insertions(+), 9 deletions(-)
Makefile +21 -9
index 07637ed..089fe33 100644
@@ -152,7 +152,7 @@ endif
 
 # the actual make rules
 
-all: ccdv libcpufreq utils $(COMPILE_NLS) $(COMPILE_BENCH)
+all: ccdv libcpupower utils $(COMPILE_NLS) $(COMPILE_BENCH)
 
 ccdv: build/ccdv
 build/ccdv: build/ccdv.c
@@ -162,17 +162,25 @@ build/ccdv: build/ccdv.c
 lib/%.o: $(LIB_SRC) $(LIB_HEADERS) build/ccdv
 	$(QUIET) $(CC) $(CPPFLAGS) $(CFLAGS) -fPIC -o $@ -c lib/$*.c
 
-libcpufreq.so.$(LIB_MAJ): $(LIB_OBJS)
-	$(QUIET) $(CC) -shared $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ \
-		-Wl,-soname,libcpufreq.so.$(LIB_MIN) $(LIB_OBJS)
+libcpupower.so.$(LIB_MAJ): $(LIB_OBJS)
+	$(CC) -shared $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ \
+		-Wl,-soname,libcpupower.so.$(LIB_MIN) $(LIB_OBJS)
+	@ln -sf $@ libcpupower.so
+	@ln -sf $@ libcpupower.so.$(LIB_MIN)
+
+# Still Provide the old lib, but apps should get fixed to
+# not link against it anymore 
+libcpufreq.so.$(LIB_MAJ): libcpupower.so.$(LIB_MAJ)
+	$(CC) -shared $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ \
+		-Wl,-soname,libcpufreq.so.$(LIB_MIN) -l cpupower -L .
 	@ln -sf $@ libcpufreq.so
 	@ln -sf $@ libcpufreq.so.$(LIB_MIN)
 
-libcpufreq: libcpufreq.so.$(LIB_MAJ)
+libcpupower: libcpupower.so.$(LIB_MAJ) libcpufreq.so.$(LIB_MAJ)
 
-$(UTIL_BINS): libcpufreq.so.$(LIB_MAJ) $(UTIL_SRC)
+$(UTIL_BINS): libcpupower.so.$(LIB_MAJ) $(UTIL_SRC)
 	$(QUIET) $(CC) $(CPPFLAGS) $(CFLAGS) -I. -I./lib/ -c [email protected] -o [email protected]
-	$(QUIET) $(CC) $(CFLAGS) $(LDFLAGS) -L. -o $@ [email protected] -lcpufreq
+	$(QUIET) $(CC) $(CFLAGS) $(LDFLAGS) -L. -o $@ [email protected] -lcpupower
 	$(QUIET) $(STRIPCMD) $@
 
 utils: $(UTIL_BINS)
@@ -196,13 +204,14 @@ update-gmo: po/$(PACKAGE).pot
 		msgfmt --statistics -o po/$$HLANG.gmo po/$$HLANG.po; \
 	done;
 
-compile-bench: libcpufreq
+compile-bench: libcpupower
 	@V=$(V) confdir=$(confdir) $(MAKE) -C bench
 
 clean:
 	-find . \( -not -type d \) -and \( -name '*~' -o -name '*.[oas]' \) -type f -print \
 	 | xargs rm -f
 	-rm -f $(UTIL_BINS)
+	-rm -f libcpupower.so*
 	-rm -f libcpufreq.so*
 	-rm -f build/ccdv
 	-rm -rf po/*.gmo po/*.pot
@@ -211,9 +220,11 @@ clean:
 
 install-lib:
 	$(INSTALL) -d $(DESTDIR)${libdir}
+	$(CP) libcpupower.so* $(DESTDIR)${libdir}/
 	$(CP) libcpufreq.so* $(DESTDIR)${libdir}/
 	$(INSTALL) -d $(DESTDIR)${includedir}
 	$(INSTALL_DATA) lib/cpufreq.h $(DESTDIR)${includedir}/cpufreq.h
+	$(INSTALL_DATA) lib/cpuidle.h $(DESTDIR)${includedir}/cpuidle.h
 
 install-tools:
 	$(INSTALL) -d $(DESTDIR)${bindir}
@@ -237,6 +248,7 @@ install-bench:
 install: all install-lib install-tools install-man $(INSTALL_NLS) $(INSTALL_BENCH)
 
 uninstall:
+	- rm -f $(DESTDIR)${libdir}/libcpupower.*
 	- rm -f $(DESTDIR)${libdir}/libcpufreq.*
 	- rm -f $(DESTDIR)${includedir}/cpufreq.h
 	- rm -f $(DESTDIR)${bindir}/cpufreq-set
@@ -249,5 +261,5 @@ uninstall:
 		rm -f $(DESTDIR)${localedir}/$$HLANG/LC_MESSAGES/cpufrequtils.mo; \
 	  done;
 
-.PHONY: all utils libcpufreq ccdv update-po update-gmo install-lib install-tools install-man install-gmo install uninstall \
+.PHONY: all utils libcpupower ccdv update-po update-gmo install-lib install-tools install-man install-gmo install uninstall \
 	clean 
Signature · 1 line
1.6.4.2
#4 lore raw

PATCH 4/4 cpufrequtils: Rename the project/package into cpupowerutils

In reply to Thomas Renninger
---
 Makefile |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)
Makefile +6 -6
index 089fe33..a268264 100644
@@ -1,4 +1,4 @@
-# Makefile for cpufrequtils
+# Makefile for cpupowerutils
 #
 # Copyright (C) 2005,2006 Dominik Brodowski <[email protected]>
 #
@@ -51,7 +51,7 @@ VERSION =			008
 LIB_MAJ=			0.0.0
 LIB_MIN=			0
 
-PACKAGE =			cpufrequtils
+PACKAGE =			cpupowerutils
 PACKAGE_BUGREPORT =		[email protected]
 LANGUAGES = 			de fr it cs pt
 
@@ -66,7 +66,7 @@ mandir ?=	/usr/man
 includedir ?=	/usr/include
 libdir ?=	/usr/lib
 localedir ?=	/usr/share/locale
-docdir ?=       /usr/share/doc/packages/cpufrequtils
+docdir ?=       /usr/share/doc/packages/cpupowerutils
 confdir ?=      /etc/
 
 # Toolchain: what tools do we use, and what options do they need:
@@ -237,8 +237,8 @@ install-man:
 install-gmo:
 	$(INSTALL) -d $(DESTDIR)${localedir}
 	for HLANG in $(LANGUAGES); do \
-		echo '$(INSTALL_DATA) -D po/$$HLANG.gmo $(DESTDIR)${localedir}/$$HLANG/LC_MESSAGES/cpufrequtils.mo'; \
-		$(INSTALL_DATA) -D po/$$HLANG.gmo $(DESTDIR)${localedir}/$$HLANG/LC_MESSAGES/cpufrequtils.mo; \
+		echo '$(INSTALL_DATA) -D po/$$HLANG.gmo $(DESTDIR)${localedir}/$$HLANG/LC_MESSAGES/cpupowerutils.mo'; \
+		$(INSTALL_DATA) -D po/$$HLANG.gmo $(DESTDIR)${localedir}/$$HLANG/LC_MESSAGES/cpupowerutils.mo; \
 	done;
 
 install-bench:
@@ -258,7 +258,7 @@ uninstall:
 	- rm -f $(DESTDIR)${mandir}/man1/cpufreq-set.1
 	- rm -f $(DESTDIR)${mandir}/man1/cpufreq-info.1
 	- for HLANG in $(LANGUAGES); do \
-		rm -f $(DESTDIR)${localedir}/$$HLANG/LC_MESSAGES/cpufrequtils.mo; \
+		rm -f $(DESTDIR)${localedir}/$$HLANG/LC_MESSAGES/cpupowerutils.mo; \
 	  done;
 
 .PHONY: all utils libcpupower ccdv update-po update-gmo install-lib install-tools install-man install-gmo install uninstall \
Signature · 1 line
1.6.4.2
#5 lore raw
In reply to Thomas Renninger

Hey,

Quoted 1 line · Thomas Renninger

here my latest patchset.

Thanks.

Quoted 2 lines

If this isn't totally wrong, I'd appreciate if you could push these already (into a separate branch for now?)

Applied into the "cpupowerutils" branch, and pushed that to

git://git.kernel.org/pub/scm/utils/kernel/cpufreq/cpufrequtils.git

I split up one patch into two parts, and added two patches on top. Let me know what you think about this.

Quoted 4 lines

I do not want to pollute other lists for now.
If you accept this and I did some further testing, packaging, cleanup, etc., I'd like to announce this work on some more lists (lesswatts, linux-pm, acpi, ...).

Sounds good.

Best,
Dominik

#6 lore raw
Quoted 6 lines · On Saturday 25 September 2010 14:37:10 Dominik Brodowski wrote:

Hey,

Quoted 1 line · Thomas Renninger

here my latest patchset.

Thanks.

Thank you!

Quoted 9 lines
Quoted 2 lines

If this isn't totally wrong, I'd appreciate if you could push these already (into a separate branch for now?)

Applied into the "cpupowerutils" branch, and pushed that to

git://git.kernel.org/pub/scm/utils/kernel/cpufreq/cpufrequtils.git

I split up one patch into two parts, and added two patches on top. Let me know what you think about this.

Absolutely fine.

I packaged cpupowerutils, this time with a proper split of library and devel packages.
I then got these packages:
cpupowerutils
cpupowerutils-bench
libcpupower0
libcpupower-devel
and the obsolete one (should get removed as soon as
no app is linking against -lcpufreq anymore):
libcpufreq0

Whoever wants to have a look or try out these packages, they can be found here, built against all kind of SUSE distros (Factory, 11.3, 11.2, 11.1, SLE_11, SLE11_SP1 - x86_64 and i386):
http://software.opensuse.org/search?q=cpupower

I found some minor bugs/enhancements, will post them in a minute.

Comments, suggestions, etc. are very welcome.

Thanks,

Thomas

#7 lore raw

PATCH 1/3 cpupowerutuils: Jump to version 010

Jump from version 008 to 010.
Theoretically there could still be an cpufrequtils update to 009, but even if not, having a gap to show there were quite some changes is a good idea.

---
 Makefile |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Makefile +1 -1
index 5bcd0e0..a53b440 100644
@@ -47,7 +47,7 @@ DESTDIR ?=
 # Package-related definitions. Distributions can modify the version
 # and _should_ modify the PACKAGE_BUGREPORT definition
 
-VERSION =			008
+VERSION =			010
 LIB_MAJ=			0.0.0
 LIB_MIN=			0
 
Signature · 1 line
1.6.4.2
#8 lore raw

Re: [PATCH 1/3] cpupowerutuils: Jump to version 010

Quoted 3 lines · Thomas Renninger

Jump from version 008 to 010.
Theoretically there could still be an cpufrequtils update to 009, but even if not, having a gap to show there were quite some changes is a good idea.

NAK. VERSION is only updated to a new major version on a release. I changed VERSION to 9p1 (for 9-pre1) instead.

Best,
Dominik

#9 lore raw

PATCH 2/3 cpupowerutils: Use sbindir for binaries that need root privileges

In reply to Thomas Renninger

cpufreq-aperf:
- Must be run as root or it exits with a related error message.
- It should not be used by any scripts

cpufreq-set:
I am not sure whether above is true for cpufreq-set as well. I expect it always must be called as root and thus should be in sbindir.

---
 Makefile |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)
Makefile +7 -3
index a53b440..865c9f8 100644
@@ -228,7 +228,11 @@ install-lib:
 
 install-tools:
 	$(INSTALL) -d $(DESTDIR)${bindir}
-	$(INSTALL_PROGRAM) $(UTIL_BINS) $(DESTDIR)${bindir}
+	$(INSTALL_PROGRAM) utils/cpufreq-info utils/cpuidle-info \
+                  $(DESTDIR)${bindir}
+	$(INSTALL) -d $(DESTDIR)${sbindir}
+	$(INSTALL_PROGRAM) utils/cpufreq-set utils/cpufreq-aperf \
+                  $(DESTDIR)${sbindir}
 
 install-man:
 	$(INSTALL_DATA) -D man/cpufreq-set.1 $(DESTDIR)${mandir}/man1/cpufreq-set.1
@@ -251,9 +255,9 @@ uninstall:
 	- rm -f $(DESTDIR)${libdir}/libcpupower.*
 	- rm -f $(DESTDIR)${libdir}/libcpufreq.*
 	- rm -f $(DESTDIR)${includedir}/cpufreq.h
-	- rm -f $(DESTDIR)${bindir}/cpufreq-set
+	- rm -f $(DESTDIR)${sbindir}/cpufreq-set
 	- rm -f $(DESTDIR)${bindir}/cpufreq-info
-	- rm -f $(DESTDIR)${bindir}/cpufreq-aperf
+	- rm -f $(DESTDIR)${sbindir}/cpufreq-aperf
 	- rm -f $(DESTDIR)${bindir}/cpuidle-info
 	- rm -f $(DESTDIR)${mandir}/man1/cpufreq-set.1
 	- rm -f $(DESTDIR)${mandir}/man1/cpufreq-info.1
Signature · 1 line
1.6.4.2
#10 lore raw

Re: [PATCH 2/3] cpupowerutils: Use sbindir for binaries that need root privileges

Quoted 7 lines · Thomas Renninger

cpufreq-aperf:
- Must be run as root or it exits with a related error message.
- It should not be used by any scripts

cpufreq-set:
I am not sure whether above is true for cpufreq-set as well. I expect it always must be called as root and thus should be in sbindir.

Applied, thanks.

Dominik

#11 lore raw

PATCH 3/3 cpupowerutils: cpufreq-bench must link against libcpupower

In reply to Thomas Renninger
---
 bench/Makefile |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
bench/Makefile +1 -1
index 3d8fa21..9f3b195 100644
@@ -1,4 +1,4 @@
-LIBS = -L../ -lm -lcpufreq
+LIBS = -L../ -lm -lcpupower
 
 OBJS = main.o parse.o system.o benchmark.o
 CFLAGS += -D_GNU_SOURCE -I../lib -DDEFAULT_CONFIG_FILE=\"$(confdir)/cpufreq-bench.conf\"
Signature · 1 line
1.6.4.2
#12 lore raw

Re: [PATCH 3/3] cpupowerutils: cpufreq-bench must link against libcpupower

Applied, thanks.

Quoted 24 lines · Thomas Renninger
---
 bench/Makefile |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
bench/Makefile +1 -1
index 3d8fa21..9f3b195 100644
@@ -1,4 +1,4 @@
-LIBS = -L../ -lm -lcpufreq
+LIBS = -L../ -lm -lcpupower
 
 OBJS = main.o parse.o system.o benchmark.o
 CFLAGS += -D_GNU_SOURCE -I../lib -DDEFAULT_CONFIG_FILE=\"$(confdir)/cpufreq-bench.conf\"
Signature · 6 lines
1.6.4.2

--
To unsubscribe from this list: send the line "unsubscribe cpufreq" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html