| 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_SESSIOND_H |
| 20 | #define _LTT_SESSIOND_H |
| 21 | |
| 22 | #define _LGPL_SOURCE |
| 23 | #include <urcu.h> |
| 24 | #include <urcu/wfqueue.h> |
| 25 | |
| 26 | #include "ust-app.h" |
| 27 | |
| 28 | #define DEFAULT_HOME_DIR "/tmp" |
| 29 | #define DEFAULT_UST_SOCK_DIR DEFAULT_HOME_DIR "/ust-app-socks" |
| 30 | #define DEFAULT_GLOBAL_APPS_PIPE DEFAULT_UST_SOCK_DIR "/global" |
| 31 | #define DEFAULT_TRACE_OUTPUT DEFAULT_HOME_DIR "/lttng" |
| 32 | |
| 33 | #define DEFAULT_GLOBAL_APPS_WAIT_SHM_PATH "/lttng-ust-apps-wait" |
| 34 | #define DEFAULT_HOME_APPS_WAIT_SHM_PATH "/lttng-ust-apps-wait-%u" |
| 35 | |
| 36 | struct module_param { |
| 37 | const char *name; |
| 38 | int required; |
| 39 | }; |
| 40 | |
| 41 | /* LTTng kernel tracer modules list */ |
| 42 | const struct module_param kernel_modules_list[] = { |
| 43 | { "lttng-ftrace", 0 }, |
| 44 | { "lttng-kprobes", 0 }, |
| 45 | { "lttng-kretprobes", 0 }, |
| 46 | { "lib-ring-buffer", 1 }, |
| 47 | { "ltt-relay", 1 }, |
| 48 | { "ltt-ring-buffer-client-discard", 1 }, |
| 49 | { "ltt-ring-buffer-client-overwrite", 1 }, |
| 50 | { "ltt-ring-buffer-metadata-client", 1 }, |
| 51 | { "ltt-ring-buffer-client-mmap-discard", 1 }, |
| 52 | { "ltt-ring-buffer-client-mmap-overwrite", 1 }, |
| 53 | { "ltt-ring-buffer-metadata-mmap-client", 1 }, |
| 54 | { "lttng-probe-lttng", 1 }, |
| 55 | { "lttng-types", 0 }, |
| 56 | { "lttng-probe-block", 0 }, |
| 57 | { "lttng-probe-irq", 0 }, |
| 58 | { "lttng-probe-kvm", 0 }, |
| 59 | { "lttng-probe-sched", 0 }, |
| 60 | }; |
| 61 | |
| 62 | extern const char default_home_dir[], |
| 63 | default_tracing_group[], |
| 64 | default_ust_sock_dir[], |
| 65 | default_global_apps_pipe[]; |
| 66 | |
| 67 | /* |
| 68 | * This contains extra data needed for processing a command received by the |
| 69 | * session daemon from the lttng client. |
| 70 | */ |
| 71 | struct command_ctx { |
| 72 | int ust_sock; |
| 73 | unsigned int lttng_msg_size; |
| 74 | struct ltt_session *session; |
| 75 | struct lttcomm_lttng_msg *llm; |
| 76 | struct lttcomm_session_msg *lsm; |
| 77 | }; |
| 78 | |
| 79 | struct ust_command { |
| 80 | int sock; |
| 81 | struct ust_register_msg reg_msg; |
| 82 | struct cds_wfq_node node; |
| 83 | }; |
| 84 | |
| 85 | /* |
| 86 | * Queue used to enqueue UST registration request (ust_commant) and protected |
| 87 | * by a futex with a scheme N wakers / 1 waiters. See futex.c/.h |
| 88 | */ |
| 89 | struct ust_cmd_queue { |
| 90 | int32_t futex; |
| 91 | struct cds_wfq_queue queue; |
| 92 | }; |
| 93 | |
| 94 | #endif /* _LTT_SESSIOND_H */ |