2019-05-27 13:55:01 +07:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
2009-01-09 13:01:53 +07:00
|
|
|
/*
|
2010-02-26 07:09:45 +07:00
|
|
|
* Performance event support - hardware-specific disambiguation
|
2009-01-09 13:01:53 +07:00
|
|
|
*
|
2010-02-26 07:09:45 +07: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 13:01:53 +07:00
|
|
|
*/
|
2009-06-17 18:52:09 +07:00
|
|
|
|
2009-06-17 18:50:04 +07:00
|
|
|
#ifdef CONFIG_PPC_PERF_CTRS
|
2010-02-26 07:09:45 +07:00
|
|
|
#include <asm/perf_event_server.h>
|
2009-06-17 18:50:04 +07:00
|
|
|
#endif
|
|
|
|
|
2010-02-26 07:09:45 +07:00
|
|
|
#ifdef CONFIG_FSL_EMB_PERF_EVENT
|
|
|
|
#include <asm/perf_event_fsl_emb.h>
|
|
|
|
#endif
|
2010-05-20 12:47:21 +07:00
|
|
|
|
|
|
|
#ifdef CONFIG_PERF_EVENTS
|
|
|
|
#include <asm/ptrace.h>
|
|
|
|
#include <asm/reg.h>
|
|
|
|
|
2018-12-06 16:27:01 +07:00
|
|
|
#define perf_arch_bpf_user_pt_regs(regs) ®s->user_regs
|
|
|
|
|
2012-06-26 08:01:36 +07: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 12:47:21 +07:00
|
|
|
#define perf_arch_fetch_caller_regs(regs, __ip) \
|
|
|
|
do { \
|
2012-06-26 08:01:36 +07:00
|
|
|
(regs)->result = 0; \
|
2010-05-20 12:47:21 +07:00
|
|
|
(regs)->nip = __ip; \
|
2014-10-13 15:41:39 +07:00
|
|
|
(regs)->gpr[1] = current_stack_pointer(); \
|
2010-05-20 12:47:21 +07:00
|
|
|
asm volatile("mfmsr %0" : "=r" ((regs)->msr)); \
|
|
|
|
} while (0)
|
2018-12-09 16:25:35 +07:00
|
|
|
|
|
|
|
/* To support perf_regs sier update */
|
|
|
|
extern bool is_sier_available(void);
|
2010-05-20 12:47:21 +07:00
|
|
|
#endif
|