2 * Copyright (C) 2011 - David Goulet <david.goulet@polymtl.ca>
3 * Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License, version 2 only,
7 * as published by the Free Software Foundation.
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 along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23 #include <common/error.h>
27 #include "lttng-sessiond.h"
29 int ht_cleanup_pipe
[2] = { -1, -1 };
32 * Write to writable pipe used to notify a thread.
34 int notify_thread_pipe(int wpipe
)
38 /* Ignore if the pipe is invalid. */
43 ret
= lttng_write(wpipe
, "!", 1);
45 PERROR("write poll pipe");
51 void ht_cleanup_push(struct lttng_ht
*ht
)
54 int fd
= ht_cleanup_pipe
[1];
61 ret
= lttng_write(fd
, &ht
, sizeof(ht
));
62 if (ret
< sizeof(ht
)) {
63 PERROR("write ht cleanup pipe %d", fd
);
70 /* All good. Don't send back the write positive ret value. */
76 int loglevels_match(int a_loglevel_type
, int a_loglevel_value
,
77 int b_loglevel_type
, int b_loglevel_value
, int loglevel_all_type
)
81 if (a_loglevel_type
== b_loglevel_type
) {
82 /* Same loglevel type. */
83 if (b_loglevel_type
!= loglevel_all_type
) {
85 * Loglevel value must also match since the loglevel
88 if (a_loglevel_value
!= b_loglevel_value
) {
93 /* Loglevel type is different: no match. */
100 const char *session_get_base_path(const struct ltt_session
*session
)
102 return consumer_output_get_base_path(session
->consumer
);
105 const char *consumer_output_get_base_path(const struct consumer_output
*output
)
107 return output
->type
== CONSUMER_DST_LOCAL
?
108 output
->dst
.session_root_path
:
109 output
->dst
.net
.base_dir
;
This page took 0.039583 seconds and 5 git commands to generate.