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