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 | |
10 | */ | |
11 | ||
12 | #include <linux/fs.h> | |
13 | ||
e0a7a7c4 | 14 | #define LTTNG_SYM_NAME_LEN 128 |
d6d808f3 | 15 | |
38d024ae | 16 | enum lttng_kernel_instrumentation { |
ab2277d6 MD |
17 | LTTNG_KERNEL_TRACEPOINT, |
18 | LTTNG_KERNEL_KPROBE, | |
19 | LTTNG_KERNEL_FUNCTION, | |
57a13317 MD |
20 | }; |
21 | ||
22 | /* | |
23 | * LTTng DebugFS ABI structures. | |
24 | */ | |
25 | ||
38d024ae | 26 | struct lttng_kernel_channel { |
9e245ead MD |
27 | int overwrite; /* 1: overwrite, 0: discard */ |
28 | uint64_t subbuf_size; /* in bytes */ | |
80c16bcf | 29 | uint64_t num_subbuf; |
9e245ead MD |
30 | unsigned int switch_timer_interval; /* usecs */ |
31 | unsigned int read_timer_interval; /* usecs */ | |
57a13317 MD |
32 | }; |
33 | ||
30bdb6e4 MD |
34 | struct lttng_kernel_tracepoint { |
35 | }; | |
36 | ||
38d024ae MD |
37 | /* |
38 | * Either addr is used, or symbol_name and offset. | |
39 | */ | |
40 | struct lttng_kernel_kprobe { | |
80c16bcf | 41 | uint64_t addr; |
38d024ae | 42 | |
80c16bcf | 43 | uint64_t offset; |
e0a7a7c4 | 44 | char symbol_name[LTTNG_SYM_NAME_LEN]; |
d6d808f3 MD |
45 | }; |
46 | ||
f17701fb | 47 | struct lttng_kernel_function_tracer { |
e0a7a7c4 | 48 | char symbol_name[LTTNG_SYM_NAME_LEN]; |
f17701fb MD |
49 | }; |
50 | ||
d6d808f3 | 51 | struct lttng_kernel_event { |
30bdb6e4 | 52 | char name[LTTNG_SYM_NAME_LEN]; /* event name */ |
d6d808f3 MD |
53 | enum lttng_kernel_instrumentation instrumentation; |
54 | /* Per instrumentation type configuration */ | |
55 | union { | |
30bdb6e4 | 56 | struct lttng_kernel_tracepoint tracepoint; |
d6d808f3 | 57 | struct lttng_kernel_kprobe kprobe; |
f17701fb | 58 | struct lttng_kernel_function_tracer ftrace; |
d6d808f3 | 59 | } u; |
38d024ae | 60 | }; |
c099397a | 61 | |
80c16bcf MD |
62 | struct lttng_kernel_tracer_version { |
63 | uint32_t version; | |
64 | uint32_t patchlevel; | |
65 | uint32_t sublevel; | |
66 | }; | |
67 | ||
12a313a5 MD |
68 | enum lttng_kernel_context_type { |
69 | LTTNG_KERNEL_CONTEXT_PID, | |
70 | LTTNG_KERNEL_CONTEXT_PERF_COUNTER, | |
8070f5c0 MD |
71 | }; |
72 | ||
73 | struct lttng_kernel_pid_ctx { | |
74 | }; | |
75 | ||
76 | struct lttng_kernel_perf_counter_ctx { | |
77 | uint32_t type; | |
78 | uint64_t config; | |
79 | }; | |
80 | ||
81 | struct lttng_kernel_context { | |
12a313a5 | 82 | enum lttng_kernel_context_type ctx; |
8070f5c0 MD |
83 | union { |
84 | struct lttng_kernel_pid_ctx pid; | |
85 | struct lttng_kernel_perf_counter_ctx perf_counter; | |
86 | } u; | |
87 | }; | |
88 | ||
33749530 | 89 | /* LTTng file descriptor ioctl */ |
ab2277d6 | 90 | #define LTTNG_KERNEL_SESSION _IO(0xF6, 0x40) |
33749530 MD |
91 | #define LTTNG_KERNEL_TRACER_VERSION \ |
92 | _IOR(0xF6, 0x41, struct lttng_kernel_tracer_version) | |
271b6681 | 93 | #define LTTNG_KERNEL_TRACEPOINT_LIST _IO(0xF6, 0x42) |
33749530 MD |
94 | |
95 | /* Session FD ioctl */ | |
96 | #define LTTNG_KERNEL_METADATA \ | |
97 | _IOW(0xF6, 0x50, struct lttng_kernel_channel) | |
ab2277d6 | 98 | #define LTTNG_KERNEL_CHANNEL \ |
33749530 MD |
99 | _IOW(0xF6, 0x51, struct lttng_kernel_channel) |
100 | #define LTTNG_KERNEL_SESSION_START _IO(0xF6, 0x52) | |
101 | #define LTTNG_KERNEL_SESSION_STOP _IO(0xF6, 0x53) | |
102 | ||
103 | /* Channel FD ioctl */ | |
104 | #define LTTNG_KERNEL_STREAM _IO(0xF6, 0x60) | |
ab2277d6 | 105 | #define LTTNG_KERNEL_EVENT \ |
33749530 | 106 | _IOW(0xF6, 0x61, struct lttng_kernel_event) |
57a13317 | 107 | |
8070f5c0 MD |
108 | /* Event and Channel FD ioctl */ |
109 | #define LTTNG_KERNEL_CONTEXT \ | |
110 | _IOW(0xF6, 0x70, struct lttng_kernel_context) | |
111 | ||
57a13317 | 112 | #endif /* _LTT_DEBUGFS_ABI_H */ |