aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/include/asm/trace.h
diff options
context:
space:
mode:
authorAnton Blanchard <anton@samba.org>2009-10-26 14:50:29 -0400
committerPaul Mackerras <paulus@samba.org>2009-10-28 01:13:04 -0400
commitc8cd093a6e9f96ea6b871576fd4e46d7c818bb89 (patch)
tree2bad2c3a2cc68a35fb93d986a49bf543efcd0156 /arch/powerpc/include/asm/trace.h
parent6795b85c6a4f690e61e7be31aa150d945c723fb5 (diff)
powerpc: tracing: Add hypervisor call tracepoints
Add hcall_entry and hcall_exit tracepoints. This replaces the inline assembly HCALL_STATS code and converts it to use the new tracepoints. To keep the disabled case as quick as possible, we embed a status word in the TOC so we can get at it with a single load. By doing so we keep the overhead at a minimum. Time taken for a null hcall: No tracepoint code: 135.79 cycles Disabled tracepoints: 137.95 cycles For reference, before this patch enabling HCALL_STATS resulted in a null hcall of 201.44 cycles! Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/include/asm/trace.h')
-rw-r--r--arch/powerpc/include/asm/trace.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/arch/powerpc/include/asm/trace.h b/arch/powerpc/include/asm/trace.h
index b558c31d409e..9b01c0e43b55 100644
--- a/arch/powerpc/include/asm/trace.h
+++ b/arch/powerpc/include/asm/trace.h
@@ -76,6 +76,51 @@ TRACE_EVENT(timer_interrupt_exit,
76 TP_printk("pt_regs=%p", __entry->regs) 76 TP_printk("pt_regs=%p", __entry->regs)
77); 77);
78 78
79#ifdef CONFIG_PPC_PSERIES
80extern void hcall_tracepoint_regfunc(void);
81extern void hcall_tracepoint_unregfunc(void);
82
83TRACE_EVENT_FN(hcall_entry,
84
85 TP_PROTO(unsigned long opcode),
86
87 TP_ARGS(opcode),
88
89 TP_STRUCT__entry(
90 __field(unsigned long, opcode)
91 ),
92
93 TP_fast_assign(
94 __entry->opcode = opcode;
95 ),
96
97 TP_printk("opcode=%lu", __entry->opcode),
98
99 hcall_tracepoint_regfunc, hcall_tracepoint_unregfunc
100);
101
102TRACE_EVENT_FN(hcall_exit,
103
104 TP_PROTO(unsigned long opcode, unsigned long retval),
105
106 TP_ARGS(opcode, retval),
107
108 TP_STRUCT__entry(
109 __field(unsigned long, opcode)
110 __field(unsigned long, retval)
111 ),
112
113 TP_fast_assign(
114 __entry->opcode = opcode;
115 __entry->retval = retval;
116 ),
117
118 TP_printk("opcode=%lu retval=%lu", __entry->opcode, __entry->retval),
119
120 hcall_tracepoint_regfunc, hcall_tracepoint_unregfunc
121);
122#endif
123
79#endif /* _TRACE_POWERPC_H */ 124#endif /* _TRACE_POWERPC_H */
80 125
81#undef TRACE_INCLUDE_PATH 126#undef TRACE_INCLUDE_PATH