Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

s390/oprofile: fix compile error

Fix these errors when compiling with CONFIG_OPROFILE=y and
CONFIG_PERF_EVENTS=n:
arch/s390/oprofile/init.c: In function ‘oprofile_hwsampler_start’:
arch/s390/oprofile/init.c:93:2: error: implicit declaration of function 'perf_reserve_sampling' [-Werror=implicit-function-declaration]
retval = perf_reserve_sampling();
^
arch/s390/oprofile/init.c:99:3: error: implicit declaration of function 'perf_release_sampling' [-Werror=implicit-function-declaration]
perf_release_sampling();
^

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>

authored by

Sebastian Ott and committed by
Martin Schwidefsky
a215c8fb a313bdc5

+9
+8
arch/s390/include/asm/perf_event.h
··· 87 87 } __packed; 88 88 89 89 /* Perf hardware reserve and release functions */ 90 + #ifdef CONFIG_PERF_EVENTS 90 91 int perf_reserve_sampling(void); 91 92 void perf_release_sampling(void); 93 + #else /* CONFIG_PERF_EVENTS */ 94 + static inline int perf_reserve_sampling(void) 95 + { 96 + return 0; 97 + } 98 + static inline void perf_release_sampling(void) {} 99 + #endif /* CONFIG_PERF_EVENTS */ 92 100 93 101 #endif /* _ASM_S390_PERF_EVENT_H */
+1
arch/s390/oprofile/init.c
··· 16 16 #include <linux/fs.h> 17 17 #include <linux/module.h> 18 18 #include <asm/processor.h> 19 + #include <asm/perf_event.h> 19 20 20 21 #include "../../../drivers/oprofile/oprof.h" 21 22