tree: https://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux.git release head: 15b36a4938815f8dbb940b212ecc7c7085a89ca0 commit: 7b56b064b8a95b3ef7a2b0c88f0d8baded2c4cd6 [1/6] x86: use APERF/MPERF for cpuinfo and scaling_cur_freq MHz config: x86_64-randconfig-s3-11121604 (attached as .config) reproduce: git checkout 7b56b064b8a95b3ef7a2b0c88f0d8baded2c4cd6 # save the attached .config to linux build tree make ARCH=x86_64 All warnings (new ones prefixed by >>): In file included from include/asm-generic/percpu.h:6:0, from arch/x86/include/asm/percpu.h:551, from arch/x86/include/asm/current.h:5, from arch/x86/include/asm/processor.h:15, from arch/x86/include/asm/atomic.h:6, from include/linux/atomic.h:4, from include/linux/llist.h:58, from include/linux/smp.h:14, from arch/x86/kernel/cpu/aperfmperf.c:11: arch/x86/kernel/cpu/aperfmperf.c: In function 'aperfmperf_snapshot_khz': include/linux/percpu-defs.h:264:2: error: implicit declaration of function 'preempt_disable' [-Werror=implicit-function-declaration] preempt_disable(); \ ^ arch/x86/kernel/cpu/aperfmperf.c:32:33: note: in expansion of macro 'get_cpu_var' struct aperfmperf_sample *s = &get_cpu_var(samples); ^ In file included from include/uapi/linux/stddef.h:1:0, from include/linux/stddef.h:4, from include/uapi/linux/posix_types.h:4, from include/uapi/linux/types.h:13, from include/linux/types.h:5, from include/linux/smp.h:10, from arch/x86/kernel/cpu/aperfmperf.c:11: arch/x86/kernel/cpu/aperfmperf.c:35:6: error: implicit declaration of function 'time_before' [-Werror=implicit-function-declaration] if (time_before(jiffies, s->jiffies + HZ/10)) ^ include/linux/compiler.h:147:28: note: in definition of macro '__trace_if' if (__builtin_constant_p((cond)) ? !!(cond) : \ ^ >> arch/x86/kernel/cpu/aperfmperf.c:35:2: note: in expansion of macro 'if' if (time_before(jiffies, s->jiffies + HZ/10)) ^ arch/x86/kernel/cpu/aperfmperf.c:35:18: error: 'jiffies' undeclared (first use in this function) if (time_before(jiffies, s->jiffies + HZ/10)) ^ include/linux/compiler.h:147:28: note: in definition of macro '__trace_if' if (__builtin_constant_p((cond)) ? !!(cond) : \ ^ >> arch/x86/kernel/cpu/aperfmperf.c:35:2: note: in expansion of macro 'if' if (time_before(jiffies, s->jiffies + HZ/10)) ^ arch/x86/kernel/cpu/aperfmperf.c:35:18: note: each undeclared identifier is reported only once for each function it appears in if (time_before(jiffies, s->jiffies + HZ/10)) ^ include/linux/compiler.h:147:28: note: in definition of macro '__trace_if' if (__builtin_constant_p((cond)) ? !!(cond) : \ ^ >> arch/x86/kernel/cpu/aperfmperf.c:35:2: note: in expansion of macro 'if' if (time_before(jiffies, s->jiffies + HZ/10)) ^ arch/x86/kernel/cpu/aperfmperf.c:35:40: error: 'HZ' undeclared (first use in this function) if (time_before(jiffies, s->jiffies + HZ/10)) ^ include/linux/compiler.h:147:28: note: in definition of macro '__trace_if' if (__builtin_constant_p((cond)) ? !!(cond) : \ ^ >> arch/x86/kernel/cpu/aperfmperf.c:35:2: note: in expansion of macro 'if' if (time_before(jiffies, s->jiffies + HZ/10)) ^ arch/x86/kernel/cpu/aperfmperf.c:51:27: error: 'cpu_khz' undeclared (first use in this function) s->khz = (unsigned int) (cpu_khz * aperf_delta / mperf_delta); ^ In file included from include/asm-generic/percpu.h:6:0, from arch/x86/include/asm/percpu.h:551, from arch/x86/include/asm/current.h:5, from arch/x86/include/asm/processor.h:15, from arch/x86/include/asm/atomic.h:6, from include/linux/atomic.h:4, from include/linux/llist.h:58, from include/linux/smp.h:14, from arch/x86/kernel/cpu/aperfmperf.c:11: include/linux/percpu-defs.h:275:2: error: implicit declaration of function 'preempt_enable' [-Werror=implicit-function-declaration] preempt_enable(); \ ^ arch/x86/kernel/cpu/aperfmperf.c:57:2: note: in expansion of macro 'put_cpu_var' put_cpu_var(samples); ^ In file included from include/uapi/linux/stddef.h:1:0, from include/linux/stddef.h:4, from include/uapi/linux/posix_types.h:4, from include/uapi/linux/types.h:13, from include/linux/types.h:5, from include/linux/smp.h:10, from arch/x86/kernel/cpu/aperfmperf.c:11: arch/x86/kernel/cpu/aperfmperf.c: In function 'aperfmperf_khz_on_cpu': arch/x86/kernel/cpu/aperfmperf.c:62:7: error: 'cpu_khz' undeclared (first use in this function) if (!cpu_khz) ^ include/linux/compiler.h:147:28: note: in definition of macro '__trace_if' if (__builtin_constant_p((cond)) ? !!(cond) : \ ^ arch/x86/kernel/cpu/aperfmperf.c:62:2: note: in expansion of macro 'if' if (!cpu_khz) ^ cc1: some warnings being treated as errors vim +/if +35 arch/x86/kernel/cpu/aperfmperf.c 5 * Copyright (C) 2015 Intel Corp. 6 * Author: Len Brown <len.brown@xxxxxxxxx> 7 * 8 * This file is licensed under GPLv2. 9 */ 10 > 11 #include <linux/smp.h> 12 13 struct aperfmperf_sample { 14 unsigned int khz; 15 unsigned long jiffies; 16 unsigned long long aperf; 17 unsigned long long mperf; 18 }; 19 20 static DEFINE_PER_CPU(struct aperfmperf_sample, samples); 21 22 /* 23 * aperfmperf_snapshot_khz() 24 * On the current CPU, snapshot APERF, MPERF, and jiffies 25 * unless we already did it within 100ms 26 * calculate kHz, save snapshot 27 */ 28 static void aperfmperf_snapshot_khz(void *dummy) 29 { 30 unsigned long long aperf, aperf_delta; 31 unsigned long long mperf, mperf_delta; 32 struct aperfmperf_sample *s = &get_cpu_var(samples); 33 34 /* Cache khz for 100ms */ > 35 if (time_before(jiffies, s->jiffies + HZ/10)) 36 goto out; 37 38 rdmsrl(MSR_IA32_APERF, aperf); --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation
Attachment:
.config.gz
Description: Binary data