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>
24 #include "lttng-kernel.h"
26 /* Default kernel channel attributes */
27 #define DEFAULT_KERNEL_OVERWRITE 0
28 #define DEFAULT_KERNEL_SUBBUF_SIZE 4096 /* bytes */
29 #define DEFAULT_KERNEL_SUBBUF_NUM 8 /* Must always be a power of 2 */
30 #define DEFAULT_KERNEL_SWITCH_TIMER 0 /* usec */
31 #define DEFAULT_KERNEL_READ_TIMER 200 /* usec */
33 /* Kernel event list */
34 struct ltt_kernel_event_list
{
35 struct cds_list_head head
;
38 /* Channel stream list */
39 struct ltt_kernel_stream_list
{
40 struct cds_list_head head
;
44 struct ltt_kernel_channel_list
{
45 struct cds_list_head head
;
49 struct ltt_kernel_event
{
51 struct lttng_kernel_event
*event
;
52 struct cds_list_head list
;
56 struct ltt_kernel_channel
{
59 unsigned int stream_count
;
60 struct lttng_kernel_channel
*channel
;
61 struct ltt_kernel_event_list events_list
;
62 struct ltt_kernel_stream_list stream_list
;
63 struct cds_list_head list
;
67 struct ltt_kernel_metadata
{
70 struct lttng_kernel_channel
*conf
;
74 struct ltt_kernel_stream
{
78 struct cds_list_head list
;
82 struct ltt_kernel_session
{
84 int metadata_stream_fd
;
85 unsigned int channel_count
;
86 unsigned int stream_count_global
;
87 struct ltt_kernel_metadata
*metadata
;
88 struct ltt_kernel_channel_list channel_list
;
91 /* UST trace representation */
92 struct ltt_ust_trace
{
93 struct cds_list_head list
;
97 struct cds_list_head markers
;
100 struct ltt_ust_marker
{
101 struct cds_list_head list
;
111 struct ltt_kernel_session
*trace_create_kernel_session(void);
114 struct ltt_kernel_channel
*trace_create_kernel_channel(void);
117 struct ltt_kernel_event
*trace_create_kernel_event(char *name
,
118 enum lttng_kernel_instrumentation type
);
120 /* Kernel metadata */
121 struct ltt_kernel_metadata
*trace_create_kernel_metadata(void);
124 struct ltt_kernel_stream
*trace_create_kernel_stream(void);
126 #endif /* _LTT_TRACE_H */