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>
31 struct ltt_ust_session_list
{
33 struct cds_list_head head
;
37 struct ltt_ust_event_list
{
39 struct cds_list_head head
;
42 /* UST Channel list */
43 struct ltt_ust_channel_list
{
45 struct cds_list_head head
;
49 struct ltt_ust_event
{
52 struct lttng_ust_context ctx
;
53 struct lttng_ust_event attr
;
54 struct cds_list_head list
;
58 struct ltt_ust_channel
{
61 char name
[LTTNG_UST_SYM_NAME_LEN
];
62 char trace_path
[PATH_MAX
]; /* Trace file path name */
63 struct lttng_ust_context ctx
;
64 struct lttng_ust_channel attr
;
65 struct ltt_ust_event_list events
;
66 struct cds_list_head list
;
70 struct ltt_ust_metadata
{
72 char *trace_path
; /* Trace file path name */
73 struct lttng_ust_channel attr
;
77 struct ltt_ust_session
{
80 int uconsumer_fds_sent
;
82 struct lttng_domain domain
;
83 struct ltt_ust_metadata
*metadata
;
84 struct ltt_ust_channel_list channels
;
85 struct cds_list_head list
;
89 * Lookup functions. NULL is returned if not found.
91 struct ltt_ust_event
*trace_ust_get_event_by_name(
92 char *name
, struct ltt_ust_channel
*channel
);
93 struct ltt_ust_channel
*trace_ust_get_channel_by_name(
94 char *name
, struct ltt_ust_session
*session
);
95 struct ltt_ust_session
*trace_ust_get_session_by_pid(
96 struct ltt_ust_session_list
*session_list
, pid_t pid
);
99 * Create functions malloc() the data structure.
101 struct ltt_ust_session
*trace_ust_create_session(char *path
, pid_t pid
,
102 struct lttng_domain
*domain
);
103 struct ltt_ust_channel
*trace_ust_create_channel(struct lttng_channel
*attr
,
105 struct ltt_ust_event
*trace_ust_create_event(struct lttng_event
*ev
);
106 struct ltt_ust_metadata
*trace_ust_create_metadata(char *path
);
109 * Destroy functions free() the data structure and remove from linked list if
112 void trace_ust_destroy_session(struct ltt_ust_session
*session
);
113 void trace_ust_destroy_metadata(struct ltt_ust_metadata
*metadata
);
114 void trace_ust_destroy_channel(struct ltt_ust_channel
*channel
);
115 void trace_ust_destroy_event(struct ltt_ust_event
*event
);
117 #endif /* _LTT_TRACE_UST_H */