Change not implemented error to undefined.
[lttng-tools.git] / src / bin / lttng-sessiond / lttng-ust-abi.h
CommitLineData
3bd1e081
MD
1#ifndef _LTTNG_UST_ABI_H
2#define _LTTNG_UST_ABI_H
3
4/*
9df8df5e 5 * lttng/ust-abi.h
3bd1e081
MD
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
14#include <stdint.h>
15
57ab7638 16#define LTTNG_UST_SYM_NAME_LEN 256
3bd1e081
MD
17
18#define LTTNG_UST_COMM_VERSION_MAJOR 0
19#define LTTNG_UST_COMM_VERSION_MINOR 1
20
21enum lttng_ust_instrumentation {
177f8533
MD
22 LTTNG_UST_TRACEPOINT = 0,
23 LTTNG_UST_PROBE = 1,
24 LTTNG_UST_FUNCTION = 2,
25 LTTNG_UST_TRACEPOINT_LOGLEVEL = 3,
3bd1e081
MD
26};
27
28enum lttng_ust_output {
29 LTTNG_UST_MMAP = 0,
30};
31
32struct lttng_ust_tracer_version {
33 uint32_t version;
34 uint32_t patchlevel;
35 uint32_t sublevel;
36};
37
38struct 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 */
3bd1e081
MD
45};
46
47struct lttng_ust_event {
48 char name[LTTNG_UST_SYM_NAME_LEN]; /* event name */
49 enum lttng_ust_instrumentation instrumentation;
50 /* Per instrumentation type configuration */
51 union {
52 } u;
53};
54
55enum lttng_ust_context_type {
56 LTTNG_UST_CONTEXT_VTID = 0,
57 LTTNG_UST_CONTEXT_VPID = 1,
58 LTTNG_UST_CONTEXT_PTHREAD_ID = 2,
59 LTTNG_UST_CONTEXT_PROCNAME = 3,
60};
61
62struct lttng_ust_context {
63 enum lttng_ust_context_type ctx;
64 union {
65 } u;
66};
67
13161846
DG
68/*
69 * Tracer channel attributes.
70 */
71struct lttng_ust_channel_attr {
72 int overwrite; /* 1: overwrite, 0: discard */
73 uint64_t subbuf_size; /* bytes */
74 uint64_t num_subbuf; /* power of 2 */
75 unsigned int switch_timer_interval; /* usec */
76 unsigned int read_timer_interval; /* usec */
77 enum lttng_ust_output output; /* splice, mmap */
78};
79
177f8533
MD
80struct lttng_ust_tracepoint_iter {
81 char name[LTTNG_UST_SYM_NAME_LEN]; /* provider:name */
82 char loglevel[LTTNG_UST_SYM_NAME_LEN]; /* loglevel */
83 int64_t loglevel_value;
84};
85
13161846
DG
86struct lttng_ust_object_data {
87 int handle;
88 int shm_fd;
89 int wait_fd;
90 uint64_t memory_map_size;
91};
92
3bd1e081
MD
93#define _UST_CMD(minor) (minor)
94#define _UST_CMDR(minor, type) (minor)
95#define _UST_CMDW(minor, type) (minor)
96
97/* Handled by object descriptor */
98#define LTTNG_UST_RELEASE _UST_CMD(0x1)
99
100/* Handled by object cmd */
101
102/* LTTng-UST commands */
103#define LTTNG_UST_SESSION _UST_CMD(0x40)
104#define LTTNG_UST_TRACER_VERSION \
105 _UST_CMDR(0x41, struct lttng_ust_tracer_version)
106#define LTTNG_UST_TRACEPOINT_LIST _UST_CMD(0x42)
107#define LTTNG_UST_WAIT_QUIESCENT _UST_CMD(0x43)
108#define LTTNG_UST_REGISTER_DONE _UST_CMD(0x44)
109
110/* Session FD commands */
111#define LTTNG_UST_METADATA \
112 _UST_CMDW(0x50, struct lttng_ust_channel)
113#define LTTNG_UST_CHANNEL \
114 _UST_CMDW(0x51, struct lttng_ust_channel)
115#define LTTNG_UST_SESSION_START _UST_CMD(0x52)
116#define LTTNG_UST_SESSION_STOP _UST_CMD(0x53)
117
118/* Channel FD commands */
119#define LTTNG_UST_STREAM _UST_CMD(0x60)
120#define LTTNG_UST_EVENT \
121 _UST_CMDW(0x61, struct lttng_ust_event)
122
123/* Event and Channel FD commands */
124#define LTTNG_UST_CONTEXT \
125 _UST_CMDW(0x70, struct lttng_ust_context)
2bdd86d4
MD
126#define LTTNG_UST_FLUSH_BUFFER \
127 _UST_CMD(0x71)
3bd1e081
MD
128
129/* Event, Channel and Session commands */
130#define LTTNG_UST_ENABLE _UST_CMD(0x80)
131#define LTTNG_UST_DISABLE _UST_CMD(0x81)
132
8ec2d32a
MD
133/* Tracepoint list commands */
134#define LTTNG_UST_TRACEPOINT_LIST_GET _UST_CMD(0x90)
135
3bd1e081
MD
136#define LTTNG_UST_ROOT_HANDLE 0
137
9df8df5e 138struct lttng_ust_obj;
3bd1e081 139
18cef803
MD
140union ust_args {
141 struct {
142 int *shm_fd;
143 int *wait_fd;
144 uint64_t *memory_map_size;
145 } channel;
146 struct {
147 int *shm_fd;
148 int *wait_fd;
149 uint64_t *memory_map_size;
150 } stream;
151};
152
9df8df5e 153struct lttng_ust_objd_ops {
18cef803
MD
154 long (*cmd)(int objd, unsigned int cmd, unsigned long arg,
155 union ust_args *args);
3bd1e081
MD
156 int (*release)(int objd);
157};
158
159/* Create root handle. Always ID 0. */
160int lttng_abi_create_root_handle(void);
161
9df8df5e
DG
162const struct lttng_ust_objd_ops *objd_ops(int id);
163int lttng_ust_objd_unref(int id);
3bd1e081
MD
164
165void lttng_ust_abi_exit(void);
9df8df5e 166void lttng_ust_events_exit(void);
3bd1e081
MD
167
168#endif /* _LTTNG_UST_ABI_H */
This page took 0.046674 seconds and 4 git commands to generate.