2f80143fe8042ec8d22b5c97b1c80a325e10dc92
[lttng-tools.git] / ltt-sessiond / trace.h
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; either version 2
7 * of the License, or (at your option) any later version.
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 "ltt-sessiond.h"
23 #include "session.h"
24 #include "lttng-kernel.h"
25
26 /* Kernel event list */
27 struct ltt_kernel_event_list {
28 struct cds_list_head head;
29 };
30
31 /* Channel stream list */
32 struct ltt_kernel_stream_list {
33 struct cds_list_head head;
34 };
35
36 /* Channel list */
37 struct ltt_kernel_channel_list {
38 struct cds_list_head head;
39 };
40
41 /* Kernel event */
42 struct ltt_kernel_event {
43 int fd;
44 struct lttng_kernel_event *event;
45 struct cds_list_head list;
46 };
47
48 /* Kernel channel */
49 struct ltt_kernel_channel {
50 int fd;
51 char *pathname;
52 unsigned int stream_count;
53 struct lttng_kernel_channel *channel;
54 struct ltt_kernel_event_list events_list;
55 struct ltt_kernel_stream_list stream_list;
56 struct cds_list_head list;
57 };
58
59 /* Metadata */
60 struct ltt_kernel_metadata {
61 int fd;
62 char *pathname;
63 struct lttng_kernel_channel *conf;
64 };
65
66 /* Channel stream */
67 struct ltt_kernel_stream {
68 int fd;
69 char *pathname;
70 int state;
71 struct cds_list_head list;
72 };
73
74 /* Kernel session */
75 struct ltt_kernel_session {
76 int fd;
77 int metadata_stream_fd;
78 unsigned int channel_count;
79 unsigned int stream_count_global;
80 struct ltt_kernel_metadata *metadata;
81 struct ltt_kernel_channel_list channel_list;
82 };
83
84 /* UST trace representation */
85 struct ltt_ust_trace {
86 struct cds_list_head list;
87 char name[NAME_MAX];
88 int shmid;
89 pid_t pid;
90 struct cds_list_head markers;
91 };
92
93 struct ltt_ust_marker {
94 struct cds_list_head list;
95 char *name;
96 char *channel;
97 };
98
99 int get_trace_count_per_session(struct ltt_session *session);
100 void get_traces_per_session(struct ltt_session *session, struct lttng_trace *traces);
101 int ust_create_trace(struct command_ctx *cmd_ctx);
102 int ust_start_trace(struct command_ctx *cmd_ctx);
103 int ust_stop_trace(struct command_ctx *cmd_ctx);
104
105 #endif /* _LTT_TRACE_H */
This page took 0.030589 seconds and 3 git commands to generate.