Anton Blanchard | 1bf4af1 | 2009-10-26 18:47:42 +0000 | [diff] [blame] | 1 | #undef TRACE_SYSTEM |
| 2 | #define TRACE_SYSTEM powerpc |
| 3 | |
| 4 | #if !defined(_TRACE_POWERPC_H) || defined(TRACE_HEADER_MULTI_READ) |
| 5 | #define _TRACE_POWERPC_H |
| 6 | |
| 7 | #include <linux/tracepoint.h> |
| 8 | |
| 9 | struct pt_regs; |
| 10 | |
Anton Blanchard | d136e27 | 2012-05-22 18:47:48 +0000 | [diff] [blame] | 11 | DECLARE_EVENT_CLASS(ppc64_interrupt_class, |
Anton Blanchard | 1bf4af1 | 2009-10-26 18:47:42 +0000 | [diff] [blame] | 12 | |
| 13 | TP_PROTO(struct pt_regs *regs), |
| 14 | |
| 15 | TP_ARGS(regs), |
| 16 | |
| 17 | TP_STRUCT__entry( |
| 18 | __field(struct pt_regs *, regs) |
| 19 | ), |
| 20 | |
| 21 | TP_fast_assign( |
| 22 | __entry->regs = regs; |
| 23 | ), |
| 24 | |
| 25 | TP_printk("pt_regs=%p", __entry->regs) |
| 26 | ); |
| 27 | |
Anton Blanchard | d136e27 | 2012-05-22 18:47:48 +0000 | [diff] [blame] | 28 | DEFINE_EVENT(ppc64_interrupt_class, irq_entry, |
Anton Blanchard | 1bf4af1 | 2009-10-26 18:47:42 +0000 | [diff] [blame] | 29 | |
| 30 | TP_PROTO(struct pt_regs *regs), |
| 31 | |
Anton Blanchard | d136e27 | 2012-05-22 18:47:48 +0000 | [diff] [blame] | 32 | TP_ARGS(regs) |
Anton Blanchard | 1bf4af1 | 2009-10-26 18:47:42 +0000 | [diff] [blame] | 33 | ); |
| 34 | |
Anton Blanchard | d136e27 | 2012-05-22 18:47:48 +0000 | [diff] [blame] | 35 | DEFINE_EVENT(ppc64_interrupt_class, irq_exit, |
Anton Blanchard | 6795b85 | 2009-10-26 18:49:14 +0000 | [diff] [blame] | 36 | |
| 37 | TP_PROTO(struct pt_regs *regs), |
| 38 | |
Anton Blanchard | d136e27 | 2012-05-22 18:47:48 +0000 | [diff] [blame] | 39 | TP_ARGS(regs) |
Anton Blanchard | 6795b85 | 2009-10-26 18:49:14 +0000 | [diff] [blame] | 40 | ); |
| 41 | |
Anton Blanchard | d136e27 | 2012-05-22 18:47:48 +0000 | [diff] [blame] | 42 | DEFINE_EVENT(ppc64_interrupt_class, timer_interrupt_entry, |
Anton Blanchard | 6795b85 | 2009-10-26 18:49:14 +0000 | [diff] [blame] | 43 | |
| 44 | TP_PROTO(struct pt_regs *regs), |
| 45 | |
Anton Blanchard | d136e27 | 2012-05-22 18:47:48 +0000 | [diff] [blame] | 46 | TP_ARGS(regs) |
| 47 | ); |
Anton Blanchard | 6795b85 | 2009-10-26 18:49:14 +0000 | [diff] [blame] | 48 | |
Anton Blanchard | d136e27 | 2012-05-22 18:47:48 +0000 | [diff] [blame] | 49 | DEFINE_EVENT(ppc64_interrupt_class, timer_interrupt_exit, |
Anton Blanchard | 6795b85 | 2009-10-26 18:49:14 +0000 | [diff] [blame] | 50 | |
Anton Blanchard | d136e27 | 2012-05-22 18:47:48 +0000 | [diff] [blame] | 51 | TP_PROTO(struct pt_regs *regs), |
Anton Blanchard | 6795b85 | 2009-10-26 18:49:14 +0000 | [diff] [blame] | 52 | |
Anton Blanchard | d136e27 | 2012-05-22 18:47:48 +0000 | [diff] [blame] | 53 | TP_ARGS(regs) |
Anton Blanchard | 6795b85 | 2009-10-26 18:49:14 +0000 | [diff] [blame] | 54 | ); |
| 55 | |
Anton Blanchard | c8cd093 | 2009-10-26 18:50:29 +0000 | [diff] [blame] | 56 | #ifdef CONFIG_PPC_PSERIES |
| 57 | extern void hcall_tracepoint_regfunc(void); |
| 58 | extern void hcall_tracepoint_unregfunc(void); |
| 59 | |
| 60 | TRACE_EVENT_FN(hcall_entry, |
| 61 | |
Anton Blanchard | 6f26353 | 2009-10-26 18:51:09 +0000 | [diff] [blame] | 62 | TP_PROTO(unsigned long opcode, unsigned long *args), |
Anton Blanchard | c8cd093 | 2009-10-26 18:50:29 +0000 | [diff] [blame] | 63 | |
Anton Blanchard | 6f26353 | 2009-10-26 18:51:09 +0000 | [diff] [blame] | 64 | TP_ARGS(opcode, args), |
Anton Blanchard | c8cd093 | 2009-10-26 18:50:29 +0000 | [diff] [blame] | 65 | |
| 66 | TP_STRUCT__entry( |
| 67 | __field(unsigned long, opcode) |
| 68 | ), |
| 69 | |
| 70 | TP_fast_assign( |
| 71 | __entry->opcode = opcode; |
| 72 | ), |
| 73 | |
| 74 | TP_printk("opcode=%lu", __entry->opcode), |
| 75 | |
| 76 | hcall_tracepoint_regfunc, hcall_tracepoint_unregfunc |
| 77 | ); |
| 78 | |
| 79 | TRACE_EVENT_FN(hcall_exit, |
| 80 | |
Anton Blanchard | 6f26353 | 2009-10-26 18:51:09 +0000 | [diff] [blame] | 81 | TP_PROTO(unsigned long opcode, unsigned long retval, |
| 82 | unsigned long *retbuf), |
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_ARGS(opcode, retval, retbuf), |
Anton Blanchard | c8cd093 | 2009-10-26 18:50:29 +0000 | [diff] [blame] | 85 | |
| 86 | TP_STRUCT__entry( |
| 87 | __field(unsigned long, opcode) |
| 88 | __field(unsigned long, retval) |
| 89 | ), |
| 90 | |
| 91 | TP_fast_assign( |
| 92 | __entry->opcode = opcode; |
| 93 | __entry->retval = retval; |
| 94 | ), |
| 95 | |
| 96 | TP_printk("opcode=%lu retval=%lu", __entry->opcode, __entry->retval), |
| 97 | |
| 98 | hcall_tracepoint_regfunc, hcall_tracepoint_unregfunc |
| 99 | ); |
| 100 | #endif |
| 101 | |
Anton Blanchard | c49f635 | 2014-07-03 17:20:50 +1000 | [diff] [blame] | 102 | #ifdef CONFIG_PPC_POWERNV |
| 103 | extern void opal_tracepoint_regfunc(void); |
| 104 | extern void opal_tracepoint_unregfunc(void); |
| 105 | |
| 106 | TRACE_EVENT_FN(opal_entry, |
| 107 | |
| 108 | TP_PROTO(unsigned long opcode, unsigned long *args), |
| 109 | |
| 110 | TP_ARGS(opcode, args), |
| 111 | |
| 112 | TP_STRUCT__entry( |
| 113 | __field(unsigned long, opcode) |
| 114 | ), |
| 115 | |
| 116 | TP_fast_assign( |
| 117 | __entry->opcode = opcode; |
| 118 | ), |
| 119 | |
| 120 | TP_printk("opcode=%lu", __entry->opcode), |
| 121 | |
| 122 | opal_tracepoint_regfunc, opal_tracepoint_unregfunc |
| 123 | ); |
| 124 | |
| 125 | TRACE_EVENT_FN(opal_exit, |
| 126 | |
| 127 | TP_PROTO(unsigned long opcode, unsigned long retval), |
| 128 | |
| 129 | TP_ARGS(opcode, retval), |
| 130 | |
| 131 | TP_STRUCT__entry( |
| 132 | __field(unsigned long, opcode) |
| 133 | __field(unsigned long, retval) |
| 134 | ), |
| 135 | |
| 136 | TP_fast_assign( |
| 137 | __entry->opcode = opcode; |
| 138 | __entry->retval = retval; |
| 139 | ), |
| 140 | |
| 141 | TP_printk("opcode=%lu retval=%lu", __entry->opcode, __entry->retval), |
| 142 | |
| 143 | opal_tracepoint_regfunc, opal_tracepoint_unregfunc |
| 144 | ); |
| 145 | #endif |
| 146 | |
Aneesh Kumar K.V | cfcb3d8 | 2015-04-14 13:05:57 +0530 | [diff] [blame] | 147 | TRACE_EVENT(hash_fault, |
| 148 | |
| 149 | TP_PROTO(unsigned long addr, unsigned long access, unsigned long trap), |
| 150 | TP_ARGS(addr, access, trap), |
| 151 | TP_STRUCT__entry( |
| 152 | __field(unsigned long, addr) |
| 153 | __field(unsigned long, access) |
| 154 | __field(unsigned long, trap) |
| 155 | ), |
| 156 | |
| 157 | TP_fast_assign( |
| 158 | __entry->addr = addr; |
| 159 | __entry->access = access; |
| 160 | __entry->trap = trap; |
| 161 | ), |
| 162 | |
| 163 | TP_printk("hash fault with addr 0x%lx and access = 0x%lx trap = 0x%lx", |
| 164 | __entry->addr, __entry->access, __entry->trap) |
| 165 | ); |
| 166 | |
Anton Blanchard | 1bf4af1 | 2009-10-26 18:47:42 +0000 | [diff] [blame] | 167 | #endif /* _TRACE_POWERPC_H */ |
| 168 | |
| 169 | #undef TRACE_INCLUDE_PATH |
| 170 | #undef TRACE_INCLUDE_FILE |
| 171 | |
| 172 | #define TRACE_INCLUDE_PATH asm |
| 173 | #define TRACE_INCLUDE_FILE trace |
| 174 | |
| 175 | #include <trace/define_trace.h> |