Cleanup comments and bad indent
[lttng-tools.git] / ltt-sessiond / trace.h
... / ...
CommitLineData
1/*
2 * Copyright (C) 2011 - David Goulet <david.goulet@polymtl.ca>
3 *
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
7 * of the License.
8 *
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.
13 *
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.
17 */
18
19#ifndef _LTT_TRACE_H
20#define _LTT_TRACE_H
21
22#include <limits.h>
23#include <urcu/list.h>
24
25#include <lttng/lttng.h>
26
27#include "lttng-kernel.h"
28
29/* Kernel event list */
30struct ltt_kernel_event_list {
31 struct cds_list_head head;
32};
33
34/* Channel stream list */
35struct ltt_kernel_stream_list {
36 struct cds_list_head head;
37};
38
39/* Channel list */
40struct ltt_kernel_channel_list {
41 struct cds_list_head head;
42};
43
44/* Kernel event */
45struct ltt_kernel_event {
46 int fd;
47 int enabled;
48 struct lttng_kernel_context *ctx;
49 struct lttng_kernel_event *event;
50 struct cds_list_head list;
51};
52
53/* Kernel channel */
54struct ltt_kernel_channel {
55 int fd;
56 int enabled;
57 char *pathname;
58 unsigned int stream_count;
59 unsigned int event_count;
60 struct lttng_kernel_context *ctx;
61 struct lttng_channel *channel;
62 struct ltt_kernel_event_list events_list;
63 struct ltt_kernel_stream_list stream_list;
64 struct cds_list_head list;
65};
66
67/* Metadata */
68struct ltt_kernel_metadata {
69 int fd;
70 char *pathname;
71 struct lttng_channel *conf;
72};
73
74/* Channel stream */
75struct ltt_kernel_stream {
76 int fd;
77 char *pathname;
78 int state;
79 struct cds_list_head list;
80};
81
82/* Kernel session */
83struct ltt_kernel_session {
84 int fd;
85 int metadata_stream_fd;
86 int kconsumer_fds_sent;
87 int consumer_fd;
88 unsigned int channel_count;
89 unsigned int stream_count_global;
90 char *trace_path;
91 struct ltt_kernel_metadata *metadata;
92 struct ltt_kernel_channel_list channel_list;
93};
94
95/* UST trace representation */
96struct ltt_ust_trace {
97 struct cds_list_head list;
98 char name[NAME_MAX];
99 int shmid;
100 pid_t pid;
101 struct cds_list_head markers;
102};
103
104struct ltt_ust_marker {
105 struct cds_list_head list;
106 char *name;
107 char *channel;
108};
109
110struct ltt_kernel_event *get_kernel_event_by_name(
111 char *name, struct ltt_kernel_channel *channel);
112struct ltt_kernel_channel *get_kernel_channel_by_name(
113 char *name, struct ltt_kernel_session *session);
114
115/*
116 * Create functions malloc() the data structure.
117 */
118struct ltt_kernel_session *trace_create_kernel_session(void);
119struct ltt_kernel_channel *trace_create_kernel_channel(struct lttng_channel *chan, char *path);
120struct ltt_kernel_event *trace_create_kernel_event(struct lttng_event *ev);
121struct ltt_kernel_metadata *trace_create_kernel_metadata(char *path);
122struct ltt_kernel_stream *trace_create_kernel_stream(void);
123
124/*
125 * Destroy functions free() the data structure and remove from linked list if
126 * it's applies.
127 */
128void trace_destroy_kernel_session(struct ltt_kernel_session *session);
129void trace_destroy_kernel_metadata(struct ltt_kernel_metadata *metadata);
130void trace_destroy_kernel_channel(struct ltt_kernel_channel *channel);
131void trace_destroy_kernel_event(struct ltt_kernel_event *event);
132void trace_destroy_kernel_stream(struct ltt_kernel_stream *stream);
133
134#endif /* _LTT_TRACE_H */
This page took 0.02269 seconds and 4 git commands to generate.