Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
Anton Blanchard | 1bf4af1 | 2009-10-26 18:47:42 +0000 | [diff] [blame] | 2 | #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 | |
| 10 | struct pt_regs; |
| 11 | |
Anton Blanchard | d136e27 | 2012-05-22 18:47:48 +0000 | [diff] [blame] | 12 | DECLARE_EVENT_CLASS(ppc64_interrupt_class, |
Anton Blanchard | 1bf4af1 | 2009-10-26 18:47:42 +0000 | [diff] [blame] | 13 | |
| 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 Blanchard | d136e27 | 2012-05-22 18:47:48 +0000 | [diff] [blame] | 29 | DEFINE_EVENT(ppc64_interrupt_class, irq_entry, |
Anton Blanchard | 1bf4af1 | 2009-10-26 18:47:42 +0000 | [diff] [blame] | 30 | |
| 31 | TP_PROTO(struct pt_regs *regs), |
| 32 | |
Anton Blanchard | d136e27 | 2012-05-22 18:47:48 +0000 | [diff] [blame] | 33 | TP_ARGS(regs) |
Anton Blanchard | 1bf4af1 | 2009-10-26 18:47:42 +0000 | [diff] [blame] | 34 | ); |
| 35 | |
Anton Blanchard | d136e27 | 2012-05-22 18:47:48 +0000 | [diff] [blame] | 36 | DEFINE_EVENT(ppc64_interrupt_class, irq_exit, |
Anton Blanchard | 6795b85 | 2009-10-26 18:49:14 +0000 | [diff] [blame] | 37 | |
| 38 | TP_PROTO(struct pt_regs *regs), |
| 39 | |
Anton Blanchard | d136e27 | 2012-05-22 18:47:48 +0000 | [diff] [blame] | 40 | TP_ARGS(regs) |
Anton Blanchard | 6795b85 | 2009-10-26 18:49:14 +0000 | [diff] [blame] | 41 | ); |
| 42 | |
Anton Blanchard | d136e27 | 2012-05-22 18:47:48 +0000 | [diff] [blame] | 43 | DEFINE_EVENT(ppc64_interrupt_class, timer_interrupt_entry, |
Anton Blanchard | 6795b85 | 2009-10-26 18:49:14 +0000 | [diff] [blame] | 44 | |
| 45 | TP_PROTO(struct pt_regs *regs), |
| 46 | |
Anton Blanchard | d136e27 | 2012-05-22 18:47:48 +0000 | [diff] [blame] | 47 | TP_ARGS(regs) |
| 48 | ); |
Anton Blanchard | 6795b85 | 2009-10-26 18:49:14 +0000 | [diff] [blame] | 49 | |
Anton Blanchard | d136e27 | 2012-05-22 18:47:48 +0000 | [diff] [blame] | 50 | DEFINE_EVENT(ppc64_interrupt_class, timer_interrupt_exit, |
Anton Blanchard | 6795b85 | 2009-10-26 18:49:14 +0000 | [diff] [blame] | 51 | |
Anton Blanchard | d136e27 | 2012-05-22 18:47:48 +0000 | [diff] [blame] | 52 | TP_PROTO(struct pt_regs *regs), |
Anton Blanchard | 6795b85 | 2009-10-26 18:49:14 +0000 | [diff] [blame] | 53 | |
Anton Blanchard | d136e27 | 2012-05-22 18:47:48 +0000 | [diff] [blame] | 54 | TP_ARGS(regs) |
Anton Blanchard | 6795b85 | 2009-10-26 18:49:14 +0000 | [diff] [blame] | 55 | ); |
| 56 | |
Anton Blanchard | c8cd093 | 2009-10-26 18:50:29 +0000 | [diff] [blame] | 57 | #ifdef CONFIG_PPC_PSERIES |
Steven Rostedt (Red Hat) | 8cf868a | 2016-11-28 13:03:21 -0500 | [diff] [blame] | 58 | extern int hcall_tracepoint_regfunc(void); |
Anton Blanchard | c8cd093 | 2009-10-26 18:50:29 +0000 | [diff] [blame] | 59 | extern void hcall_tracepoint_unregfunc(void); |
| 60 | |
Denis Kirjanov | 126df08 | 2015-12-14 23:18:06 +0300 | [diff] [blame] | 61 | TRACE_EVENT_FN_COND(hcall_entry, |
Anton Blanchard | c8cd093 | 2009-10-26 18:50:29 +0000 | [diff] [blame] | 62 | |
Anton Blanchard | 6f26353 | 2009-10-26 18:51:09 +0000 | [diff] [blame] | 63 | TP_PROTO(unsigned long opcode, unsigned long *args), |
Anton Blanchard | c8cd093 | 2009-10-26 18:50:29 +0000 | [diff] [blame] | 64 | |
Anton Blanchard | 6f26353 | 2009-10-26 18:51:09 +0000 | [diff] [blame] | 65 | TP_ARGS(opcode, args), |
Anton Blanchard | c8cd093 | 2009-10-26 18:50:29 +0000 | [diff] [blame] | 66 | |
Denis Kirjanov | 126df08 | 2015-12-14 23:18:06 +0300 | [diff] [blame] | 67 | TP_CONDITION(cpu_online(raw_smp_processor_id())), |
| 68 | |
Anton Blanchard | c8cd093 | 2009-10-26 18:50:29 +0000 | [diff] [blame] | 69 | 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 Kirjanov | 126df08 | 2015-12-14 23:18:06 +0300 | [diff] [blame] | 82 | TRACE_EVENT_FN_COND(hcall_exit, |
Anton Blanchard | c8cd093 | 2009-10-26 18:50:29 +0000 | [diff] [blame] | 83 | |
Anton Blanchard | 6f26353 | 2009-10-26 18:51:09 +0000 | [diff] [blame] | 84 | TP_PROTO(unsigned long opcode, unsigned long retval, |
| 85 | unsigned long *retbuf), |
Anton Blanchard | c8cd093 | 2009-10-26 18:50:29 +0000 | [diff] [blame] | 86 | |
Anton Blanchard | 6f26353 | 2009-10-26 18:51:09 +0000 | [diff] [blame] | 87 | TP_ARGS(opcode, retval, retbuf), |
Anton Blanchard | c8cd093 | 2009-10-26 18:50:29 +0000 | [diff] [blame] | 88 | |
Denis Kirjanov | 126df08 | 2015-12-14 23:18:06 +0300 | [diff] [blame] | 89 | TP_CONDITION(cpu_online(raw_smp_processor_id())), |
| 90 | |
Anton Blanchard | c8cd093 | 2009-10-26 18:50:29 +0000 | [diff] [blame] | 91 | 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 Blanchard | c49f635 | 2014-07-03 17:20:50 +1000 | [diff] [blame] | 107 | #ifdef CONFIG_PPC_POWERNV |
Steven Rostedt (Red Hat) | 8cf868a | 2016-11-28 13:03:21 -0500 | [diff] [blame] | 108 | extern int opal_tracepoint_regfunc(void); |
Anton Blanchard | c49f635 | 2014-07-03 17:20:50 +1000 | [diff] [blame] | 109 | extern void opal_tracepoint_unregfunc(void); |
| 110 | |
| 111 | TRACE_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 | |
| 130 | TRACE_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.V | cfcb3d8 | 2015-04-14 13:05:57 +0530 | [diff] [blame] | 152 | TRACE_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 Singh | 0428491 | 2017-04-11 15:23:25 +1000 | [diff] [blame] | 172 | |
| 173 | TRACE_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 Blanchard | 1bf4af1 | 2009-10-26 18:47:42 +0000 | [diff] [blame] | 205 | #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> |