File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
tools/power/x86/turbostat Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ turbostat : turbostat.c
14
14
override CFLAGS += -O2 -Wall -Wextra -I../../../include
15
15
override CFLAGS += -DMSRHEADER='"../../../../arch/x86/include/asm/msr-index.h"'
16
16
override CFLAGS += -DINTEL_FAMILY_HEADER='"../../../../arch/x86/include/asm/intel-family.h"'
17
+ override CFLAGS += -DBUILD_BUG_HEADER='"../../../../include/linux/build_bug.h"'
17
18
override CFLAGS += -D_FILE_OFFSET_BITS=64
18
19
override CFLAGS += -D_FORTIFY_SOURCE=2
19
20
@@ -44,10 +45,13 @@ snapshot: turbostat
44
45
@echo "# define GENMASK(h, l) (((~0UL) << (l)) & (~0UL >> (sizeof(long) * 8 - 1 - (h))))" >> $(SNAPSHOT)/bits.h
45
46
@echo "# define GENMASK_ULL(h, l) (((~0ULL) << (l)) & (~0ULL >> (sizeof(long long) * 8 - 1 - (h))))" >> $(SNAPSHOT)/bits.h
46
47
48
+ @echo '# define BUILD_BUG_ON(cond) do { enum { compile_time_check ## __COUNTER__ = 1/(!(cond)) }; } while (0)' > $(SNAPSHOT)/build_bug.h
49
+
47
50
@echo PWD=. > $(SNAPSHOT)/Makefile
48
51
@echo "CFLAGS += -DMSRHEADER='\"msr-index.h\"'" >> $(SNAPSHOT)/Makefile
49
52
@echo "CFLAGS += -DINTEL_FAMILY_HEADER='\"intel-family.h\"'" >> $(SNAPSHOT)/Makefile
50
- @sed -e's/.*MSRHEADER.*//' -e's/.*INTEL_FAMILY_HEADER.*//' Makefile >> $(SNAPSHOT)/Makefile
53
+ @echo "CFLAGS += -DBUILD_BUG_HEADER='\"build_bug.h\"'" >> $(SNAPSHOT)/Makefile
54
+ @sed -e's/.*MSRHEADER.*//' -e's/.*INTEL_FAMILY_HEADER.*//' -e's/.*BUILD_BUG_HEADER.*//' Makefile >> $(SNAPSHOT)/Makefile
51
55
52
56
@rm -f $(SNAPSHOT).tar.gz
53
57
tar cvzf $(SNAPSHOT).tar.gz $(SNAPSHOT)
Original file line number Diff line number Diff line change 10
10
#define _GNU_SOURCE
11
11
#include MSRHEADER
12
12
#include INTEL_FAMILY_HEADER
13
+ #include BUILD_BUG_HEADER
13
14
#include <stdarg.h>
14
15
#include <stdio.h>
15
16
#include <err.h>
38
39
#include <stdbool.h>
39
40
#include <assert.h>
40
41
#include <linux/kernel.h>
41
- #include <linux/build_bug.h>
42
42
43
43
#define UNUSED (x ) (void)(x)
44
44
You can’t perform that action at this time.
0 commit comments