Commit | Line | Data |
---|---|---|
9f3fdbc6 MD |
1 | #ifndef _LTTNG_UST_ABI_H |
2 | #define _LTTNG_UST_ABI_H | |
3 | ||
4 | /* | |
5 | * lttng-ust-abi.h | |
6 | * | |
7 | * Copyright 2010-2011 (c) - Mathieu Desnoyers <mathieu.desnoyers@efficios.com> | |
8 | * | |
9 | * LTTng-UST ABI header | |
10 | * | |
11 | * Dual LGPL v2.1/GPL v2 license. | |
12 | */ | |
13 | ||
0a42beb6 MD |
14 | #include <stdint.h> |
15 | ||
9f3fdbc6 MD |
16 | #define LTTNG_UST_SYM_NAME_LEN 128 |
17 | ||
b35d179d MD |
18 | #define LTTNG_UST_COMM_VERSION_MAJOR 0 |
19 | #define LTTNG_UST_COMM_VERSION_MINOR 1 | |
20 | ||
9f3fdbc6 MD |
21 | enum lttng_ust_instrumentation { |
22 | LTTNG_UST_TRACEPOINT = 0, | |
b35d179d MD |
23 | LTTNG_UST_PROBE = 1, |
24 | LTTNG_UST_FUNCTION = 2, | |
9f3fdbc6 MD |
25 | }; |
26 | ||
9f3fdbc6 | 27 | enum lttng_ust_output { |
b35d179d | 28 | LTTNG_UST_MMAP = 0, |
9f3fdbc6 MD |
29 | }; |
30 | ||
b35d179d MD |
31 | struct lttng_ust_tracer_version { |
32 | uint32_t version; | |
33 | uint32_t patchlevel; | |
34 | uint32_t sublevel; | |
35 | }; | |
9f3fdbc6 MD |
36 | |
37 | struct lttng_ust_channel { | |
38 | int overwrite; /* 1: overwrite, 0: discard */ | |
39 | uint64_t subbuf_size; /* in bytes */ | |
40 | uint64_t num_subbuf; | |
41 | unsigned int switch_timer_interval; /* usecs */ | |
42 | unsigned int read_timer_interval; /* usecs */ | |
b35d179d | 43 | enum lttng_ust_output output; /* output mode */ |
9f3fdbc6 MD |
44 | }; |
45 | ||
381c0f1e MD |
46 | /* |
47 | * This structure is only used internally within UST. It is not per-se | |
48 | * part of the communication between sessiond and UST. | |
49 | */ | |
50 | struct lttng_ust_stream { | |
51 | int shm_fd; | |
52 | int wait_fd; | |
53 | uint64_t memory_map_size; | |
54 | }; | |
55 | ||
9f3fdbc6 MD |
56 | struct lttng_ust_event { |
57 | char name[LTTNG_UST_SYM_NAME_LEN]; /* event name */ | |
58 | enum lttng_ust_instrumentation instrumentation; | |
59 | /* Per instrumentation type configuration */ | |
60 | union { | |
61 | } u; | |
62 | }; | |
63 | ||
9f3fdbc6 MD |
64 | enum lttng_ust_context_type { |
65 | LTTNG_UST_CONTEXT_VTID = 0, | |
66 | }; | |
67 | ||
68 | struct lttng_ust_context { | |
69 | enum lttng_ust_context_type ctx; | |
70 | union { | |
71 | } u; | |
72 | }; | |
73 | ||
74 | #define _UST_CMD(minor) (minor) | |
75 | #define _UST_CMDR(minor, type) (minor) | |
76 | #define _UST_CMDW(minor, type) (minor) | |
77 | ||
46050b1a MD |
78 | /* Handled by object descriptor */ |
79 | #define LTTNG_UST_RELEASE _UST_CMD(0x1) | |
80 | ||
81 | /* Handled by object cmd */ | |
82 | ||
9f3fdbc6 MD |
83 | /* LTTng-UST commands */ |
84 | #define LTTNG_UST_SESSION _UST_CMD(0x40) | |
85 | #define LTTNG_UST_TRACER_VERSION \ | |
86 | _UST_CMDR(0x41, struct lttng_ust_tracer_version) | |
87 | #define LTTNG_UST_TRACEPOINT_LIST _UST_CMD(0x42) | |
88 | #define LTTNG_UST_WAIT_QUIESCENT _UST_CMD(0x43) | |
11ff9c7d | 89 | #define LTTNG_UST_REGISTER_DONE _UST_CMD(0x44) |
9f3fdbc6 | 90 | |
46050b1a | 91 | /* Session FD commands */ |
9f3fdbc6 MD |
92 | #define LTTNG_UST_METADATA \ |
93 | _UST_CMDW(0x50, struct lttng_ust_channel) | |
94 | #define LTTNG_UST_CHANNEL \ | |
95 | _UST_CMDW(0x51, struct lttng_ust_channel) | |
96 | #define LTTNG_UST_SESSION_START _UST_CMD(0x52) | |
97 | #define LTTNG_UST_SESSION_STOP _UST_CMD(0x53) | |
98 | ||
46050b1a | 99 | /* Channel FD commands */ |
9f3fdbc6 MD |
100 | #define LTTNG_UST_STREAM _UST_CMD(0x60) |
101 | #define LTTNG_UST_EVENT \ | |
102 | _UST_CMDW(0x61, struct lttng_ust_event) | |
103 | ||
46050b1a | 104 | /* Event and Channel FD commands */ |
9f3fdbc6 MD |
105 | #define LTTNG_UST_CONTEXT \ |
106 | _UST_CMDW(0x70, struct lttng_ust_context) | |
107 | ||
46050b1a | 108 | /* Event, Channel and Session commands */ |
9f3fdbc6 MD |
109 | #define LTTNG_UST_ENABLE _UST_CMD(0x80) |
110 | #define LTTNG_UST_DISABLE _UST_CMD(0x81) | |
111 | ||
46050b1a MD |
112 | #define LTTNG_UST_ROOT_HANDLE 0 |
113 | ||
114 | struct obj; | |
115 | ||
116 | struct objd_ops { | |
117 | long (*cmd)(int objd, unsigned int cmd, unsigned long arg); | |
118 | int (*release)(int objd); | |
119 | }; | |
120 | ||
121 | /* Create root handle. Always ID 0. */ | |
122 | int lttng_abi_create_root_handle(void); | |
123 | ||
124 | const struct objd_ops *objd_ops(int id); | |
1ea11eab | 125 | int objd_unref(int id); |
46050b1a MD |
126 | |
127 | void lttng_ust_abi_exit(void); | |
1ea11eab | 128 | void ltt_events_exit(void); |
b35d179d | 129 | |
9f3fdbc6 | 130 | #endif /* _LTTNG_UST_ABI_H */ |