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; only version 2
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.
19 #ifndef _LTT_TRACE_UST_H
20 #define _LTT_TRACE_UST_H
23 #include <urcu/list.h>
25 #include <lttng/lttng.h>
26 #include <lttng-ust.h>
29 struct ltt_ust_event_list
{
31 struct cds_list_head head
;
34 /* UST Channel list */
35 struct ltt_ust_channel_list
{
37 struct cds_list_head head
;
41 struct ltt_ust_event
{
44 struct lttng_ust_context
*ctx
;
45 struct lttng_ust_event
*event
;
46 struct cds_list_head list
;
50 struct ltt_ust_channel
{
54 char *trace_path
; /* Trace file path name */
55 struct lttng_ust_context
*ctx
;
56 struct lttng_ust_channel
*attr
;
57 struct ltt_ust_event_list events
;
58 struct cds_list_head list
;
62 struct ltt_ust_metadata
{
64 char *trace_path
; /* Trace file path name */
65 struct lttng_ust_channel
*attr
;
69 struct ltt_ust_session
{
72 int uconsumer_fds_sent
;
74 struct ltt_ust_metadata
*metadata
;
75 struct ltt_ust_channel_list channels
;
79 * Lookup functions. NULL is returned if not found.
81 struct ltt_ust_event
*trace_ust_get_event_by_name(
82 char *name
, struct ltt_ust_channel
*channel
);
83 struct ltt_ust_channel
*trace_ust_get_channel_by_name(
84 char *name
, struct ltt_ust_session
*session
);
87 * Create functions malloc() the data structure.
89 struct ltt_ust_session
*trace_ust_create_session(void);
90 struct ltt_ust_channel
*trace_ust_create_channel(char *name
, char *path
,
91 struct lttng_ust_channel
*attr
);
92 struct ltt_ust_event
*trace_ust_create_event(struct lttng_event
*ev
);
93 struct ltt_ust_metadata
*trace_ust_create_metadata(char *path
);
96 * Destroy functions free() the data structure and remove from linked list if
99 void trace_ust_destroy_session(struct ltt_ust_session
*session
);
100 void trace_ust_destroy_metadata(struct ltt_ust_metadata
*metadata
);
101 void trace_ust_destroy_channel(struct ltt_ust_channel
*channel
);
102 void trace_ust_destroy_event(struct ltt_ust_event
*event
);
104 #endif /* _LTT_TRACE_UST_H */