| 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 <limits.h> |
| 23 | #include <urcu/list.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 | #endif /* _LTT_TRACE_H */ |