Commit | Line | Data |
---|---|---|
3817e7df DG |
1 | #ifndef _LTTNG_UST_H |
2 | #define _LTTNG_UST_H | |
3 | ||
4 | /* | |
5 | * Taken from the lttng-ust-abi.h in the UST 2.0 git tree | |
6 | * | |
97ee3a89 DG |
7 | * Copyright 2010-2011 - Mathieu Desnoyers <mathieu.desnoyers@efficios.com> |
8 | * Copyright 2011 - David Goulet <david.goulet@polymtl.ca> | |
3817e7df DG |
9 | * |
10 | * LTTng-UST ABI header | |
11 | * | |
12 | * Dual LGPL v2.1/GPL v2 license. | |
13 | */ | |
14 | ||
15 | #include <stdint.h> | |
16 | ||
97ee3a89 | 17 | #define LTTNG_UST_SYM_NAME_LEN 128 |
3817e7df | 18 | |
97ee3a89 DG |
19 | #define LTTNG_UST_COMM_VERSION_MAJOR 0 |
20 | #define LTTNG_UST_COMM_VERSION_MINOR 1 | |
21 | ||
3817e7df DG |
22 | enum lttng_ust_instrumentation { |
23 | LTTNG_UST_TRACEPOINT = 0, | |
24 | LTTNG_UST_PROBE = 1, | |
25 | LTTNG_UST_FUNCTION = 2, | |
26 | }; | |
27 | ||
28 | enum lttng_ust_output { | |
29 | LTTNG_UST_MMAP = 0, | |
30 | }; | |
31 | ||
32 | struct lttng_ust_tracer_version { | |
33 | uint32_t version; | |
34 | uint32_t patchlevel; | |
35 | uint32_t sublevel; | |
36 | }; | |
37 | ||
38 | struct lttng_ust_channel { | |
39 | int overwrite; /* 1: overwrite, 0: discard */ | |
40 | uint64_t subbuf_size; /* in bytes */ | |
41 | uint64_t num_subbuf; | |
42 | unsigned int switch_timer_interval; /* usecs */ | |
43 | unsigned int read_timer_interval; /* usecs */ | |
44 | enum lttng_ust_output output; /* output mode */ | |
2b0bf864 DG |
45 | /* The following fields are used internally within UST. */ |
46 | int shm_fd; | |
47 | int wait_fd; | |
48 | uint64_t memory_map_size; | |
3817e7df DG |
49 | }; |
50 | ||
51 | struct lttng_ust_event { | |
52 | char name[LTTNG_UST_SYM_NAME_LEN]; /* event name */ | |
53 | enum lttng_ust_instrumentation instrumentation; | |
54 | /* Per instrumentation type configuration */ | |
55 | union { | |
56 | } u; | |
57 | }; | |
58 | ||
59 | enum lttng_ust_context_type { | |
60 | LTTNG_UST_CONTEXT_VTID = 0, | |
61 | }; | |
62 | ||
63 | struct lttng_ust_context { | |
64 | enum lttng_ust_context_type ctx; | |
65 | union { | |
66 | } u; | |
67 | }; | |
68 | ||
69 | #define _UST_CMD(minor) (minor) | |
70 | #define _UST_CMDR(minor, type) (minor) | |
71 | #define _UST_CMDW(minor, type) (minor) | |
72 | ||
73 | /* Handled by object descriptor */ | |
74 | #define LTTNG_UST_RELEASE _UST_CMD(0x1) | |
75 | ||
76 | /* Handled by object cmd */ | |
77 | ||
78 | /* LTTng-UST commands */ | |
79 | #define LTTNG_UST_SESSION _UST_CMD(0x40) | |
80 | #define LTTNG_UST_TRACER_VERSION \ | |
81 | _UST_CMDR(0x41, struct lttng_ust_tracer_version) | |
82 | #define LTTNG_UST_TRACEPOINT_LIST _UST_CMD(0x42) | |
83 | #define LTTNG_UST_WAIT_QUIESCENT _UST_CMD(0x43) | |
099e26bd | 84 | #define LTTNG_UST_REGISTER_DONE _UST_CMD(0x44) |
3817e7df DG |
85 | |
86 | /* Session FD ioctl */ | |
87 | #define LTTNG_UST_METADATA \ | |
88 | _UST_CMDW(0x50, struct lttng_ust_channel) | |
89 | #define LTTNG_UST_CHANNEL \ | |
90 | _UST_CMDW(0x51, struct lttng_ust_channel) | |
91 | #define LTTNG_UST_SESSION_START _UST_CMD(0x52) | |
92 | #define LTTNG_UST_SESSION_STOP _UST_CMD(0x53) | |
93 | ||
94 | /* Channel FD ioctl */ | |
95 | #define LTTNG_UST_STREAM _UST_CMD(0x60) | |
96 | #define LTTNG_UST_EVENT \ | |
97 | _UST_CMDW(0x61, struct lttng_ust_event) | |
98 | ||
99 | /* Event and Channel FD ioctl */ | |
100 | #define LTTNG_UST_CONTEXT \ | |
101 | _UST_CMDW(0x70, struct lttng_ust_context) | |
102 | ||
103 | /* Event, Channel and Session ioctl */ | |
104 | #define LTTNG_UST_ENABLE _UST_CMD(0x80) | |
105 | #define LTTNG_UST_DISABLE _UST_CMD(0x81) | |
106 | ||
099e26bd DG |
107 | #define LTTNG_UST_ROOT_HANDLE 0 |
108 | ||
3817e7df | 109 | #endif /* _LTTNG_UST_H */ |