2019-05-27 08:55:01 +02:00
/* SPDX-License-Identifier: GPL-2.0-or-later */
2009-01-09 17:01:53 +11:00
/*
2010-02-25 18:09:45 -06:00
* Performance event support - hardware - specific disambiguation
2009-01-09 17:01:53 +11:00
*
2010-02-25 18:09:45 -06:00
* For now this is a compile - time decision , but eventually it should be
* runtime . This would allow multiplatform perf event support for e300 ( fsl
* embedded perf counters ) plus server / classic , and would accommodate
* devices other than the core which provide their own performance counters .
*
* Copyright 2010 Freescale Semiconductor , Inc .
2009-01-09 17:01:53 +11:00
*/
2009-06-17 21:52:09 +10:00
2009-06-17 21:50:04 +10:00
# ifdef CONFIG_PPC_PERF_CTRS
2010-02-25 18:09:45 -06:00
# include <asm/perf_event_server.h>
2020-06-14 14:06:04 +05:30
# else
static inline bool is_sier_available ( void ) { return false ; }
2021-02-03 01:55:36 -05:00
static inline unsigned long get_pmcs_ext_regs ( int idx ) { return 0 ; }
2009-06-17 21:50:04 +10:00
# endif
2010-02-25 18:09:45 -06:00
# ifdef CONFIG_FSL_EMB_PERF_EVENT
# include <asm/perf_event_fsl_emb.h>
# endif
2010-05-20 07:47:21 +02:00
# ifdef CONFIG_PERF_EVENTS
# include <asm/ptrace.h>
# include <asm/reg.h>
2018-12-06 14:57:01 +05:30
# define perf_arch_bpf_user_pt_regs(regs) ®s->user_regs
2012-06-26 01:01:36 +00:00
/*
* Overload regs - > result to specify whether we should use the MSR ( result
* is zero ) or the SIAR ( result is non zero ) .
*/
2010-05-20 07:47:21 +02:00
# define perf_arch_fetch_caller_regs(regs, __ip) \
do { \
2012-06-26 01:01:36 +00:00
( regs ) - > result = 0 ; \
2010-05-20 07:47:21 +02:00
( regs ) - > nip = __ip ; \
2020-02-20 22:51:37 +11:00
( regs ) - > gpr [ 1 ] = current_stack_frame ( ) ; \
2010-05-20 07:47:21 +02:00
asm volatile ( " mfmsr %0 " : " =r " ( ( regs ) - > msr ) ) ; \
} while ( 0 )
2018-12-09 14:55:35 +05:30
/* To support perf_regs sier update */
extern bool is_sier_available ( void ) ;
2021-02-03 01:55:36 -05:00
extern unsigned long get_pmcs_ext_regs ( int idx ) ;
2020-08-07 06:05:00 -04:00
/* To define perf extended regs mask value */
extern u64 PERF_REG_EXTENDED_MASK ;
# define PERF_REG_EXTENDED_MASK PERF_REG_EXTENDED_MASK
2010-05-20 07:47:21 +02:00
# endif