Tracepoint loglevel: setup all loglevel information at build time
[lttng-ust.git] / include / lttng / ust-abi.h
CommitLineData
9f3fdbc6
MD
1#ifndef _LTTNG_UST_ABI_H
2#define _LTTNG_UST_ABI_H
3
4/*
4318ae1b 5 * lttng/ust-abi.h
9f3fdbc6
MD
6 *
7 * Copyright 2010-2011 (c) - Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
8 *
9 * LTTng-UST ABI header
10 *
a60d70e6
MD
11 * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
12 * OR IMPLIED. ANY USE IS AT YOUR OWN RISK.
13 *
14 * Permission is hereby granted to use or copy this program
15 * for any purpose, provided the above notices are retained on all copies.
16 * Permission to modify the code and to distribute modified code is granted,
17 * provided the above notices are retained, and a notice that the code was
18 * modified is included with the above copyright notice.
9f3fdbc6
MD
19 */
20
0a42beb6
MD
21#include <stdint.h>
22
9f3fdbc6
MD
23#define LTTNG_UST_SYM_NAME_LEN 128
24
b35d179d
MD
25#define LTTNG_UST_COMM_VERSION_MAJOR 0
26#define LTTNG_UST_COMM_VERSION_MINOR 1
27
9f3fdbc6 28enum lttng_ust_instrumentation {
df854e41
MD
29 LTTNG_UST_TRACEPOINT = 0,
30 LTTNG_UST_PROBE = 1,
31 LTTNG_UST_FUNCTION = 2,
32 LTTNG_UST_TRACEPOINT_LOGLEVEL = 3,
9f3fdbc6
MD
33};
34
9f3fdbc6 35enum lttng_ust_output {
b35d179d 36 LTTNG_UST_MMAP = 0,
9f3fdbc6
MD
37};
38
b35d179d 39struct lttng_ust_tracer_version {
b728d87e
MD
40 uint32_t major;
41 uint32_t minor;
b35d179d 42 uint32_t patchlevel;
b35d179d 43};
9f3fdbc6
MD
44
45struct lttng_ust_channel {
46 int overwrite; /* 1: overwrite, 0: discard */
47 uint64_t subbuf_size; /* in bytes */
48 uint64_t num_subbuf;
49 unsigned int switch_timer_interval; /* usecs */
50 unsigned int read_timer_interval; /* usecs */
b35d179d 51 enum lttng_ust_output output; /* output mode */
193183fb
MD
52 /* The following fields are used internally within UST. */
53 int shm_fd;
54 int wait_fd;
55 uint64_t memory_map_size;
9f3fdbc6
MD
56};
57
381c0f1e
MD
58/*
59 * This structure is only used internally within UST. It is not per-se
60 * part of the communication between sessiond and UST.
61 */
62struct lttng_ust_stream {
63 int shm_fd;
64 int wait_fd;
65 uint64_t memory_map_size;
66};
67
9f3fdbc6
MD
68struct lttng_ust_event {
69 char name[LTTNG_UST_SYM_NAME_LEN]; /* event name */
70 enum lttng_ust_instrumentation instrumentation;
71 /* Per instrumentation type configuration */
72 union {
73 } u;
74};
75
9f3fdbc6 76enum lttng_ust_context_type {
3b402b40 77 LTTNG_UST_CONTEXT_VTID = 0,
c1ef86f0
MD
78 LTTNG_UST_CONTEXT_VPID = 1,
79 LTTNG_UST_CONTEXT_PTHREAD_ID = 2,
4847e9bb 80 LTTNG_UST_CONTEXT_PROCNAME = 3,
9f3fdbc6
MD
81};
82
83struct lttng_ust_context {
84 enum lttng_ust_context_type ctx;
85 union {
86 } u;
87};
88
92462b01
MD
89/*
90 * Tracer channel attributes.
91 */
92struct lttng_ust_channel_attr {
93 int overwrite; /* 1: overwrite, 0: discard */
94 uint64_t subbuf_size; /* bytes */
95 uint64_t num_subbuf; /* power of 2 */
96 unsigned int switch_timer_interval; /* usec */
97 unsigned int read_timer_interval; /* usec */
98 enum lttng_ust_output output; /* splice, mmap */
99};
100
df854e41
MD
101struct lttng_ust_loglevel {
102 char provider[LTTNG_UST_SYM_NAME_LEN];
103 char loglevel[LTTNG_UST_SYM_NAME_LEN];
104 int64_t value;
105};
106
92462b01
MD
107struct lttng_ust_object_data {
108 int handle;
109 int shm_fd;
110 int wait_fd;
111 uint64_t memory_map_size;
112};
113
9f3fdbc6
MD
114#define _UST_CMD(minor) (minor)
115#define _UST_CMDR(minor, type) (minor)
116#define _UST_CMDW(minor, type) (minor)
117
46050b1a
MD
118/* Handled by object descriptor */
119#define LTTNG_UST_RELEASE _UST_CMD(0x1)
120
121/* Handled by object cmd */
122
9f3fdbc6
MD
123/* LTTng-UST commands */
124#define LTTNG_UST_SESSION _UST_CMD(0x40)
125#define LTTNG_UST_TRACER_VERSION \
126 _UST_CMDR(0x41, struct lttng_ust_tracer_version)
127#define LTTNG_UST_TRACEPOINT_LIST _UST_CMD(0x42)
128#define LTTNG_UST_WAIT_QUIESCENT _UST_CMD(0x43)
11ff9c7d 129#define LTTNG_UST_REGISTER_DONE _UST_CMD(0x44)
df854e41 130#define LTTNG_UST_LOGLEVEL_LIST _UST_CMD(0x45)
9f3fdbc6 131
46050b1a 132/* Session FD commands */
9f3fdbc6
MD
133#define LTTNG_UST_METADATA \
134 _UST_CMDW(0x50, struct lttng_ust_channel)
135#define LTTNG_UST_CHANNEL \
136 _UST_CMDW(0x51, struct lttng_ust_channel)
137#define LTTNG_UST_SESSION_START _UST_CMD(0x52)
138#define LTTNG_UST_SESSION_STOP _UST_CMD(0x53)
139
46050b1a 140/* Channel FD commands */
9f3fdbc6
MD
141#define LTTNG_UST_STREAM _UST_CMD(0x60)
142#define LTTNG_UST_EVENT \
143 _UST_CMDW(0x61, struct lttng_ust_event)
144
46050b1a 145/* Event and Channel FD commands */
9f3fdbc6
MD
146#define LTTNG_UST_CONTEXT \
147 _UST_CMDW(0x70, struct lttng_ust_context)
43d330a4 148#define LTTNG_UST_FLUSH_BUFFER \
43861eab 149 _UST_CMD(0x71)
9f3fdbc6 150
46050b1a 151/* Event, Channel and Session commands */
9f3fdbc6
MD
152#define LTTNG_UST_ENABLE _UST_CMD(0x80)
153#define LTTNG_UST_DISABLE _UST_CMD(0x81)
154
51489cad
MD
155/* Tracepoint list commands */
156#define LTTNG_UST_TRACEPOINT_LIST_GET _UST_CMD(0x90)
157
df854e41
MD
158/* Loglevel list commands */
159#define LTTNG_UST_LOGLEVEL_LIST_GET _UST_CMD(0xA0)
160
46050b1a
MD
161#define LTTNG_UST_ROOT_HANDLE 0
162
b61ce3b2 163struct lttng_ust_obj;
46050b1a 164
b61ce3b2 165struct lttng_ust_objd_ops {
46050b1a
MD
166 long (*cmd)(int objd, unsigned int cmd, unsigned long arg);
167 int (*release)(int objd);
168};
169
170/* Create root handle. Always ID 0. */
171int lttng_abi_create_root_handle(void);
172
b61ce3b2 173const struct lttng_ust_objd_ops *objd_ops(int id);
d4419b81 174int lttng_ust_objd_unref(int id);
46050b1a
MD
175
176void lttng_ust_abi_exit(void);
003fedf4 177void lttng_ust_events_exit(void);
b35d179d 178
9f3fdbc6 179#endif /* _LTTNG_UST_ABI_H */
This page took 0.032678 seconds and 4 git commands to generate.