<div dir="ltr">Here is reworked version on the trap tracepoints.<div><br><div style>If it looks good, i will go on by sending a lttng-modules patch adding the trap-probe.</div></div><div style><br></div><div style>Comments are welcome.</div>
<div style><br></div><div style>Francis</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Mar 20, 2013 at 3:55 PM, Francis Deslauriers <span dir="ltr"><<a href="mailto:fdeslaur@gmail.com" target="_blank">fdeslaur@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">This patch adds new trap tracepoint definitions. Both trap entry and trap exit<br>
tracepoints can be added.<br>
<br>
Signed-off-by: Francis Deslauriers <<a href="mailto:fdeslaur@gmail.com">fdeslaur@gmail.com</a>><br>
---<br>
include/trace/events/trap.h | 45 +++++++++++++++++++++++++++++++++++++++++++<br>
1 file changed, 45 insertions(+)<br>
create mode 100644 include/trace/events/trap.h<br>
<br>
diff --git a/include/trace/events/trap.h b/include/trace/events/trap.h<br>
new file mode 100644<br>
index 0000000..e79e8c0<br>
--- /dev/null<br>
+++ b/include/trace/events/trap.h<br>
@@ -0,0 +1,45 @@<br>
+#undef TRACE_SYSTEM<br>
+#define TRACE_SYSTEM trap<br>
+<br>
+#if !defined(_TRACE_TRAP_H) || defined(TRACE_HEADER_MULTI_READ)<br>
+#define _TRACE_TRAP_H<br>
+<br>
+#include <linux/tracepoint.h><br>
+<br>
+TRACE_EVENT(trap_entry,<br>
+<br>
+ TP_PROTO(struct pt_regs *regs, long trap),<br>
+<br>
+ TP_ARGS(regs, trap),<br>
+<br>
+ TP_STRUCT__entry(<br>
+ __field( long, trap )<br>
+ __field( unsigned long, ip)<br>
+ ),<br>
+ TP_fast_assign(<br>
+ __entry->trap = trap;<br>
+ __entry->ip = regs ? instruction_pointer(regs) : 0UL;<br>
+ ),<br>
+<br>
+ TP_printk("number=%ld, ip = %lu", __entry->trap, __entry->ip)<br>
+);<br>
+<br>
+TRACE_EVENT(trap_exit,<br>
+<br>
+ TP_PROTO(long trap),<br>
+<br>
+ TP_ARGS(trap),<br>
+<br>
+ TP_STRUCT__entry(<br>
+ __field( long, trap )<br>
+ ),<br>
+ TP_fast_assign(<br>
+ __entry->trap = trap;<br>
+ ),<br>
+<br>
+ TP_printk("number=%ld", __entry->trap)<br>
+);<br>
+<br>
+#endif /* _TRACE_TRAP_H */<br>
+/* This part must be outside protection */<br>
+#include <trace/define_trace.h><br>
--<br>
1.7.10.4<br>
<br>
</div></div></blockquote></div><br></div>