treewide: remove redundant IS_ERR() before error code check
[linux/fpc-iii.git] / arch / powerpc / include / asm / trace.h
blob08cd60cd70b74eb951efe581f3a8c2f49479e694
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #undef TRACE_SYSTEM
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>
10 struct pt_regs;
12 DECLARE_EVENT_CLASS(ppc64_interrupt_class,
14 TP_PROTO(struct pt_regs *regs),
16 TP_ARGS(regs),
18 TP_STRUCT__entry(
19 __field(struct pt_regs *, regs)
22 TP_fast_assign(
23 __entry->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),
33 TP_ARGS(regs)
36 DEFINE_EVENT(ppc64_interrupt_class, irq_exit,
38 TP_PROTO(struct pt_regs *regs),
40 TP_ARGS(regs)
43 DEFINE_EVENT(ppc64_interrupt_class, timer_interrupt_entry,
45 TP_PROTO(struct pt_regs *regs),
47 TP_ARGS(regs)
50 DEFINE_EVENT(ppc64_interrupt_class, timer_interrupt_exit,
52 TP_PROTO(struct pt_regs *regs),
54 TP_ARGS(regs)
57 #ifdef CONFIG_PPC_DOORBELL
58 DEFINE_EVENT(ppc64_interrupt_class, doorbell_entry,
60 TP_PROTO(struct pt_regs *regs),
62 TP_ARGS(regs)
65 DEFINE_EVENT(ppc64_interrupt_class, doorbell_exit,
67 TP_PROTO(struct pt_regs *regs),
69 TP_ARGS(regs)
71 #endif
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())),
85 TP_STRUCT__entry(
86 __field(unsigned long, opcode)
89 TP_fast_assign(
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())),
106 TP_STRUCT__entry(
107 __field(unsigned long, opcode)
108 __field(long, retval)
111 TP_fast_assign(
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
120 #endif
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),
132 TP_STRUCT__entry(
133 __field(unsigned long, opcode)
136 TP_fast_assign(
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),
151 TP_STRUCT__entry(
152 __field(unsigned long, opcode)
153 __field(unsigned long, retval)
156 TP_fast_assign(
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
165 #endif
167 TRACE_EVENT(hash_fault,
169 TP_PROTO(unsigned long addr, unsigned long access, unsigned long trap),
170 TP_ARGS(addr, access, trap),
171 TP_STRUCT__entry(
172 __field(unsigned long, addr)
173 __field(unsigned long, access)
174 __field(unsigned long, trap)
177 TP_fast_assign(
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)
188 TRACE_EVENT(tlbie,
190 TP_PROTO(unsigned long lpid, unsigned long local, unsigned long rb,
191 unsigned long rs, unsigned long ric, unsigned long prs,
192 unsigned long r),
193 TP_ARGS(lpid, local, rb, rs, ric, prs, r),
194 TP_STRUCT__entry(
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)
204 TP_fast_assign(
205 __entry->lpid = lpid;
206 __entry->local = local;
207 __entry->rb = rb;
208 __entry->rs = rs;
209 __entry->ric = ric;
210 __entry->prs = prs;
211 __entry->r = r;
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,
217 __entry->r)
220 TRACE_EVENT(tlbia,
222 TP_PROTO(unsigned long id),
223 TP_ARGS(id),
224 TP_STRUCT__entry(
225 __field(unsigned long, id)
228 TP_fast_assign(
229 __entry->id = 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>