Commit | Line | Data |
---|---|---|
1c8284eb MD |
1 | /* |
2 | * ltt/probes/trap-trace.c | |
3 | * | |
4 | * Trap tracepoint probes. | |
5 | * | |
6 | * (C) Copyright 2009 - Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca> | |
7 | * Dual LGPL v2.1/GPL v2 license. | |
8 | */ | |
9 | ||
10 | #include <linux/module.h> | |
11 | #include <trace/trap.h> | |
12 | ||
13 | #include "../ltt-type-serializer.h" | |
14 | ||
15 | /* kernel_trap_entry specialized tracepoint probe */ | |
16 | ||
17 | void probe_trap_entry(void *_data, struct pt_regs *regs, long id); | |
18 | ||
19 | DEFINE_MARKER_TP(kernel, trap_entry, trap_entry, | |
20 | probe_trap_entry, "ip #p%ld trap_id #2u%u"); | |
21 | ||
22 | notrace void probe_trap_entry(void *_data, struct pt_regs *regs, long id) | |
23 | { | |
24 | struct marker *marker; | |
25 | struct serialize_long_short data; | |
26 | ||
27 | if (likely(regs)) | |
28 | data.f1 = instruction_pointer(regs); | |
29 | else | |
30 | data.f1 = 0UL; | |
31 | data.f2 = (unsigned short)id; | |
32 | ||
33 | marker = &GET_MARKER(kernel, trap_entry); | |
34 | ltt_specialized_trace(marker, marker->single.probe_private, | |
35 | &data, serialize_sizeof(data), sizeof(long)); | |
36 | } | |
37 | ||
38 | /* kernel_syscall_exit specialized tracepoint probe */ | |
39 | ||
40 | void probe_trap_exit(void *_data); | |
41 | ||
42 | DEFINE_MARKER_TP(kernel, trap_exit, trap_exit, | |
43 | probe_trap_exit, MARK_NOARGS); | |
44 | ||
45 | notrace void probe_trap_exit(void *_data) | |
46 | { | |
47 | struct marker *marker; | |
48 | ||
49 | marker = &GET_MARKER(kernel, trap_exit); | |
50 | ltt_specialized_trace(marker, marker->single.probe_private, | |
51 | NULL, 0, 0); | |
52 | } | |
53 | ||
54 | MODULE_LICENSE("GPL and additional rights"); | |
55 | MODULE_AUTHOR("Mathieu Desnoyers"); | |
56 | MODULE_DESCRIPTION("Trap Tracepoint Probes"); |