1 #ifndef _LTTNG_UST_ABI_H
2 #define _LTTNG_UST_ABI_H
7 * Copyright 2010-2011 (c) - Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 * Dual LGPL v2.1/GPL v2 license.
16 #define LTTNG_UST_SYM_NAME_LEN 128
18 #define LTTNG_UST_COMM_VERSION_MAJOR 0
19 #define LTTNG_UST_COMM_VERSION_MINOR 1
21 enum lttng_ust_instrumentation
{
22 LTTNG_UST_TRACEPOINT
= 0,
24 LTTNG_UST_FUNCTION
= 2,
27 enum lttng_ust_output
{
31 struct lttng_ust_tracer_version
{
37 struct lttng_ust_channel
{
38 int overwrite
; /* 1: overwrite, 0: discard */
39 uint64_t subbuf_size
; /* in bytes */
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. */
47 uint64_t memory_map_size
;
51 * This structure is only used internally within UST. It is not per-se
52 * part of the communication between sessiond and UST.
54 struct lttng_ust_stream
{
57 uint64_t memory_map_size
;
60 struct lttng_ust_event
{
61 char name
[LTTNG_UST_SYM_NAME_LEN
]; /* event name */
62 enum lttng_ust_instrumentation instrumentation
;
63 /* Per instrumentation type configuration */
68 enum lttng_ust_context_type
{
69 LTTNG_UST_CONTEXT_VTID
= 0,
70 LTTNG_UST_CONTEXT_VPID
= 1,
71 LTTNG_UST_CONTEXT_PTHREAD_ID
= 2,
72 LTTNG_UST_CONTEXT_PROCNAME
= 3,
75 struct lttng_ust_context
{
76 enum lttng_ust_context_type ctx
;
81 #define _UST_CMD(minor) (minor)
82 #define _UST_CMDR(minor, type) (minor)
83 #define _UST_CMDW(minor, type) (minor)
85 /* Handled by object descriptor */
86 #define LTTNG_UST_RELEASE _UST_CMD(0x1)
88 /* Handled by object cmd */
90 /* LTTng-UST commands */
91 #define LTTNG_UST_SESSION _UST_CMD(0x40)
92 #define LTTNG_UST_TRACER_VERSION \
93 _UST_CMDR(0x41, struct lttng_ust_tracer_version)
94 #define LTTNG_UST_TRACEPOINT_LIST _UST_CMD(0x42)
95 #define LTTNG_UST_WAIT_QUIESCENT _UST_CMD(0x43)
96 #define LTTNG_UST_REGISTER_DONE _UST_CMD(0x44)
98 /* Session FD commands */
99 #define LTTNG_UST_METADATA \
100 _UST_CMDW(0x50, struct lttng_ust_channel)
101 #define LTTNG_UST_CHANNEL \
102 _UST_CMDW(0x51, struct lttng_ust_channel)
103 #define LTTNG_UST_SESSION_START _UST_CMD(0x52)
104 #define LTTNG_UST_SESSION_STOP _UST_CMD(0x53)
106 /* Channel FD commands */
107 #define LTTNG_UST_STREAM _UST_CMD(0x60)
108 #define LTTNG_UST_EVENT \
109 _UST_CMDW(0x61, struct lttng_ust_event)
111 /* Event and Channel FD commands */
112 #define LTTNG_UST_CONTEXT \
113 _UST_CMDW(0x70, struct lttng_ust_context)
115 /* Event, Channel and Session commands */
116 #define LTTNG_UST_ENABLE _UST_CMD(0x80)
117 #define LTTNG_UST_DISABLE _UST_CMD(0x81)
119 #define LTTNG_UST_ROOT_HANDLE 0
124 long (*cmd
)(int objd
, unsigned int cmd
, unsigned long arg
);
125 int (*release
)(int objd
);
128 /* Create root handle. Always ID 0. */
129 int lttng_abi_create_root_handle(void);
131 const struct objd_ops
*objd_ops(int id
);
132 int objd_unref(int id
);
134 void lttng_ust_abi_exit(void);
135 void ltt_events_exit(void);
137 #endif /* _LTTNG_UST_ABI_H */