Skip to content

Commit

Permalink
Merge tag 'linux-cpupower-4.20-rc4' of git://git.kernel.org/pub/scm/l…
Browse files Browse the repository at this point in the history
…inux/kernel/git/shuah/linux

Pull cpupower utility updates for 4.20-rc4 from Shuah Khan:

"This cpupower update for Linux 4.20-rc4 consists of compile fixes to allow
 use of outside build flags and override of CFLAGS from Jiri Olsa, and fix
 to compilation with STATIC=true from Konstantin Khlebnikov."

* tag 'linux-cpupower-4.20-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux:
  tools cpupower: Override CFLAGS assignments
  tools cpupower debug: Allow to use outside build flags
  tools/power/cpupower: fix compilation with STATIC=true
  • Loading branch information
Rafael J. Wysocki committed Nov 21, 2018
2 parents 9ff0119 + dbc4ca3 commit 0db699f
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 14 deletions.
12 changes: 6 additions & 6 deletions tools/power/cpupower/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ WARNINGS += $(call cc-supports,-Wno-pointer-sign)
WARNINGS += $(call cc-supports,-Wdeclaration-after-statement)
WARNINGS += -Wshadow

CFLAGS += -DVERSION=\"$(VERSION)\" -DPACKAGE=\"$(PACKAGE)\" \
override CFLAGS += -DVERSION=\"$(VERSION)\" -DPACKAGE=\"$(PACKAGE)\" \
-DPACKAGE_BUGREPORT=\"$(PACKAGE_BUGREPORT)\" -D_GNU_SOURCE

UTIL_OBJS = utils/helpers/amd.o utils/helpers/msr.o \
Expand All @@ -156,12 +156,12 @@ LIB_SRC = lib/cpufreq.c lib/cpupower.c lib/cpuidle.c
LIB_OBJS = lib/cpufreq.o lib/cpupower.o lib/cpuidle.o
LIB_OBJS := $(addprefix $(OUTPUT),$(LIB_OBJS))

CFLAGS += -pipe
override CFLAGS += -pipe

ifeq ($(strip $(NLS)),true)
INSTALL_NLS += install-gmo
COMPILE_NLS += create-gmo
CFLAGS += -DNLS
override CFLAGS += -DNLS
endif

ifeq ($(strip $(CPUFREQ_BENCH)),true)
Expand All @@ -175,7 +175,7 @@ ifeq ($(strip $(STATIC)),true)
UTIL_SRC += $(LIB_SRC)
endif

CFLAGS += $(WARNINGS)
override CFLAGS += $(WARNINGS)

ifeq ($(strip $(V)),false)
QUIET=@
Expand All @@ -188,10 +188,10 @@ export QUIET ECHO

# if DEBUG is enabled, then we do not strip or optimize
ifeq ($(strip $(DEBUG)),true)
CFLAGS += -O1 -g -DDEBUG
override CFLAGS += -O1 -g -DDEBUG
STRIPCMD = /bin/true -Since_we_are_debugging
else
CFLAGS += $(OPTIMIZATION) -fomit-frame-pointer
override CFLAGS += $(OPTIMIZATION) -fomit-frame-pointer
STRIPCMD = $(STRIP) -s --remove-section=.note --remove-section=.comment
endif

Expand Down
2 changes: 1 addition & 1 deletion tools/power/cpupower/bench/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ endif
ifeq ($(strip $(STATIC)),true)
LIBS = -L../ -L$(OUTPUT) -lm
OBJS = $(OUTPUT)main.o $(OUTPUT)parse.o $(OUTPUT)system.o $(OUTPUT)benchmark.o \
$(OUTPUT)../lib/cpufreq.o $(OUTPUT)../lib/sysfs.o
$(OUTPUT)../lib/cpufreq.o $(OUTPUT)../lib/cpupower.o
else
LIBS = -L../ -L$(OUTPUT) -lm -lcpupower
OBJS = $(OUTPUT)main.o $(OUTPUT)parse.o $(OUTPUT)system.o $(OUTPUT)benchmark.o
Expand Down
4 changes: 2 additions & 2 deletions tools/power/cpupower/debug/x86_64/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ INSTALL = /usr/bin/install
default: all

$(OUTPUT)centrino-decode: ../i386/centrino-decode.c
$(CC) $(CFLAGS) -o $@ $<
$(CC) $(CFLAGS) -o $@ $(LDFLAGS) $<

$(OUTPUT)powernow-k8-decode: ../i386/powernow-k8-decode.c
$(CC) $(CFLAGS) -o $@ $<
$(CC) $(CFLAGS) -o $@ $(LDFLAGS) $<

all: $(OUTPUT)centrino-decode $(OUTPUT)powernow-k8-decode

Expand Down
2 changes: 1 addition & 1 deletion tools/power/cpupower/lib/cpufreq.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ static unsigned int sysfs_cpufreq_read_file(unsigned int cpu, const char *fname,

snprintf(path, sizeof(path), PATH_TO_CPU "cpu%u/cpufreq/%s",
cpu, fname);
return sysfs_read_file(path, buf, buflen);
return cpupower_read_sysfs(path, buf, buflen);
}

/* helper function to write a new value to a /sys file */
Expand Down
2 changes: 1 addition & 1 deletion tools/power/cpupower/lib/cpuidle.c
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ static unsigned int sysfs_cpuidle_read_file(const char *fname, char *buf,

snprintf(path, sizeof(path), PATH_TO_CPU "cpuidle/%s", fname);

return sysfs_read_file(path, buf, buflen);
return cpupower_read_sysfs(path, buf, buflen);
}


Expand Down
4 changes: 2 additions & 2 deletions tools/power/cpupower/lib/cpupower.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include "cpupower.h"
#include "cpupower_intern.h"

unsigned int sysfs_read_file(const char *path, char *buf, size_t buflen)
unsigned int cpupower_read_sysfs(const char *path, char *buf, size_t buflen)
{
int fd;
ssize_t numread;
Expand Down Expand Up @@ -95,7 +95,7 @@ static int sysfs_topology_read_file(unsigned int cpu, const char *fname, int *re

snprintf(path, sizeof(path), PATH_TO_CPU "cpu%u/topology/%s",
cpu, fname);
if (sysfs_read_file(path, linebuf, MAX_LINE_LEN) == 0)
if (cpupower_read_sysfs(path, linebuf, MAX_LINE_LEN) == 0)
return -1;
*result = strtol(linebuf, &endp, 0);
if (endp == linebuf || errno == ERANGE)
Expand Down
2 changes: 1 addition & 1 deletion tools/power/cpupower/lib/cpupower_intern.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
#define MAX_LINE_LEN 4096
#define SYSFS_PATH_MAX 255

unsigned int sysfs_read_file(const char *path, char *buf, size_t buflen);
unsigned int cpupower_read_sysfs(const char *path, char *buf, size_t buflen);

0 comments on commit 0db699f

Please sign in to comment.