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>
28 #include "traceable-app.h"
33 struct ltt_ust_session_list
{
35 struct cds_list_head head
;
39 struct ltt_ust_event_list
{
41 struct cds_list_head head
;
44 /* UST Channel list */
45 struct ltt_ust_channel_list
{
47 struct cds_list_head head
;
51 struct ltt_ust_event
{
54 struct lttng_ust_context
*ctx
;
55 struct lttng_ust_event
*event
;
56 struct cds_list_head list
;
60 struct ltt_ust_channel
{
64 char *trace_path
; /* Trace file path name */
65 struct lttng_ust_context
*ctx
;
66 struct lttng_ust_channel
*attr
;
67 struct ltt_ust_event_list events
;
68 struct cds_list_head list
;
72 struct ltt_ust_metadata
{
74 char *trace_path
; /* Trace file path name */
75 struct lttng_ust_channel
*attr
;
79 struct ltt_ust_session
{
82 int uconsumer_fds_sent
;
84 struct ltt_traceable_app
*app
;
85 struct ltt_ust_metadata
*metadata
;
86 struct ltt_ust_channel_list channels
;
87 struct cds_list_head list
;
91 * Lookup functions. NULL is returned if not found.
93 struct ltt_ust_event
*trace_ust_get_event_by_name(
94 char *name
, struct ltt_ust_channel
*channel
);
95 struct ltt_ust_channel
*trace_ust_get_channel_by_name(
96 char *name
, struct ltt_ust_session
*session
);
97 struct ltt_ust_session
*trace_ust_get_session_by_pid(pid_t pid
,
98 struct ltt_ust_session_list
*session_list
);
101 * Create functions malloc() the data structure.
103 struct ltt_ust_session
*trace_ust_create_session(char *path
, pid_t pid
);
104 struct ltt_ust_channel
*trace_ust_create_channel(char *name
, char *path
,
105 struct lttng_ust_channel
*attr
);
106 struct ltt_ust_event
*trace_ust_create_event(struct lttng_event
*ev
);
107 struct ltt_ust_metadata
*trace_ust_create_metadata(char *path
);
110 * Destroy functions free() the data structure and remove from linked list if
113 void trace_ust_destroy_session(struct ltt_ust_session
*session
);
114 void trace_ust_destroy_metadata(struct ltt_ust_metadata
*metadata
);
115 void trace_ust_destroy_channel(struct ltt_ust_channel
*channel
);
116 void trace_ust_destroy_event(struct ltt_ust_event
*event
);
118 #endif /* _LTT_TRACE_UST_H */