2 * ltt/probes/trap-trace.c
4 * Trap tracepoint probes.
6 * (C) Copyright 2009 - Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
7 * Dual LGPL v2.1/GPL v2 license.
10 #include <linux/module.h>
11 #include <trace/trap.h>
13 #include "../ltt-type-serializer.h"
15 /* kernel_trap_entry specialized tracepoint probe */
17 void probe_trap_entry(void *_data
, struct pt_regs
*regs
, long id
);
19 DEFINE_MARKER_TP(kernel
, trap_entry
, trap_entry
,
20 probe_trap_entry
, "ip #p%ld trap_id #2u%u");
22 notrace
void probe_trap_entry(void *_data
, struct pt_regs
*regs
, long id
)
24 struct marker
*marker
;
25 struct serialize_long_short data
;
28 data
.f1
= instruction_pointer(regs
);
31 data
.f2
= (unsigned short)id
;
33 marker
= &GET_MARKER(kernel
, trap_entry
);
34 ltt_specialized_trace(marker
, marker
->single
.probe_private
,
35 &data
, serialize_sizeof(data
), sizeof(long));
38 /* kernel_syscall_exit specialized tracepoint probe */
40 void probe_trap_exit(void *_data
);
42 DEFINE_MARKER_TP(kernel
, trap_exit
, trap_exit
,
43 probe_trap_exit
, MARK_NOARGS
);
45 notrace
void probe_trap_exit(void *_data
)
47 struct marker
*marker
;
49 marker
= &GET_MARKER(kernel
, trap_exit
);
50 ltt_specialized_trace(marker
, marker
->single
.probe_private
,
54 MODULE_LICENSE("GPL and additional rights");
55 MODULE_AUTHOR("Mathieu Desnoyers");
56 MODULE_DESCRIPTION("Trap Tracepoint Probes");