trace.h 3.2 KB
Newer Older
1 2 3 4 5 6 7 8 9 10
#undef TRACE_SYSTEM
#define TRACE_SYSTEM powerpc

#if !defined(_TRACE_POWERPC_H) || defined(TRACE_HEADER_MULTI_READ)
#define _TRACE_POWERPC_H

#include <linux/tracepoint.h>

struct pt_regs;

11
DECLARE_EVENT_CLASS(ppc64_interrupt_class,
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27

	TP_PROTO(struct pt_regs *regs),

	TP_ARGS(regs),

	TP_STRUCT__entry(
		__field(struct pt_regs *, regs)
	),

	TP_fast_assign(
		__entry->regs = regs;
	),

	TP_printk("pt_regs=%p", __entry->regs)
);

28
DEFINE_EVENT(ppc64_interrupt_class, irq_entry,
29 30 31

	TP_PROTO(struct pt_regs *regs),

32
	TP_ARGS(regs)
33 34
);

35
DEFINE_EVENT(ppc64_interrupt_class, irq_exit,
36 37 38

	TP_PROTO(struct pt_regs *regs),

39
	TP_ARGS(regs)
40 41
);

42
DEFINE_EVENT(ppc64_interrupt_class, timer_interrupt_entry,
43 44 45

	TP_PROTO(struct pt_regs *regs),

46 47
	TP_ARGS(regs)
);
48

49
DEFINE_EVENT(ppc64_interrupt_class, timer_interrupt_exit,
50

51
	TP_PROTO(struct pt_regs *regs),
52

53
	TP_ARGS(regs)
54 55
);

56 57 58 59 60 61
#ifdef CONFIG_PPC_PSERIES
extern void hcall_tracepoint_regfunc(void);
extern void hcall_tracepoint_unregfunc(void);

TRACE_EVENT_FN(hcall_entry,

62
	TP_PROTO(unsigned long opcode, unsigned long *args),
63

64
	TP_ARGS(opcode, args),
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80

	TP_STRUCT__entry(
		__field(unsigned long, opcode)
	),

	TP_fast_assign(
		__entry->opcode = opcode;
	),

	TP_printk("opcode=%lu", __entry->opcode),

	hcall_tracepoint_regfunc, hcall_tracepoint_unregfunc
);

TRACE_EVENT_FN(hcall_exit,

81 82
	TP_PROTO(unsigned long opcode, unsigned long retval,
		unsigned long *retbuf),
83

84
	TP_ARGS(opcode, retval, retbuf),
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101

	TP_STRUCT__entry(
		__field(unsigned long, opcode)
		__field(unsigned long, retval)
	),

	TP_fast_assign(
		__entry->opcode = opcode;
		__entry->retval = retval;
	),

	TP_printk("opcode=%lu retval=%lu", __entry->opcode, __entry->retval),

	hcall_tracepoint_regfunc, hcall_tracepoint_unregfunc
);
#endif

A
Anton Blanchard 已提交
102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146
#ifdef CONFIG_PPC_POWERNV
extern void opal_tracepoint_regfunc(void);
extern void opal_tracepoint_unregfunc(void);

TRACE_EVENT_FN(opal_entry,

	TP_PROTO(unsigned long opcode, unsigned long *args),

	TP_ARGS(opcode, args),

	TP_STRUCT__entry(
		__field(unsigned long, opcode)
	),

	TP_fast_assign(
		__entry->opcode = opcode;
	),

	TP_printk("opcode=%lu", __entry->opcode),

	opal_tracepoint_regfunc, opal_tracepoint_unregfunc
);

TRACE_EVENT_FN(opal_exit,

	TP_PROTO(unsigned long opcode, unsigned long retval),

	TP_ARGS(opcode, retval),

	TP_STRUCT__entry(
		__field(unsigned long, opcode)
		__field(unsigned long, retval)
	),

	TP_fast_assign(
		__entry->opcode = opcode;
		__entry->retval = retval;
	),

	TP_printk("opcode=%lu retval=%lu", __entry->opcode, __entry->retval),

	opal_tracepoint_regfunc, opal_tracepoint_unregfunc
);
#endif

147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166
TRACE_EVENT(hash_fault,

	    TP_PROTO(unsigned long addr, unsigned long access, unsigned long trap),
	    TP_ARGS(addr, access, trap),
	    TP_STRUCT__entry(
		    __field(unsigned long, addr)
		    __field(unsigned long, access)
		    __field(unsigned long, trap)
		    ),

	    TP_fast_assign(
		    __entry->addr = addr;
		    __entry->access = access;
		    __entry->trap = trap;
		    ),

	    TP_printk("hash fault with addr 0x%lx and access = 0x%lx trap = 0x%lx",
		      __entry->addr, __entry->access, __entry->trap)
);

167 168 169 170 171 172 173 174 175
#endif /* _TRACE_POWERPC_H */

#undef TRACE_INCLUDE_PATH
#undef TRACE_INCLUDE_FILE

#define TRACE_INCLUDE_PATH asm
#define TRACE_INCLUDE_FILE trace

#include <trace/define_trace.h>