Fix message argument type
[lttng-tools.git] / include / lttng / lttng.h
... / ...
CommitLineData
1/*
2 * lttng.h
3 *
4 * Linux Trace Toolkit Control Library Header File
5 *
6 * Copyright (C) 2011 - David Goulet <david.goulet@polymtl.ca>
7 *
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.
12 *
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.
17 *
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.
21 */
22
23#ifndef _LTTNG_H
24#define _LTTNG_H
25
26#include <limits.h>
27#include <uuid/uuid.h>
28
29/* Default unix group name for tracing. */
30#define LTTNG_DEFAULT_TRACING_GROUP "tracing"
31
32/* Environment variable to set session daemon binary path. */
33#define LTTNG_SESSIOND_PATH_ENV "LTTNG_SESSIOND_PATH"
34
35/*
36 * Trace type for lttng_trace.
37 */
38enum lttng_trace_type {
39 KERNEL,
40 USERSPACE,
41};
42
43/*
44 * Basic trace information exposed.
45 */
46struct lttng_trace {
47 char name[NAME_MAX];
48 pid_t pid; /* Only useful for user-space trace */
49 enum lttng_trace_type type;
50};
51
52/*
53 * Basic session information exposed.
54 */
55struct lttng_session {
56 char name[NAME_MAX];
57 uuid_t uuid;
58};
59
60/*
61 * Session daemon control
62 */
63extern int lttng_connect_sessiond(void);
64extern int lttng_create_session(char *name);
65extern int lttng_destroy_session(uuid_t *uuid);
66extern int lttng_disconnect_sessiond(void);
67/* Return an allocated array of lttng_session */
68extern int lttng_list_sessions(struct lttng_session **sessions);
69/* Return an allocated array of lttng_traces */
70extern int lttng_list_traces(uuid_t *uuid, struct lttng_trace **traces);
71extern int lttng_session_daemon_alive(void);
72/* Set tracing group for the current execution */
73extern int lttng_set_tracing_group(const char *name);
74/* Set session uuid for the current execution */
75extern void lttng_set_current_session_uuid(uuid_t *uuid);
76extern const char *lttng_get_readable_code(int code);
77
78/*
79 * User-space tracer control
80 */
81extern int lttng_ust_create_trace(pid_t pid);
82/* Return an allocated array of pids */
83extern int lttng_ust_list_apps(pid_t **pids);
84extern int lttng_ust_start_trace(pid_t pid);
85extern int lttng_ust_stop_trace(pid_t pid);
86
87/*
88 * Kernel tracer control
89 */
90extern int lttng_kernel_create_channel(void);
91extern int lttng_kernel_create_session(void);
92extern int lttng_kernel_create_stream(void);
93extern int lttng_kernel_disable_event(char *event_name);
94extern int lttng_kernel_enable_event(char *event_name);
95extern int lttng_kernel_list_events(char **event_list);
96extern int lttng_kernel_open_metadata(void);
97extern int lttng_kernel_start_tracing(void);
98extern int lttng_kernel_stop_tracing(void);
99
100#endif /* _LTTNG_H */
This page took 0.022764 seconds and 4 git commands to generate.