| 1 | /* |
| 2 | * Copyright (C) 2011 - Julien Desfossez <julien.desfossez@polymtl.ca> |
| 3 | * Mathieu Desnoyers <mathieu.desnoyers@efficios.com> |
| 4 | * David Goulet <david.goulet@polymtl.ca> |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License, version 2 only, |
| 8 | * as published by the Free Software Foundation. |
| 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, but WITHOUT |
| 11 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
| 12 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
| 13 | * more details. |
| 14 | * |
| 15 | * You should have received a copy of the GNU General Public License along |
| 16 | * with this program; if not, write to the Free Software Foundation, Inc., |
| 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
| 18 | */ |
| 19 | |
| 20 | #ifndef _LTTNG_KERNEL_OLD_H |
| 21 | #define _LTTNG_KERNEL_OLD_H |
| 22 | |
| 23 | #include <stdint.h> |
| 24 | #include <common/lttng-kernel.h> |
| 25 | |
| 26 | /* |
| 27 | * LTTng DebugFS ABI structures. |
| 28 | * |
| 29 | * This is the kernel ABI copied from lttng-modules tree. |
| 30 | */ |
| 31 | |
| 32 | /* Perf counter attributes */ |
| 33 | struct lttng_kernel_old_perf_counter_ctx { |
| 34 | uint32_t type; |
| 35 | uint64_t config; |
| 36 | char name[LTTNG_KERNEL_SYM_NAME_LEN]; |
| 37 | }; |
| 38 | |
| 39 | /* Event/Channel context */ |
| 40 | #define LTTNG_KERNEL_OLD_CONTEXT_PADDING1 16 |
| 41 | #define LTTNG_KERNEL_OLD_CONTEXT_PADDING2 LTTNG_KERNEL_SYM_NAME_LEN + 32 |
| 42 | struct lttng_kernel_old_context { |
| 43 | enum lttng_kernel_context_type ctx; |
| 44 | char padding[LTTNG_KERNEL_OLD_CONTEXT_PADDING1]; |
| 45 | |
| 46 | union { |
| 47 | struct lttng_kernel_old_perf_counter_ctx perf_counter; |
| 48 | char padding[LTTNG_KERNEL_OLD_CONTEXT_PADDING2]; |
| 49 | } u; |
| 50 | }; |
| 51 | |
| 52 | struct lttng_kernel_old_kretprobe { |
| 53 | uint64_t addr; |
| 54 | |
| 55 | uint64_t offset; |
| 56 | char symbol_name[LTTNG_KERNEL_SYM_NAME_LEN]; |
| 57 | }; |
| 58 | |
| 59 | /* |
| 60 | * Either addr is used, or symbol_name and offset. |
| 61 | */ |
| 62 | struct lttng_kernel_old_kprobe { |
| 63 | uint64_t addr; |
| 64 | |
| 65 | uint64_t offset; |
| 66 | char symbol_name[LTTNG_KERNEL_SYM_NAME_LEN]; |
| 67 | }; |
| 68 | |
| 69 | /* Function tracer */ |
| 70 | struct lttng_kernel_old_function { |
| 71 | char symbol_name[LTTNG_KERNEL_SYM_NAME_LEN]; |
| 72 | }; |
| 73 | |
| 74 | #define LTTNG_KERNEL_OLD_EVENT_PADDING1 16 |
| 75 | #define LTTNG_KERNEL_OLD_EVENT_PADDING2 LTTNG_KERNEL_SYM_NAME_LEN + 32 |
| 76 | struct lttng_kernel_old_event { |
| 77 | char name[LTTNG_KERNEL_SYM_NAME_LEN]; |
| 78 | enum lttng_kernel_instrumentation instrumentation; |
| 79 | char padding[LTTNG_KERNEL_OLD_EVENT_PADDING1]; |
| 80 | |
| 81 | /* Per instrumentation type configuration */ |
| 82 | union { |
| 83 | struct lttng_kernel_old_kretprobe kretprobe; |
| 84 | struct lttng_kernel_old_kprobe kprobe; |
| 85 | struct lttng_kernel_old_function ftrace; |
| 86 | char padding[LTTNG_KERNEL_OLD_EVENT_PADDING2]; |
| 87 | } u; |
| 88 | }; |
| 89 | |
| 90 | struct lttng_kernel_old_tracer_version { |
| 91 | uint32_t major; |
| 92 | uint32_t minor; |
| 93 | uint32_t patchlevel; |
| 94 | }; |
| 95 | |
| 96 | struct lttng_kernel_old_calibrate { |
| 97 | enum lttng_kernel_calibrate_type type; /* type (input) */ |
| 98 | }; |
| 99 | |
| 100 | /* |
| 101 | * kernel channel |
| 102 | */ |
| 103 | #define LTTNG_KERNEL_OLD_CHANNEL_PADDING1 LTTNG_SYMBOL_NAME_LEN + 32 |
| 104 | struct lttng_kernel_old_channel { |
| 105 | int overwrite; /* 1: overwrite, 0: discard */ |
| 106 | uint64_t subbuf_size; /* bytes */ |
| 107 | uint64_t num_subbuf; /* power of 2 */ |
| 108 | unsigned int switch_timer_interval; /* usec */ |
| 109 | unsigned int read_timer_interval; /* usec */ |
| 110 | enum lttng_event_output output; /* splice, mmap */ |
| 111 | |
| 112 | char padding[LTTNG_KERNEL_OLD_CHANNEL_PADDING1]; |
| 113 | }; |
| 114 | |
| 115 | #endif /* _LTTNG_KERNEL_OLD_H */ |