1 /* SPDX-License-Identifier: GPL-2.0 */
3 #define TRACE_SYSTEM powerpc
5 #if !defined(_TRACE_POWERPC_H) || defined(TRACE_HEADER_MULTI_READ)
6 #define _TRACE_POWERPC_H
8 #include <linux/tracepoint.h>
12 DECLARE_EVENT_CLASS(ppc64_interrupt_class
,
14 TP_PROTO(struct pt_regs
*regs
),
19 __field(struct pt_regs
*, regs
)
26 TP_printk("pt_regs=%p", __entry
->regs
)
29 DEFINE_EVENT(ppc64_interrupt_class
, irq_entry
,
31 TP_PROTO(struct pt_regs
*regs
),
36 DEFINE_EVENT(ppc64_interrupt_class
, irq_exit
,
38 TP_PROTO(struct pt_regs
*regs
),
43 DEFINE_EVENT(ppc64_interrupt_class
, timer_interrupt_entry
,
45 TP_PROTO(struct pt_regs
*regs
),
50 DEFINE_EVENT(ppc64_interrupt_class
, timer_interrupt_exit
,
52 TP_PROTO(struct pt_regs
*regs
),
57 #ifdef CONFIG_PPC_PSERIES
58 extern int hcall_tracepoint_regfunc(void);
59 extern void hcall_tracepoint_unregfunc(void);
61 TRACE_EVENT_FN_COND(hcall_entry
,
63 TP_PROTO(unsigned long opcode
, unsigned long *args
),
65 TP_ARGS(opcode
, args
),
67 TP_CONDITION(cpu_online(raw_smp_processor_id())),
70 __field(unsigned long, opcode
)
74 __entry
->opcode
= opcode
;
77 TP_printk("opcode=%lu", __entry
->opcode
),
79 hcall_tracepoint_regfunc
, hcall_tracepoint_unregfunc
82 TRACE_EVENT_FN_COND(hcall_exit
,
84 TP_PROTO(unsigned long opcode
, unsigned long retval
,
85 unsigned long *retbuf
),
87 TP_ARGS(opcode
, retval
, retbuf
),
89 TP_CONDITION(cpu_online(raw_smp_processor_id())),
92 __field(unsigned long, opcode
)
93 __field(unsigned long, retval
)
97 __entry
->opcode
= opcode
;
98 __entry
->retval
= retval
;
101 TP_printk("opcode=%lu retval=%lu", __entry
->opcode
, __entry
->retval
),
103 hcall_tracepoint_regfunc
, hcall_tracepoint_unregfunc
107 #ifdef CONFIG_PPC_POWERNV
108 extern int opal_tracepoint_regfunc(void);
109 extern void opal_tracepoint_unregfunc(void);
111 TRACE_EVENT_FN(opal_entry
,
113 TP_PROTO(unsigned long opcode
, unsigned long *args
),
115 TP_ARGS(opcode
, args
),
118 __field(unsigned long, opcode
)
122 __entry
->opcode
= opcode
;
125 TP_printk("opcode=%lu", __entry
->opcode
),
127 opal_tracepoint_regfunc
, opal_tracepoint_unregfunc
130 TRACE_EVENT_FN(opal_exit
,
132 TP_PROTO(unsigned long opcode
, unsigned long retval
),
134 TP_ARGS(opcode
, retval
),
137 __field(unsigned long, opcode
)
138 __field(unsigned long, retval
)
142 __entry
->opcode
= opcode
;
143 __entry
->retval
= retval
;
146 TP_printk("opcode=%lu retval=%lu", __entry
->opcode
, __entry
->retval
),
148 opal_tracepoint_regfunc
, opal_tracepoint_unregfunc
152 TRACE_EVENT(hash_fault
,
154 TP_PROTO(unsigned long addr
, unsigned long access
, unsigned long trap
),
155 TP_ARGS(addr
, access
, trap
),
157 __field(unsigned long, addr
)
158 __field(unsigned long, access
)
159 __field(unsigned long, trap
)
163 __entry
->addr
= addr
;
164 __entry
->access
= access
;
165 __entry
->trap
= trap
;
168 TP_printk("hash fault with addr 0x%lx and access = 0x%lx trap = 0x%lx",
169 __entry
->addr
, __entry
->access
, __entry
->trap
)
175 TP_PROTO(unsigned long lpid
, unsigned long local
, unsigned long rb
,
176 unsigned long rs
, unsigned long ric
, unsigned long prs
,
178 TP_ARGS(lpid
, local
, rb
, rs
, ric
, prs
, r
),
180 __field(unsigned long, lpid
)
181 __field(unsigned long, local
)
182 __field(unsigned long, rb
)
183 __field(unsigned long, rs
)
184 __field(unsigned long, ric
)
185 __field(unsigned long, prs
)
186 __field(unsigned long, r
)
190 __entry
->lpid
= lpid
;
191 __entry
->local
= local
;
199 TP_printk("lpid=%ld, local=%ld, rb=0x%lx, rs=0x%lx, ric=0x%lx, "
200 "prs=0x%lx, r=0x%lx", __entry
->lpid
, __entry
->local
,
201 __entry
->rb
, __entry
->rs
, __entry
->ric
, __entry
->prs
,
205 #endif /* _TRACE_POWERPC_H */
207 #undef TRACE_INCLUDE_PATH
208 #undef TRACE_INCLUDE_FILE
210 #define TRACE_INCLUDE_PATH asm
211 #define TRACE_INCLUDE_FILE trace
213 #include <trace/define_trace.h>