Add vtid (gettid()) context
[lttng-ust.git] / include / ust / lttng-ust-abi.h
... / ...
CommitLineData
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
14#include <stdint.h>
15
16#define LTTNG_UST_SYM_NAME_LEN 128
17
18#define LTTNG_UST_COMM_VERSION_MAJOR 0
19#define LTTNG_UST_COMM_VERSION_MINOR 1
20
21enum lttng_ust_instrumentation {
22 LTTNG_UST_TRACEPOINT = 0,
23 LTTNG_UST_PROBE = 1,
24 LTTNG_UST_FUNCTION = 2,
25};
26
27enum lttng_ust_output {
28 LTTNG_UST_MMAP = 0,
29};
30
31struct lttng_ust_tracer_version {
32 uint32_t version;
33 uint32_t patchlevel;
34 uint32_t sublevel;
35};
36
37struct 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 */
43 enum lttng_ust_output output; /* output mode */
44 /* The following fields are used internally within UST. */
45 int shm_fd;
46 int wait_fd;
47 uint64_t memory_map_size;
48};
49
50/*
51 * This structure is only used internally within UST. It is not per-se
52 * part of the communication between sessiond and UST.
53 */
54struct lttng_ust_stream {
55 int shm_fd;
56 int wait_fd;
57 uint64_t memory_map_size;
58};
59
60struct lttng_ust_event {
61 char name[LTTNG_UST_SYM_NAME_LEN]; /* event name */
62 enum lttng_ust_instrumentation instrumentation;
63 /* Per instrumentation type configuration */
64 union {
65 } u;
66};
67
68enum lttng_ust_context_type {
69 LTTNG_UST_CONTEXT_VTID = 0,
70 LTTNG_UST_CONTEXT_PTHREAD_ID = 1,
71};
72
73struct lttng_ust_context {
74 enum lttng_ust_context_type ctx;
75 union {
76 } u;
77};
78
79#define _UST_CMD(minor) (minor)
80#define _UST_CMDR(minor, type) (minor)
81#define _UST_CMDW(minor, type) (minor)
82
83/* Handled by object descriptor */
84#define LTTNG_UST_RELEASE _UST_CMD(0x1)
85
86/* Handled by object cmd */
87
88/* LTTng-UST commands */
89#define LTTNG_UST_SESSION _UST_CMD(0x40)
90#define LTTNG_UST_TRACER_VERSION \
91 _UST_CMDR(0x41, struct lttng_ust_tracer_version)
92#define LTTNG_UST_TRACEPOINT_LIST _UST_CMD(0x42)
93#define LTTNG_UST_WAIT_QUIESCENT _UST_CMD(0x43)
94#define LTTNG_UST_REGISTER_DONE _UST_CMD(0x44)
95
96/* Session FD commands */
97#define LTTNG_UST_METADATA \
98 _UST_CMDW(0x50, struct lttng_ust_channel)
99#define LTTNG_UST_CHANNEL \
100 _UST_CMDW(0x51, struct lttng_ust_channel)
101#define LTTNG_UST_SESSION_START _UST_CMD(0x52)
102#define LTTNG_UST_SESSION_STOP _UST_CMD(0x53)
103
104/* Channel FD commands */
105#define LTTNG_UST_STREAM _UST_CMD(0x60)
106#define LTTNG_UST_EVENT \
107 _UST_CMDW(0x61, struct lttng_ust_event)
108
109/* Event and Channel FD commands */
110#define LTTNG_UST_CONTEXT \
111 _UST_CMDW(0x70, struct lttng_ust_context)
112
113/* Event, Channel and Session commands */
114#define LTTNG_UST_ENABLE _UST_CMD(0x80)
115#define LTTNG_UST_DISABLE _UST_CMD(0x81)
116
117#define LTTNG_UST_ROOT_HANDLE 0
118
119struct obj;
120
121struct objd_ops {
122 long (*cmd)(int objd, unsigned int cmd, unsigned long arg);
123 int (*release)(int objd);
124};
125
126/* Create root handle. Always ID 0. */
127int lttng_abi_create_root_handle(void);
128
129const struct objd_ops *objd_ops(int id);
130int objd_unref(int id);
131
132void lttng_ust_abi_exit(void);
133void ltt_events_exit(void);
134
135#endif /* _LTTNG_UST_ABI_H */
This page took 0.023944 seconds and 4 git commands to generate.