4 * Linux Trace Toolkit Control Library Header File
6 * Copyright (C) 2011 - David Goulet <david.goulet@polymtl.ca>
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
26 #include <asm/types.h>
30 /* Default unix group name for tracing. */
31 #define LTTNG_DEFAULT_TRACING_GROUP "tracing"
33 /* Environment variable to set session daemon binary path. */
34 #define LTTNG_SESSIOND_PATH_ENV "LTTNG_SESSIOND_PATH"
37 * Event symbol length.
39 #define LTTNG_SYMBOL_NAME_LEN 128
41 enum lttng_event_type
{
42 LTTNG_EVENT_TRACEPOINTS
,
48 * Either addr is used or symbol_name and offset.
50 struct lttng_event_kprobe_attr
{
54 char symbol_name
[LTTNG_SYMBOL_NAME_LEN
];
60 struct lttng_event_function_attr
{
61 char symbol_name
[LTTNG_SYMBOL_NAME_LEN
];
68 char name
[LTTNG_SYMBOL_NAME_LEN
];
69 enum lttng_event_type type
;
70 /* Per event type configuration */
72 struct lttng_event_kprobe_attr kprobe
;
73 struct lttng_event_function_attr ftrace
;
77 /* Tracer channel attributes */
78 struct lttng_channel_attr
{
79 int overwrite
; /* 1: overwrite, 0: discard */
80 uint64_t subbuf_size
; /* bytes */
81 uint64_t num_subbuf
; /* power of 2 */
82 unsigned int switch_timer_interval
; /* usec */
83 unsigned int read_timer_interval
; /* usec */
87 * Basic session information.
89 struct lttng_session
{
94 /* Channel information structure */
95 struct lttng_channel
{
97 struct lttng_channel_attr attr
;
101 * Session daemon control
103 extern int lttng_connect_sessiond(void);
105 extern int lttng_create_session(char *name
, char *path
);
107 extern int lttng_destroy_session(char *name
);
109 extern int lttng_disconnect_sessiond(void);
111 /* Return an allocated array of lttng_session */
112 extern int lttng_list_sessions(struct lttng_session
**sessions
);
114 extern int lttng_session_daemon_alive(void);
116 /* Set tracing group for the current execution */
117 extern int lttng_set_tracing_group(const char *name
);
119 extern void lttng_set_session_name(char *name
);
121 extern const char *lttng_get_readable_code(int code
);
123 extern int lttng_start_tracing(char *session_name
);
125 extern int lttng_stop_tracing(char *session_name
);
127 //extern int lttng_ust_list_traceable_apps(pid_t **pids);
130 * LTTng Kernel tracer control
132 extern int lttng_kernel_create_channel(struct lttng_channel
*chan
);
134 extern int lttng_kernel_enable_event(struct lttng_event
*ev
, char *channel_name
);
136 extern int lttng_kernel_enable_channel(char *name
);
138 extern int lttng_kernel_disable_event(char *name
, char *channel_name
);
140 extern int lttng_kernel_disable_channel(char *name
);
142 extern int lttng_kernel_list_events(char **event_list
);
145 * LTTng User-space tracer control
148 #endif /* _LTTNG_H */