Major changes
[lttng-tools.git] / ltt-sessiond / trace.h
CommitLineData
fda89c9b
DG
1/*
2 * Copyright (C) 2011 - David Goulet <david.goulet@polymtl.ca>
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.
17 */
18
19#ifndef _LTT_TRACE_H
20#define _LTT_TRACE_H
21
9e78d6ae
DG
22#include <limits.h>
23#include <urcu/list.h>
d4a2a84a 24
f3ed775e
DG
25#include <lttng/lttng.h>
26
27#include "lttng-kernel.h"
54012638 28
20fe2104
DG
29/* Kernel event list */
30struct ltt_kernel_event_list {
31 struct cds_list_head head;
32};
33
8c0faa1d
DG
34/* Channel stream list */
35struct ltt_kernel_stream_list {
36 struct cds_list_head head;
37};
38
39/* Channel list */
40struct ltt_kernel_channel_list {
41 struct cds_list_head head;
42};
43
20fe2104
DG
44/* Kernel event */
45struct ltt_kernel_event {
20fe2104 46 int fd;
f34daff7 47 struct lttng_kernel_event *event;
20fe2104
DG
48 struct cds_list_head list;
49};
50
51/* Kernel channel */
52struct ltt_kernel_channel {
53 int fd;
8c0faa1d
DG
54 char *pathname;
55 unsigned int stream_count;
f3ed775e 56 struct lttng_channel *channel;
20fe2104 57 struct ltt_kernel_event_list events_list;
8c0faa1d
DG
58 struct ltt_kernel_stream_list stream_list;
59 struct cds_list_head list;
20fe2104
DG
60};
61
aaf26714
DG
62/* Metadata */
63struct ltt_kernel_metadata {
64 int fd;
8c0faa1d 65 char *pathname;
f3ed775e 66 struct lttng_channel *conf;
aaf26714
DG
67};
68
8c0faa1d
DG
69/* Channel stream */
70struct ltt_kernel_stream {
71 int fd;
72 char *pathname;
73 int state;
74 struct cds_list_head list;
75};
76
20fe2104
DG
77/* Kernel session */
78struct ltt_kernel_session {
79 int fd;
8c0faa1d 80 int metadata_stream_fd;
f3ed775e 81 int kconsumer_fds_sent;
8c0faa1d
DG
82 unsigned int channel_count;
83 unsigned int stream_count_global;
aaf26714 84 struct ltt_kernel_metadata *metadata;
8c0faa1d 85 struct ltt_kernel_channel_list channel_list;
fda89c9b
DG
86};
87
88/* UST trace representation */
89struct ltt_ust_trace {
90 struct cds_list_head list;
1657e9bb 91 char name[NAME_MAX];
fda89c9b
DG
92 int shmid;
93 pid_t pid;
94 struct cds_list_head markers;
95};
96
97struct ltt_ust_marker {
98 struct cds_list_head list;
99 char *name;
100 char *channel;
101};
102
54012638 103/*
c363b55d 104 * Create functions malloc() the data structure.
54012638 105 */
54012638 106struct ltt_kernel_session *trace_create_kernel_session(void);
f3ed775e
DG
107struct ltt_kernel_channel *trace_create_kernel_channel(struct lttng_channel *chan);
108struct ltt_kernel_event *trace_create_kernel_event(struct lttng_event *ev);
54012638 109struct ltt_kernel_metadata *trace_create_kernel_metadata(void);
54012638
DG
110struct ltt_kernel_stream *trace_create_kernel_stream(void);
111
c363b55d
DG
112/*
113 * Destroy functions free() the data structure and remove from linked list if
114 * it's applies.
115 */
116void trace_destroy_kernel_session(struct ltt_kernel_session *session);
117void trace_destroy_kernel_metadata(struct ltt_kernel_metadata *metadata);
118void trace_destroy_kernel_channel(struct ltt_kernel_channel *channel);
119void trace_destroy_kernel_event(struct ltt_kernel_event *event);
120void trace_destroy_kernel_stream(struct ltt_kernel_stream *stream);
121
fda89c9b 122#endif /* _LTT_TRACE_H */
This page took 0.028178 seconds and 4 git commands to generate.