Commit | Line | Data |
---|---|---|
57a13317 MD |
1 | #ifndef _LTT_DEBUGFS_ABI_H |
2 | #define _LTT_DEBUGFS_ABI_H | |
3 | ||
4 | /* | |
5 | * ltt-debugfs-abi.h | |
6 | * | |
7 | * Copyright 2010 (c) - Mathieu Desnoyers <mathieu.desnoyers@efficios.com> | |
8 | * | |
9 | * LTTng debugfs ABI header | |
17baffe2 MD |
10 | * |
11 | * Dual LGPL v2.1/GPL v2 license. | |
57a13317 MD |
12 | */ |
13 | ||
14 | #include <linux/fs.h> | |
15 | ||
e0a7a7c4 | 16 | #define LTTNG_SYM_NAME_LEN 128 |
d6d808f3 | 17 | |
38d024ae | 18 | enum lttng_kernel_instrumentation { |
4c183524 MD |
19 | LTTNG_KERNEL_TRACEPOINT = 0, |
20 | LTTNG_KERNEL_KPROBE = 1, | |
21 | LTTNG_KERNEL_FUNCTION = 2, | |
7371f44c | 22 | LTTNG_KERNEL_KRETPROBE = 3, |
1ec65de1 | 23 | LTTNG_KERNEL_NOOP = 4, /* not hooked */ |
43880ee8 | 24 | LTTNG_KERNEL_SYSCALL = 5, |
57a13317 MD |
25 | }; |
26 | ||
96ba7208 JD |
27 | /* |
28 | * LTTng consumer mode | |
29 | */ | |
30 | enum lttng_kernel_output { | |
31 | LTTNG_KERNEL_SPLICE = 0, | |
32 | LTTNG_KERNEL_MMAP = 1, | |
33 | }; | |
34 | ||
57a13317 MD |
35 | /* |
36 | * LTTng DebugFS ABI structures. | |
37 | */ | |
38 | ||
38d024ae | 39 | struct lttng_kernel_channel { |
9e245ead MD |
40 | int overwrite; /* 1: overwrite, 0: discard */ |
41 | uint64_t subbuf_size; /* in bytes */ | |
80c16bcf | 42 | uint64_t num_subbuf; |
9e245ead MD |
43 | unsigned int switch_timer_interval; /* usecs */ |
44 | unsigned int read_timer_interval; /* usecs */ | |
96ba7208 | 45 | enum lttng_kernel_output output; /* splice, mmap */ |
57a13317 MD |
46 | }; |
47 | ||
7371f44c MD |
48 | struct lttng_kernel_kretprobe { |
49 | uint64_t addr; | |
50 | ||
51 | uint64_t offset; | |
52 | char symbol_name[LTTNG_SYM_NAME_LEN]; | |
53 | }; | |
54 | ||
38d024ae MD |
55 | /* |
56 | * Either addr is used, or symbol_name and offset. | |
57 | */ | |
58 | struct lttng_kernel_kprobe { | |
80c16bcf | 59 | uint64_t addr; |
38d024ae | 60 | |
80c16bcf | 61 | uint64_t offset; |
e0a7a7c4 | 62 | char symbol_name[LTTNG_SYM_NAME_LEN]; |
d6d808f3 MD |
63 | }; |
64 | ||
f17701fb | 65 | struct lttng_kernel_function_tracer { |
e0a7a7c4 | 66 | char symbol_name[LTTNG_SYM_NAME_LEN]; |
f17701fb MD |
67 | }; |
68 | ||
43880ee8 MD |
69 | /* |
70 | * For syscall tracing, name = '\0' means "enable all". | |
71 | */ | |
d6d808f3 | 72 | struct lttng_kernel_event { |
30bdb6e4 | 73 | char name[LTTNG_SYM_NAME_LEN]; /* event name */ |
d6d808f3 MD |
74 | enum lttng_kernel_instrumentation instrumentation; |
75 | /* Per instrumentation type configuration */ | |
76 | union { | |
7371f44c | 77 | struct lttng_kernel_kretprobe kretprobe; |
d6d808f3 | 78 | struct lttng_kernel_kprobe kprobe; |
f17701fb | 79 | struct lttng_kernel_function_tracer ftrace; |
d6d808f3 | 80 | } u; |
38d024ae | 81 | }; |
c099397a | 82 | |
80c16bcf MD |
83 | struct lttng_kernel_tracer_version { |
84 | uint32_t version; | |
85 | uint32_t patchlevel; | |
86 | uint32_t sublevel; | |
87 | }; | |
88 | ||
3db41b2c MD |
89 | enum lttng_kernel_calibrate_type { |
90 | LTTNG_KERNEL_CALIBRATE_KRETPROBE, | |
57105fc2 MD |
91 | }; |
92 | ||
3db41b2c MD |
93 | struct lttng_kernel_calibrate { |
94 | enum lttng_kernel_calibrate_type type; /* type (input) */ | |
57105fc2 MD |
95 | }; |
96 | ||
12a313a5 | 97 | enum lttng_kernel_context_type { |
4c183524 MD |
98 | LTTNG_KERNEL_CONTEXT_PID = 0, |
99 | LTTNG_KERNEL_CONTEXT_PERF_COUNTER = 1, | |
100 | LTTNG_KERNEL_CONTEXT_COMM = 2, | |
101 | LTTNG_KERNEL_CONTEXT_PRIO = 3, | |
102 | LTTNG_KERNEL_CONTEXT_NICE = 4, | |
103 | LTTNG_KERNEL_CONTEXT_VPID = 5, | |
104 | LTTNG_KERNEL_CONTEXT_TID = 6, | |
105 | LTTNG_KERNEL_CONTEXT_VTID = 7, | |
106 | LTTNG_KERNEL_CONTEXT_PPID = 8, | |
107 | LTTNG_KERNEL_CONTEXT_VPPID = 9, | |
8070f5c0 MD |
108 | }; |
109 | ||
110 | struct lttng_kernel_perf_counter_ctx { | |
111 | uint32_t type; | |
112 | uint64_t config; | |
c24a0d71 | 113 | char name[LTTNG_SYM_NAME_LEN]; |
8070f5c0 MD |
114 | }; |
115 | ||
116 | struct lttng_kernel_context { | |
12a313a5 | 117 | enum lttng_kernel_context_type ctx; |
8070f5c0 | 118 | union { |
8070f5c0 MD |
119 | struct lttng_kernel_perf_counter_ctx perf_counter; |
120 | } u; | |
121 | }; | |
122 | ||
33749530 | 123 | /* LTTng file descriptor ioctl */ |
ab2277d6 | 124 | #define LTTNG_KERNEL_SESSION _IO(0xF6, 0x40) |
33749530 MD |
125 | #define LTTNG_KERNEL_TRACER_VERSION \ |
126 | _IOR(0xF6, 0x41, struct lttng_kernel_tracer_version) | |
271b6681 | 127 | #define LTTNG_KERNEL_TRACEPOINT_LIST _IO(0xF6, 0x42) |
360f38ea | 128 | #define LTTNG_KERNEL_WAIT_QUIESCENT _IO(0xF6, 0x43) |
57105fc2 | 129 | #define LTTNG_KERNEL_CALIBRATE \ |
3db41b2c | 130 | _IOWR(0xF6, 0x44, struct lttng_kernel_calibrate) |
33749530 MD |
131 | |
132 | /* Session FD ioctl */ | |
133 | #define LTTNG_KERNEL_METADATA \ | |
134 | _IOW(0xF6, 0x50, struct lttng_kernel_channel) | |
ab2277d6 | 135 | #define LTTNG_KERNEL_CHANNEL \ |
33749530 MD |
136 | _IOW(0xF6, 0x51, struct lttng_kernel_channel) |
137 | #define LTTNG_KERNEL_SESSION_START _IO(0xF6, 0x52) | |
138 | #define LTTNG_KERNEL_SESSION_STOP _IO(0xF6, 0x53) | |
139 | ||
140 | /* Channel FD ioctl */ | |
141 | #define LTTNG_KERNEL_STREAM _IO(0xF6, 0x60) | |
ab2277d6 | 142 | #define LTTNG_KERNEL_EVENT \ |
33749530 | 143 | _IOW(0xF6, 0x61, struct lttng_kernel_event) |
57a13317 | 144 | |
8070f5c0 MD |
145 | /* Event and Channel FD ioctl */ |
146 | #define LTTNG_KERNEL_CONTEXT \ | |
147 | _IOW(0xF6, 0x70, struct lttng_kernel_context) | |
148 | ||
e64957da MD |
149 | /* Event, Channel and Session ioctl */ |
150 | #define LTTNG_KERNEL_ENABLE _IO(0xF6, 0x80) | |
151 | #define LTTNG_KERNEL_DISABLE _IO(0xF6, 0x81) | |
152 | ||
57a13317 | 153 | #endif /* _LTT_DEBUGFS_ABI_H */ |