History

Merge branches 'pm-opp' and 'pm-tools'

* pm-opp: opp: ti-opp-supply: Correct the supply in _get_optimal_vdd_voltage call opp: ti-opp-supply: Dynamically update u_volt_min * pm-tools: tools cpupower: Override CFLAGS assignments tools cpupower debug: Allow to use outside build flags tools/power/cpupower: fix compilation with STATIC=true

Rafael J. Wysocki committed 7 years ago

Commit bec00cb2 parents 6eb5c9b 0db699f7 files · +14 −14Browse files

Unified · Split

7 files
  1. tools/power/cpupower/Makefile +6 −6
  2. tools/power/cpupower/bench/Makefile +1 −1
  3. tools/power/cpupower/debug/x86_64/Makefile +2 −2
  4. tools/power/cpupower/lib/cpufreq.c +1 −1
  5. tools/power/cpupower/lib/cpuidle.c +1 −1
  6. tools/power/cpupower/lib/cpupower.c +2 −2
  7. tools/power/cpupower/lib/cpupower_intern.h +1 −1
tools/power/cpupower/Makefile+6−6
@@ -129,7 +129,7 @@ WARNINGS += $(call cc-supports,-Wno-pointer-sign) · 128 unmodified lines
129WARNINGS += $(call cc-supports,-Wdeclaration-after-statement)129WARNINGS += $(call cc-supports,-Wdeclaration-after-statement)
130WARNINGS += -Wshadow130WARNINGS += -Wshadow
131 131
132CFLAGS += -DVERSION=\"$(VERSION)\" -DPACKAGE=\"$(PACKAGE)\" \132override CFLAGS += -DVERSION=\"$(VERSION)\" -DPACKAGE=\"$(PACKAGE)\" \
133 -DPACKAGE_BUGREPORT=\"$(PACKAGE_BUGREPORT)\" -D_GNU_SOURCE133 -DPACKAGE_BUGREPORT=\"$(PACKAGE_BUGREPORT)\" -D_GNU_SOURCE
134 134
135UTIL_OBJS = utils/helpers/amd.o utils/helpers/msr.o \135UTIL_OBJS = utils/helpers/amd.o utils/helpers/msr.o \
@@ -156,12 +156,12 @@ LIB_SRC = lib/cpufreq.c lib/cpupower.c lib/cpuidle.c · 20 unmodified lines
156LIB_OBJS = lib/cpufreq.o lib/cpupower.o lib/cpuidle.o156LIB_OBJS = lib/cpufreq.o lib/cpupower.o lib/cpuidle.o
157LIB_OBJS := $(addprefix $(OUTPUT),$(LIB_OBJS))157LIB_OBJS := $(addprefix $(OUTPUT),$(LIB_OBJS))
158 158
159CFLAGS += -pipe159override CFLAGS += -pipe
160 160
161ifeq ($(strip $(NLS)),true)161ifeq ($(strip $(NLS)),true)
162 INSTALL_NLS += install-gmo162 INSTALL_NLS += install-gmo
163 COMPILE_NLS += create-gmo163 COMPILE_NLS += create-gmo
164 CFLAGS += -DNLS164 override CFLAGS += -DNLS
165endif165endif
166 166
167ifeq ($(strip $(CPUFREQ_BENCH)),true)167ifeq ($(strip $(CPUFREQ_BENCH)),true)
@@ -175,7 +175,7 @@ ifeq ($(strip $(STATIC)),true) · 7 unmodified lines
175 UTIL_SRC += $(LIB_SRC)175 UTIL_SRC += $(LIB_SRC)
176endif176endif
177 177
178CFLAGS += $(WARNINGS)178override CFLAGS += $(WARNINGS)
179 179
180ifeq ($(strip $(V)),false)180ifeq ($(strip $(V)),false)
181 QUIET=@181 QUIET=@
@@ -188,10 +188,10 @@ export QUIET ECHO · 6 unmodified lines
188 188
189# if DEBUG is enabled, then we do not strip or optimize189# if DEBUG is enabled, then we do not strip or optimize
190ifeq ($(strip $(DEBUG)),true)190ifeq ($(strip $(DEBUG)),true)
191 CFLAGS += -O1 -g -DDEBUG191 override CFLAGS += -O1 -g -DDEBUG
192 STRIPCMD = /bin/true -Since_we_are_debugging192 STRIPCMD = /bin/true -Since_we_are_debugging
193else193else
194 CFLAGS += $(OPTIMIZATION) -fomit-frame-pointer194 override CFLAGS += $(OPTIMIZATION) -fomit-frame-pointer
195 STRIPCMD = $(STRIP) -s --remove-section=.note --remove-section=.comment195 STRIPCMD = $(STRIP) -s --remove-section=.note --remove-section=.comment
196endif196endif
197 197
tools/power/cpupower/bench/Makefile+1−1
@@ -9,7 +9,7 @@ endif · 8 unmodified lines
9ifeq ($(strip $(STATIC)),true)9ifeq ($(strip $(STATIC)),true)
10LIBS = -L../ -L$(OUTPUT) -lm10LIBS = -L../ -L$(OUTPUT) -lm
11OBJS = $(OUTPUT)main.o $(OUTPUT)parse.o $(OUTPUT)system.o $(OUTPUT)benchmark.o \11OBJS = $(OUTPUT)main.o $(OUTPUT)parse.o $(OUTPUT)system.o $(OUTPUT)benchmark.o \
12 $(OUTPUT)../lib/cpufreq.o $(OUTPUT)../lib/sysfs.o12 $(OUTPUT)../lib/cpufreq.o $(OUTPUT)../lib/cpupower.o
13else13else
14LIBS = -L../ -L$(OUTPUT) -lm -lcpupower14LIBS = -L../ -L$(OUTPUT) -lm -lcpupower
15OBJS = $(OUTPUT)main.o $(OUTPUT)parse.o $(OUTPUT)system.o $(OUTPUT)benchmark.o15OBJS = $(OUTPUT)main.o $(OUTPUT)parse.o $(OUTPUT)system.o $(OUTPUT)benchmark.o
tools/power/cpupower/debug/x86_64/Makefile+2−2
@@ -13,10 +13,10 @@ INSTALL = /usr/bin/install · 12 unmodified lines
13default: all13default: all
14 14
15$(OUTPUT)centrino-decode: ../i386/centrino-decode.c15$(OUTPUT)centrino-decode: ../i386/centrino-decode.c
16 $(CC) $(CFLAGS) -o $@ $<16 $(CC) $(CFLAGS) -o $@ $(LDFLAGS) $<
17 17
18$(OUTPUT)powernow-k8-decode: ../i386/powernow-k8-decode.c18$(OUTPUT)powernow-k8-decode: ../i386/powernow-k8-decode.c
19 $(CC) $(CFLAGS) -o $@ $<19 $(CC) $(CFLAGS) -o $@ $(LDFLAGS) $<
20 20
21all: $(OUTPUT)centrino-decode $(OUTPUT)powernow-k8-decode21all: $(OUTPUT)centrino-decode $(OUTPUT)powernow-k8-decode
22 22
tools/power/cpupower/lib/cpufreq.c+1−1
@@ -28,7 +28,7 @@ static unsigned int sysfs_cpufreq_read_file(unsigned int cpu, const char *fname, · 27 unmodified lines
28 28
29 snprintf(path, sizeof(path), PATH_TO_CPU "cpu%u/cpufreq/%s",29 snprintf(path, sizeof(path), PATH_TO_CPU "cpu%u/cpufreq/%s",
30 cpu, fname);30 cpu, fname);
31 return sysfs_read_file(path, buf, buflen);31 return cpupower_read_sysfs(path, buf, buflen);
32}32}
33 33
34/* helper function to write a new value to a /sys file */34/* helper function to write a new value to a /sys file */
tools/power/cpupower/lib/cpuidle.c+1−1
@@ -319,7 +319,7 @@ static unsigned int sysfs_cpuidle_read_file(const char *fname, char *buf, · 318 unmodified lines
319 319
320 snprintf(path, sizeof(path), PATH_TO_CPU "cpuidle/%s", fname);320 snprintf(path, sizeof(path), PATH_TO_CPU "cpuidle/%s", fname);
321 321
322 return sysfs_read_file(path, buf, buflen);322 return cpupower_read_sysfs(path, buf, buflen);
323}323}
324 324
325 325
tools/power/cpupower/lib/cpupower.c+2−2
@@ -15,7 +15,7 @@ · 14 unmodified lines
15#include "cpupower.h"15#include "cpupower.h"
16#include "cpupower_intern.h"16#include "cpupower_intern.h"
17 17
18unsigned int sysfs_read_file(const char *path, char *buf, size_t buflen)18unsigned int cpupower_read_sysfs(const char *path, char *buf, size_t buflen)
19{19{
20 int fd;20 int fd;
21 ssize_t numread;21 ssize_t numread;
@@ -95,7 +95,7 @@ static int sysfs_topology_read_file(unsigned int cpu, const char *fname, int *re · 73 unmodified lines
95 95
96 snprintf(path, sizeof(path), PATH_TO_CPU "cpu%u/topology/%s",96 snprintf(path, sizeof(path), PATH_TO_CPU "cpu%u/topology/%s",
97 cpu, fname);97 cpu, fname);
98 if (sysfs_read_file(path, linebuf, MAX_LINE_LEN) == 0)98 if (cpupower_read_sysfs(path, linebuf, MAX_LINE_LEN) == 0)
99 return -1;99 return -1;
100 *result = strtol(linebuf, &endp, 0);100 *result = strtol(linebuf, &endp, 0);
101 if (endp == linebuf || errno == ERANGE)101 if (endp == linebuf || errno == ERANGE)
tools/power/cpupower/lib/cpupower_intern.h+1−1
@@ -3,4 +3,4 @@ · 2 unmodified lines
3#define MAX_LINE_LEN 40963#define MAX_LINE_LEN 4096
4#define SYSFS_PATH_MAX 2554#define SYSFS_PATH_MAX 255
5 5
6unsigned int sysfs_read_file(const char *path, char *buf, size_t buflen);6unsigned int cpupower_read_sysfs(const char *path, char *buf, size_t buflen);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t