Skip to content

Commit

Permalink
s390/oprofile: fix compile error
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Sebastian Ott authored and Martin Schwidefsky committed Jul 1, 2015
1 parent a313bdc commit a215c8f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions arch/s390/include/asm/perf_event.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,15 @@ struct sf_raw_sample {
} __packed;

/* Perf hardware reserve and release functions */
#ifdef CONFIG_PERF_EVENTS
int perf_reserve_sampling(void);
void perf_release_sampling(void);
#else /* CONFIG_PERF_EVENTS */
static inline int perf_reserve_sampling(void)
{
return 0;
}
static inline void perf_release_sampling(void) {}
#endif /* CONFIG_PERF_EVENTS */

#endif /* _ASM_S390_PERF_EVENT_H */
1 change: 1 addition & 0 deletions arch/s390/oprofile/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include <linux/fs.h>
#include <linux/module.h>
#include <asm/processor.h>
#include <asm/perf_event.h>

#include "../../../drivers/oprofile/oprof.h"

Expand Down

0 comments on commit a215c8f

Please sign in to comment.