7 * Copyright 2010 (c) - Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 * Dual LGPL v2.1/GPL v2 license.
16 #define LTTNG_KERNEL_SYM_NAME_LEN 256
18 enum lttng_kernel_instrumentation
{
19 LTTNG_KERNEL_TRACEPOINT
= 0,
20 LTTNG_KERNEL_KPROBE
= 1,
21 LTTNG_KERNEL_FUNCTION
= 2,
22 LTTNG_KERNEL_KRETPROBE
= 3,
23 LTTNG_KERNEL_NOOP
= 4, /* not hooked */
24 LTTNG_KERNEL_SYSCALL
= 5,
30 enum lttng_kernel_output
{
31 LTTNG_KERNEL_SPLICE
= 0,
32 LTTNG_KERNEL_MMAP
= 1,
36 * LTTng DebugFS ABI structures.
38 #define LTTNG_KERNEL_CHANNEL_PADDING LTTNG_KERNEL_SYM_NAME_LEN + 32
39 struct lttng_kernel_channel
{
40 int overwrite
; /* 1: overwrite, 0: discard */
41 uint64_t subbuf_size
; /* in bytes */
43 unsigned int switch_timer_interval
; /* usecs */
44 unsigned int read_timer_interval
; /* usecs */
45 enum lttng_kernel_output output
; /* splice, mmap */
46 char padding
[LTTNG_KERNEL_CHANNEL_PADDING
];
49 #define LTTNG_KERNEL_KRETPROBE_PADDING LTTNG_KERNEL_SYM_NAME_LEN + 32
50 struct lttng_kernel_kretprobe
{
54 char symbol_name
[LTTNG_KERNEL_SYM_NAME_LEN
];
58 * Either addr is used, or symbol_name and offset.
60 #define LTTNG_KERNEL_KPROBE_PADDING LTTNG_KERNEL_SYM_NAME_LEN + 32
61 struct lttng_kernel_kprobe
{
65 char symbol_name
[LTTNG_KERNEL_SYM_NAME_LEN
];
68 #define LTTNG_KERNEL_FUNCTION_TRACER_PADDING LTTNG_KERNEL_SYM_NAME_LEN + 32
69 struct lttng_kernel_function_tracer
{
70 char symbol_name
[LTTNG_KERNEL_SYM_NAME_LEN
];
74 * For syscall tracing, name = '\0' means "enable all".
76 #define LTTNG_KERNEL_EVENT_PADDING1 16
77 #define LTTNG_KERNEL_EVENT_PADDING2 LTTNG_KERNEL_SYM_NAME_LEN + 32
78 struct lttng_kernel_event
{
79 char name
[LTTNG_KERNEL_SYM_NAME_LEN
]; /* event name */
80 enum lttng_kernel_instrumentation instrumentation
;
81 char padding
[LTTNG_KERNEL_EVENT_PADDING1
];
83 /* Per instrumentation type configuration */
85 struct lttng_kernel_kretprobe kretprobe
;
86 struct lttng_kernel_kprobe kprobe
;
87 struct lttng_kernel_function_tracer ftrace
;
88 char padding
[LTTNG_KERNEL_EVENT_PADDING2
];
92 struct lttng_kernel_tracer_version
{
98 enum lttng_kernel_calibrate_type
{
99 LTTNG_KERNEL_CALIBRATE_KRETPROBE
,
102 struct lttng_kernel_calibrate
{
103 enum lttng_kernel_calibrate_type type
; /* type (input) */
106 enum lttng_kernel_context_type
{
107 LTTNG_KERNEL_CONTEXT_PID
= 0,
108 LTTNG_KERNEL_CONTEXT_PERF_COUNTER
= 1,
109 LTTNG_KERNEL_CONTEXT_PROCNAME
= 2,
110 LTTNG_KERNEL_CONTEXT_PRIO
= 3,
111 LTTNG_KERNEL_CONTEXT_NICE
= 4,
112 LTTNG_KERNEL_CONTEXT_VPID
= 5,
113 LTTNG_KERNEL_CONTEXT_TID
= 6,
114 LTTNG_KERNEL_CONTEXT_VTID
= 7,
115 LTTNG_KERNEL_CONTEXT_PPID
= 8,
116 LTTNG_KERNEL_CONTEXT_VPPID
= 9,
119 struct lttng_kernel_perf_counter_ctx
{
122 char name
[LTTNG_KERNEL_SYM_NAME_LEN
];
125 #define LTTNG_KERNEL_CONTEXT_PADDING1 16
126 #define LTTNG_KERNEL_CONTEXT_PADDING2 LTTNG_KERNEL_SYM_NAME_LEN + 32
127 struct lttng_kernel_context
{
128 enum lttng_kernel_context_type ctx
;
129 char padding
[LTTNG_KERNEL_CONTEXT_PADDING1
];
132 struct lttng_kernel_perf_counter_ctx perf_counter
;
133 char padding
[LTTNG_KERNEL_CONTEXT_PADDING2
];
137 /* LTTng file descriptor ioctl */
138 #define LTTNG_KERNEL_SESSION _IO(0xF6, 0x40)
139 #define LTTNG_KERNEL_TRACER_VERSION \
140 _IOR(0xF6, 0x41, struct lttng_kernel_tracer_version)
141 #define LTTNG_KERNEL_TRACEPOINT_LIST _IO(0xF6, 0x42)
142 #define LTTNG_KERNEL_WAIT_QUIESCENT _IO(0xF6, 0x43)
143 #define LTTNG_KERNEL_CALIBRATE \
144 _IOWR(0xF6, 0x44, struct lttng_kernel_calibrate)
146 /* Session FD ioctl */
147 #define LTTNG_KERNEL_METADATA \
148 _IOW(0xF6, 0x50, struct lttng_kernel_channel)
149 #define LTTNG_KERNEL_CHANNEL \
150 _IOW(0xF6, 0x51, struct lttng_kernel_channel)
151 #define LTTNG_KERNEL_SESSION_START _IO(0xF6, 0x52)
152 #define LTTNG_KERNEL_SESSION_STOP _IO(0xF6, 0x53)
154 /* Channel FD ioctl */
155 #define LTTNG_KERNEL_STREAM _IO(0xF6, 0x60)
156 #define LTTNG_KERNEL_EVENT \
157 _IOW(0xF6, 0x61, struct lttng_kernel_event)
159 /* Event and Channel FD ioctl */
160 #define LTTNG_KERNEL_CONTEXT \
161 _IOW(0xF6, 0x70, struct lttng_kernel_context)
163 /* Event, Channel and Session ioctl */
164 #define LTTNG_KERNEL_ENABLE _IO(0xF6, 0x80)
165 #define LTTNG_KERNEL_DISABLE _IO(0xF6, 0x81)
167 #endif /* _LTTNG_ABI_H */