Commit | Line | Data |
---|---|---|
4dbc372b | 1 | /* |
ab5be9fa | 2 | * Copyright (C) 2011 Mathieu Desnoyers <mathieu.desnoyers@efficios.com> |
a4eb26f0 | 3 | * Copyright (C) 2011 EfficiOS Inc. |
4dbc372b | 4 | * |
ab5be9fa | 5 | * SPDX-License-Identifier: GPL-2.0-only |
4dbc372b | 6 | * |
4dbc372b JD |
7 | */ |
8 | ||
9 | #ifndef _LTTNG_KERNEL_OLD_H | |
10 | #define _LTTNG_KERNEL_OLD_H | |
11 | ||
12 | #include <stdint.h> | |
13 | #include <common/lttng-kernel.h> | |
14 | ||
15 | /* | |
16 | * LTTng DebugFS ABI structures. | |
17 | * | |
18 | * This is the kernel ABI copied from lttng-modules tree. | |
19 | */ | |
20 | ||
21 | /* Perf counter attributes */ | |
22 | struct lttng_kernel_old_perf_counter_ctx { | |
23 | uint32_t type; | |
24 | uint64_t config; | |
25 | char name[LTTNG_KERNEL_SYM_NAME_LEN]; | |
26 | }; | |
27 | ||
28 | /* Event/Channel context */ | |
29 | #define LTTNG_KERNEL_OLD_CONTEXT_PADDING1 16 | |
30 | #define LTTNG_KERNEL_OLD_CONTEXT_PADDING2 LTTNG_KERNEL_SYM_NAME_LEN + 32 | |
31 | struct lttng_kernel_old_context { | |
32 | enum lttng_kernel_context_type ctx; | |
33 | char padding[LTTNG_KERNEL_OLD_CONTEXT_PADDING1]; | |
34 | ||
35 | union { | |
36 | struct lttng_kernel_old_perf_counter_ctx perf_counter; | |
37 | char padding[LTTNG_KERNEL_OLD_CONTEXT_PADDING2]; | |
38 | } u; | |
39 | }; | |
40 | ||
41 | struct lttng_kernel_old_kretprobe { | |
42 | uint64_t addr; | |
43 | ||
44 | uint64_t offset; | |
45 | char symbol_name[LTTNG_KERNEL_SYM_NAME_LEN]; | |
46 | }; | |
47 | ||
48 | /* | |
49 | * Either addr is used, or symbol_name and offset. | |
50 | */ | |
51 | struct lttng_kernel_old_kprobe { | |
52 | uint64_t addr; | |
53 | ||
54 | uint64_t offset; | |
55 | char symbol_name[LTTNG_KERNEL_SYM_NAME_LEN]; | |
56 | }; | |
57 | ||
58 | /* Function tracer */ | |
59 | struct lttng_kernel_old_function { | |
60 | char symbol_name[LTTNG_KERNEL_SYM_NAME_LEN]; | |
61 | }; | |
62 | ||
63 | #define LTTNG_KERNEL_OLD_EVENT_PADDING1 16 | |
64 | #define LTTNG_KERNEL_OLD_EVENT_PADDING2 LTTNG_KERNEL_SYM_NAME_LEN + 32 | |
65 | struct lttng_kernel_old_event { | |
66 | char name[LTTNG_KERNEL_SYM_NAME_LEN]; | |
67 | enum lttng_kernel_instrumentation instrumentation; | |
68 | char padding[LTTNG_KERNEL_OLD_EVENT_PADDING1]; | |
69 | ||
70 | /* Per instrumentation type configuration */ | |
71 | union { | |
72 | struct lttng_kernel_old_kretprobe kretprobe; | |
73 | struct lttng_kernel_old_kprobe kprobe; | |
74 | struct lttng_kernel_old_function ftrace; | |
75 | char padding[LTTNG_KERNEL_OLD_EVENT_PADDING2]; | |
76 | } u; | |
77 | }; | |
78 | ||
79 | struct lttng_kernel_old_tracer_version { | |
80 | uint32_t major; | |
81 | uint32_t minor; | |
82 | uint32_t patchlevel; | |
83 | }; | |
84 | ||
4dbc372b JD |
85 | /* |
86 | * kernel channel | |
87 | */ | |
88 | #define LTTNG_KERNEL_OLD_CHANNEL_PADDING1 LTTNG_SYMBOL_NAME_LEN + 32 | |
89 | struct lttng_kernel_old_channel { | |
90 | int overwrite; /* 1: overwrite, 0: discard */ | |
91 | uint64_t subbuf_size; /* bytes */ | |
92 | uint64_t num_subbuf; /* power of 2 */ | |
93 | unsigned int switch_timer_interval; /* usec */ | |
94 | unsigned int read_timer_interval; /* usec */ | |
95 | enum lttng_event_output output; /* splice, mmap */ | |
96 | ||
97 | char padding[LTTNG_KERNEL_OLD_CHANNEL_PADDING1]; | |
98 | }; | |
99 | ||
100 | #endif /* _LTTNG_KERNEL_OLD_H */ |