Comments and cleanup review Mathieu & David
[lttng-tools.git] / include / lttng / lttng.h
CommitLineData
826d496d
MD
1/*
2 * Copyright (C) 2011 - David Goulet <david.goulet@polymtl.ca>
fac6795d
DG
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
fac6795d
DG
17 */
18
19#ifndef _LIBLTTNGCTL_H
20#define _LIBLTTNGCTL_H
21
57167058 22#include <limits.h>
16421f6e 23#include <stdint.h>
8028d920 24#include <uuid/uuid.h>
57167058 25
5b8719f5
DG
26/* Default unix group name for tracing.
27 */
fac6795d
DG
28#define DEFAULT_TRACING_GROUP "tracing"
29
5b8719f5
DG
30/* Environment variable to set session daemon
31 * binary path.
32 */
33#define LTTNG_SESSIOND_PATH_ENV "LTTNG_SESSIOND_PATH"
34
96243366 35/* UUID string length (including \0) */
fac6795d 36#define UUID_STR_LEN 37
96243366
DG
37/* UUID short string version length (including \0) */
38#define UUID_SHORT_STR_LEN 9
fac6795d 39
16421f6e
DG
40typedef uint64_t u64;
41
1657e9bb
DG
42/* Trace type for lttng_trace.
43 */
44enum lttng_trace_type {
45 KERNEL, USERSPACE,
46};
47
57167058
DG
48/* Simple structure representing a session.
49 */
50struct lttng_session {
51 char name[NAME_MAX];
96243366 52 uuid_t uuid;
57167058
DG
53};
54
1657e9bb
DG
55/* Simple trace representation.
56 */
57struct lttng_trace {
58 char name[NAME_MAX];
59 pid_t pid;
60 enum lttng_trace_type type;
61};
62
5e16da05 63/* TODO: don't export these into system-installed headers. */
16421f6e
DG
64/*
65 * LTTng DebugFS ABI structures.
66 */
67enum lttng_instrum_type {
68 INSTRUM_TRACEPOINTS,
69};
70
71struct lttng_channel {
72 int overwrite; /* 1: overwrite, 0: discard */
73 u64 subbuf_size;
74 u64 num_subbuf;
75 unsigned int switch_timer_interval;
76 unsigned int read_timer_interval;
77};
78
79struct lttng_event {
80 enum lttng_instrum_type itype;
81 char name[];
82};
83
8028d920
DG
84extern int lttng_create_session(char *name, uuid_t *session_id);
85extern int lttng_destroy_session(uuid_t *uuid);
fac6795d 86extern int lttng_connect_sessiond(void);
87378cf5 87extern int lttng_disconnect_sessiond(void);
fac6795d
DG
88extern int lttng_set_tracing_group(const char *name);
89extern int lttng_check_session_daemon(void);
90extern const char *lttng_get_readable_code(int code);
ca95a216
DG
91extern int lttng_ust_list_apps(pid_t **pids);
92extern int lttng_list_sessions(struct lttng_session **sessions);
1657e9bb 93extern int lttng_list_traces(uuid_t *uuid, struct lttng_trace **traces);
96243366 94extern void lttng_set_current_session_uuid(uuid_t *uuid);
df0da139 95extern int lttng_ust_create_trace(pid_t pid);
ce3d728c 96extern int lttng_ust_start_trace(pid_t pid);
520ff687 97extern int lttng_ust_stop_trace(pid_t pid);
fac6795d
DG
98
99#endif /* _LIBLTTNGCTL_H */
This page took 0.027099 seconds and 4 git commands to generate.