2 * Copyright (C) 2011 - David Goulet <david.goulet@polymtl.ca>
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.
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.
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.
23 #include <urcu/list.h>
25 #include <lttng/lttng.h>
27 #include "lttng-kernel.h"
29 /* Kernel event list */
30 struct ltt_kernel_event_list
{
31 struct cds_list_head head
;
34 /* Channel stream list */
35 struct ltt_kernel_stream_list
{
36 struct cds_list_head head
;
40 struct ltt_kernel_channel_list
{
41 struct cds_list_head head
;
45 struct ltt_kernel_event
{
47 struct lttng_kernel_event
*event
;
48 struct cds_list_head list
;
52 struct ltt_kernel_channel
{
55 unsigned int stream_count
;
56 struct lttng_channel
*channel
;
57 struct ltt_kernel_event_list events_list
;
58 struct ltt_kernel_stream_list stream_list
;
59 struct cds_list_head list
;
63 struct ltt_kernel_metadata
{
66 struct lttng_channel
*conf
;
70 struct ltt_kernel_stream
{
74 struct cds_list_head list
;
78 struct ltt_kernel_session
{
80 int metadata_stream_fd
;
81 int kconsumer_fds_sent
;
82 unsigned int channel_count
;
83 unsigned int stream_count_global
;
84 struct ltt_kernel_metadata
*metadata
;
85 struct ltt_kernel_channel_list channel_list
;
88 /* UST trace representation */
89 struct ltt_ust_trace
{
90 struct cds_list_head list
;
94 struct cds_list_head markers
;
97 struct ltt_ust_marker
{
98 struct cds_list_head list
;
104 * Create functions malloc() the data structure.
106 struct ltt_kernel_session
*trace_create_kernel_session(void);
107 struct ltt_kernel_channel
*trace_create_kernel_channel(struct lttng_channel
*chan
);
108 struct ltt_kernel_event
*trace_create_kernel_event(struct lttng_event
*ev
);
109 struct ltt_kernel_metadata
*trace_create_kernel_metadata(void);
110 struct ltt_kernel_stream
*trace_create_kernel_stream(void);
113 * Destroy functions free() the data structure and remove from linked list if
116 void trace_destroy_kernel_session(struct ltt_kernel_session
*session
);
117 void trace_destroy_kernel_metadata(struct ltt_kernel_metadata
*metadata
);
118 void trace_destroy_kernel_channel(struct ltt_kernel_channel
*channel
);
119 void trace_destroy_kernel_event(struct ltt_kernel_event
*event
);
120 void trace_destroy_kernel_stream(struct ltt_kernel_stream
*stream
);
122 #endif /* _LTT_TRACE_H */