Update UST ABI and add UST some error message
[lttng-tools.git] / include / lttng-ust.h
CommitLineData
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
22/* See lttng-ust.h enum lttng_ust_output */
23#define DEFAULT_UST_CHANNEL_OUTPUT LTTNG_UST_MMAP
3817e7df
DG
24
25enum lttng_ust_instrumentation {
26 LTTNG_UST_TRACEPOINT = 0,
27 LTTNG_UST_PROBE = 1,
28 LTTNG_UST_FUNCTION = 2,
29};
30
31enum lttng_ust_output {
32 LTTNG_UST_MMAP = 0,
33};
34
35struct lttng_ust_tracer_version {
36 uint32_t version;
37 uint32_t patchlevel;
38 uint32_t sublevel;
39};
40
41struct lttng_ust_channel {
42 int overwrite; /* 1: overwrite, 0: discard */
43 uint64_t subbuf_size; /* in bytes */
44 uint64_t num_subbuf;
45 unsigned int switch_timer_interval; /* usecs */
46 unsigned int read_timer_interval; /* usecs */
47 enum lttng_ust_output output; /* output mode */
2b0bf864
DG
48 /* The following fields are used internally within UST. */
49 int shm_fd;
50 int wait_fd;
51 uint64_t memory_map_size;
3817e7df
DG
52};
53
54struct lttng_ust_event {
55 char name[LTTNG_UST_SYM_NAME_LEN]; /* event name */
56 enum lttng_ust_instrumentation instrumentation;
57 /* Per instrumentation type configuration */
58 union {
59 } u;
60};
61
62enum lttng_ust_context_type {
63 LTTNG_UST_CONTEXT_VTID = 0,
64};
65
66struct lttng_ust_context {
67 enum lttng_ust_context_type ctx;
68 union {
69 } u;
70};
71
72#define _UST_CMD(minor) (minor)
73#define _UST_CMDR(minor, type) (minor)
74#define _UST_CMDW(minor, type) (minor)
75
76/* Handled by object descriptor */
77#define LTTNG_UST_RELEASE _UST_CMD(0x1)
78
79/* Handled by object cmd */
80
81/* LTTng-UST commands */
82#define LTTNG_UST_SESSION _UST_CMD(0x40)
83#define LTTNG_UST_TRACER_VERSION \
84 _UST_CMDR(0x41, struct lttng_ust_tracer_version)
85#define LTTNG_UST_TRACEPOINT_LIST _UST_CMD(0x42)
86#define LTTNG_UST_WAIT_QUIESCENT _UST_CMD(0x43)
099e26bd 87#define LTTNG_UST_REGISTER_DONE _UST_CMD(0x44)
3817e7df
DG
88
89/* Session FD ioctl */
90#define LTTNG_UST_METADATA \
91 _UST_CMDW(0x50, struct lttng_ust_channel)
92#define LTTNG_UST_CHANNEL \
93 _UST_CMDW(0x51, struct lttng_ust_channel)
94#define LTTNG_UST_SESSION_START _UST_CMD(0x52)
95#define LTTNG_UST_SESSION_STOP _UST_CMD(0x53)
96
97/* Channel FD ioctl */
98#define LTTNG_UST_STREAM _UST_CMD(0x60)
99#define LTTNG_UST_EVENT \
100 _UST_CMDW(0x61, struct lttng_ust_event)
101
102/* Event and Channel FD ioctl */
103#define LTTNG_UST_CONTEXT \
104 _UST_CMDW(0x70, struct lttng_ust_context)
105
106/* Event, Channel and Session ioctl */
107#define LTTNG_UST_ENABLE _UST_CMD(0x80)
108#define LTTNG_UST_DISABLE _UST_CMD(0x81)
109
099e26bd
DG
110#define LTTNG_UST_ROOT_HANDLE 0
111
3817e7df 112#endif /* _LTTNG_UST_H */
This page took 0.038561 seconds and 4 git commands to generate.