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_DOORBELL
58 DEFINE_EVENT(ppc64_interrupt_class, doorbell_entry,
60 TP_PROTO(struct pt_regs *regs),
65 DEFINE_EVENT(ppc64_interrupt_class, doorbell_exit,
67 TP_PROTO(struct pt_regs *regs),
73 #ifdef CONFIG_PPC_PSERIES
74 extern int hcall_tracepoint_regfunc(void);
75 extern void hcall_tracepoint_unregfunc(void);
77 TRACE_EVENT_FN_COND(hcall_entry,
79 TP_PROTO(unsigned long opcode, unsigned long *args),
81 TP_ARGS(opcode, args),
83 TP_CONDITION(cpu_online(raw_smp_processor_id())),
86 __field(unsigned long, opcode)
90 __entry->opcode = opcode;
93 TP_printk("opcode=%lu", __entry->opcode),
95 hcall_tracepoint_regfunc, hcall_tracepoint_unregfunc
98 TRACE_EVENT_FN_COND(hcall_exit,
100 TP_PROTO(unsigned long opcode, long retval, unsigned long *retbuf),
102 TP_ARGS(opcode, retval, retbuf),
104 TP_CONDITION(cpu_online(raw_smp_processor_id())),
107 __field(unsigned long, opcode)
108 __field(long, retval)
112 __entry->opcode = opcode;
113 __entry->retval = retval;
116 TP_printk("opcode=%lu retval=%ld", __entry->opcode, __entry->retval),
118 hcall_tracepoint_regfunc, hcall_tracepoint_unregfunc
122 #ifdef CONFIG_PPC_POWERNV
123 extern int opal_tracepoint_regfunc(void);
124 extern void opal_tracepoint_unregfunc(void);
126 TRACE_EVENT_FN(opal_entry,
128 TP_PROTO(unsigned long opcode, unsigned long *args),
130 TP_ARGS(opcode, args),
133 __field(unsigned long, opcode)
137 __entry->opcode = opcode;
140 TP_printk("opcode=%lu", __entry->opcode),
142 opal_tracepoint_regfunc, opal_tracepoint_unregfunc
145 TRACE_EVENT_FN(opal_exit,
147 TP_PROTO(unsigned long opcode, unsigned long retval),
149 TP_ARGS(opcode, retval),
152 __field(unsigned long, opcode)
153 __field(unsigned long, retval)
157 __entry->opcode = opcode;
158 __entry->retval = retval;
161 TP_printk("opcode=%lu retval=%lu", __entry->opcode, __entry->retval),
163 opal_tracepoint_regfunc, opal_tracepoint_unregfunc
167 TRACE_EVENT(hash_fault,
169 TP_PROTO(unsigned long addr, unsigned long access, unsigned long trap),
170 TP_ARGS(addr, access, trap),
172 __field(unsigned long, addr)
173 __field(unsigned long, access)
174 __field(unsigned long, trap)
178 __entry->addr = addr;
179 __entry->access = access;
180 __entry->trap = trap;
183 TP_printk("hash fault with addr 0x%lx and access = 0x%lx trap = 0x%lx",
184 __entry->addr, __entry->access, __entry->trap)
190 TP_PROTO(unsigned long lpid, unsigned long local, unsigned long rb,
191 unsigned long rs, unsigned long ric, unsigned long prs,
193 TP_ARGS(lpid, local, rb, rs, ric, prs, r),
195 __field(unsigned long, lpid)
196 __field(unsigned long, local)
197 __field(unsigned long, rb)
198 __field(unsigned long, rs)
199 __field(unsigned long, ric)
200 __field(unsigned long, prs)
201 __field(unsigned long, r)
205 __entry->lpid = lpid;
206 __entry->local = local;
214 TP_printk("lpid=%ld, local=%ld, rb=0x%lx, rs=0x%lx, ric=0x%lx, "
215 "prs=0x%lx, r=0x%lx", __entry->lpid, __entry->local,
216 __entry->rb, __entry->rs, __entry->ric, __entry->prs,
222 TP_PROTO(unsigned long id),
225 __field(unsigned long, id)
232 TP_printk("ctx.id=0x%lx", __entry->id)
235 #endif /* _TRACE_POWERPC_H */
237 #undef TRACE_INCLUDE_PATH
238 #undef TRACE_INCLUDE_FILE
240 #define TRACE_INCLUDE_PATH asm
241 #define TRACE_INCLUDE_FILE trace
243 #include <trace/define_trace.h>