blob: 33f3b479138bc185be2811485d7f8d6492e7a4ba [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Anton Blanchard1bf4af12009-10-26 18:47:42 +00002#undef TRACE_SYSTEM
3#define TRACE_SYSTEM powerpc
4
5#if !defined(_TRACE_POWERPC_H) || defined(TRACE_HEADER_MULTI_READ)
6#define _TRACE_POWERPC_H
7
8#include <linux/tracepoint.h>
9
10struct pt_regs;
11
Anton Blanchardd136e272012-05-22 18:47:48 +000012DECLARE_EVENT_CLASS(ppc64_interrupt_class,
Anton Blanchard1bf4af12009-10-26 18:47:42 +000013
14 TP_PROTO(struct pt_regs *regs),
15
16 TP_ARGS(regs),
17
18 TP_STRUCT__entry(
19 __field(struct pt_regs *, regs)
20 ),
21
22 TP_fast_assign(
23 __entry->regs = regs;
24 ),
25
26 TP_printk("pt_regs=%p", __entry->regs)
27);
28
Anton Blanchardd136e272012-05-22 18:47:48 +000029DEFINE_EVENT(ppc64_interrupt_class, irq_entry,
Anton Blanchard1bf4af12009-10-26 18:47:42 +000030
31 TP_PROTO(struct pt_regs *regs),
32
Anton Blanchardd136e272012-05-22 18:47:48 +000033 TP_ARGS(regs)
Anton Blanchard1bf4af12009-10-26 18:47:42 +000034);
35
Anton Blanchardd136e272012-05-22 18:47:48 +000036DEFINE_EVENT(ppc64_interrupt_class, irq_exit,
Anton Blanchard6795b852009-10-26 18:49:14 +000037
38 TP_PROTO(struct pt_regs *regs),
39
Anton Blanchardd136e272012-05-22 18:47:48 +000040 TP_ARGS(regs)
Anton Blanchard6795b852009-10-26 18:49:14 +000041);
42
Anton Blanchardd136e272012-05-22 18:47:48 +000043DEFINE_EVENT(ppc64_interrupt_class, timer_interrupt_entry,
Anton Blanchard6795b852009-10-26 18:49:14 +000044
45 TP_PROTO(struct pt_regs *regs),
46
Anton Blanchardd136e272012-05-22 18:47:48 +000047 TP_ARGS(regs)
48);
Anton Blanchard6795b852009-10-26 18:49:14 +000049
Anton Blanchardd136e272012-05-22 18:47:48 +000050DEFINE_EVENT(ppc64_interrupt_class, timer_interrupt_exit,
Anton Blanchard6795b852009-10-26 18:49:14 +000051
Anton Blanchardd136e272012-05-22 18:47:48 +000052 TP_PROTO(struct pt_regs *regs),
Anton Blanchard6795b852009-10-26 18:49:14 +000053
Anton Blanchardd136e272012-05-22 18:47:48 +000054 TP_ARGS(regs)
Anton Blanchard6795b852009-10-26 18:49:14 +000055);
56
Anton Blanchardc8cd0932009-10-26 18:50:29 +000057#ifdef CONFIG_PPC_PSERIES
Steven Rostedt (Red Hat)8cf868a2016-11-28 13:03:21 -050058extern int hcall_tracepoint_regfunc(void);
Anton Blanchardc8cd0932009-10-26 18:50:29 +000059extern void hcall_tracepoint_unregfunc(void);
60
Denis Kirjanov126df082015-12-14 23:18:06 +030061TRACE_EVENT_FN_COND(hcall_entry,
Anton Blanchardc8cd0932009-10-26 18:50:29 +000062
Anton Blanchard6f263532009-10-26 18:51:09 +000063 TP_PROTO(unsigned long opcode, unsigned long *args),
Anton Blanchardc8cd0932009-10-26 18:50:29 +000064
Anton Blanchard6f263532009-10-26 18:51:09 +000065 TP_ARGS(opcode, args),
Anton Blanchardc8cd0932009-10-26 18:50:29 +000066
Denis Kirjanov126df082015-12-14 23:18:06 +030067 TP_CONDITION(cpu_online(raw_smp_processor_id())),
68
Anton Blanchardc8cd0932009-10-26 18:50:29 +000069 TP_STRUCT__entry(
70 __field(unsigned long, opcode)
71 ),
72
73 TP_fast_assign(
74 __entry->opcode = opcode;
75 ),
76
77 TP_printk("opcode=%lu", __entry->opcode),
78
79 hcall_tracepoint_regfunc, hcall_tracepoint_unregfunc
80);
81
Denis Kirjanov126df082015-12-14 23:18:06 +030082TRACE_EVENT_FN_COND(hcall_exit,
Anton Blanchardc8cd0932009-10-26 18:50:29 +000083
Anton Blanchard6f263532009-10-26 18:51:09 +000084 TP_PROTO(unsigned long opcode, unsigned long retval,
85 unsigned long *retbuf),
Anton Blanchardc8cd0932009-10-26 18:50:29 +000086
Anton Blanchard6f263532009-10-26 18:51:09 +000087 TP_ARGS(opcode, retval, retbuf),
Anton Blanchardc8cd0932009-10-26 18:50:29 +000088
Denis Kirjanov126df082015-12-14 23:18:06 +030089 TP_CONDITION(cpu_online(raw_smp_processor_id())),
90
Anton Blanchardc8cd0932009-10-26 18:50:29 +000091 TP_STRUCT__entry(
92 __field(unsigned long, opcode)
93 __field(unsigned long, retval)
94 ),
95
96 TP_fast_assign(
97 __entry->opcode = opcode;
98 __entry->retval = retval;
99 ),
100
101 TP_printk("opcode=%lu retval=%lu", __entry->opcode, __entry->retval),
102
103 hcall_tracepoint_regfunc, hcall_tracepoint_unregfunc
104);
105#endif
106
Anton Blanchardc49f6352014-07-03 17:20:50 +1000107#ifdef CONFIG_PPC_POWERNV
Steven Rostedt (Red Hat)8cf868a2016-11-28 13:03:21 -0500108extern int opal_tracepoint_regfunc(void);
Anton Blanchardc49f6352014-07-03 17:20:50 +1000109extern void opal_tracepoint_unregfunc(void);
110
111TRACE_EVENT_FN(opal_entry,
112
113 TP_PROTO(unsigned long opcode, unsigned long *args),
114
115 TP_ARGS(opcode, args),
116
117 TP_STRUCT__entry(
118 __field(unsigned long, opcode)
119 ),
120
121 TP_fast_assign(
122 __entry->opcode = opcode;
123 ),
124
125 TP_printk("opcode=%lu", __entry->opcode),
126
127 opal_tracepoint_regfunc, opal_tracepoint_unregfunc
128);
129
130TRACE_EVENT_FN(opal_exit,
131
132 TP_PROTO(unsigned long opcode, unsigned long retval),
133
134 TP_ARGS(opcode, retval),
135
136 TP_STRUCT__entry(
137 __field(unsigned long, opcode)
138 __field(unsigned long, retval)
139 ),
140
141 TP_fast_assign(
142 __entry->opcode = opcode;
143 __entry->retval = retval;
144 ),
145
146 TP_printk("opcode=%lu retval=%lu", __entry->opcode, __entry->retval),
147
148 opal_tracepoint_regfunc, opal_tracepoint_unregfunc
149);
150#endif
151
Aneesh Kumar K.Vcfcb3d82015-04-14 13:05:57 +0530152TRACE_EVENT(hash_fault,
153
154 TP_PROTO(unsigned long addr, unsigned long access, unsigned long trap),
155 TP_ARGS(addr, access, trap),
156 TP_STRUCT__entry(
157 __field(unsigned long, addr)
158 __field(unsigned long, access)
159 __field(unsigned long, trap)
160 ),
161
162 TP_fast_assign(
163 __entry->addr = addr;
164 __entry->access = access;
165 __entry->trap = trap;
166 ),
167
168 TP_printk("hash fault with addr 0x%lx and access = 0x%lx trap = 0x%lx",
169 __entry->addr, __entry->access, __entry->trap)
170);
171
Balbir Singh04284912017-04-11 15:23:25 +1000172
173TRACE_EVENT(tlbie,
174
175 TP_PROTO(unsigned long lpid, unsigned long local, unsigned long rb,
176 unsigned long rs, unsigned long ric, unsigned long prs,
177 unsigned long r),
178 TP_ARGS(lpid, local, rb, rs, ric, prs, r),
179 TP_STRUCT__entry(
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)
187 ),
188
189 TP_fast_assign(
190 __entry->lpid = lpid;
191 __entry->local = local;
192 __entry->rb = rb;
193 __entry->rs = rs;
194 __entry->ric = ric;
195 __entry->prs = prs;
196 __entry->r = r;
197 ),
198
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,
202 __entry->r)
203);
204
Anton Blanchard1bf4af12009-10-26 18:47:42 +0000205#endif /* _TRACE_POWERPC_H */
206
207#undef TRACE_INCLUDE_PATH
208#undef TRACE_INCLUDE_FILE
209
210#define TRACE_INCLUDE_PATH asm
211#define TRACE_INCLUDE_FILE trace
212
213#include <trace/define_trace.h>