2 * Copyright (C) 2011 David Goulet <david.goulet@polymtl.ca>
3 * Copyright (C) 2011 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
5 * SPDX-License-Identifier: GPL-2.0-only
13 #include <common/error.h>
17 #include "lttng-sessiond.h"
19 int the_ht_cleanup_pipe
[2] = {-1, -1};
22 * Write to writable pipe used to notify a thread.
24 int notify_thread_pipe(int wpipe
)
28 /* Ignore if the pipe is invalid. */
33 ret
= lttng_write(wpipe
, "!", 1);
35 PERROR("write poll pipe");
41 void ht_cleanup_push(struct lttng_ht
*ht
)
44 int fd
= the_ht_cleanup_pipe
[1];
51 ret
= lttng_write(fd
, &ht
, sizeof(ht
));
52 if (ret
< sizeof(ht
)) {
53 PERROR("write ht cleanup pipe %d", fd
);
60 /* All good. Don't send back the write positive ret value. */
66 int loglevels_match(int a_loglevel_type
, int a_loglevel_value
,
67 int b_loglevel_type
, int b_loglevel_value
, int loglevel_all_type
)
71 if (a_loglevel_type
== b_loglevel_type
) {
72 /* Same loglevel type. */
73 if (b_loglevel_type
!= loglevel_all_type
) {
75 * Loglevel value must also match since the loglevel
78 if (a_loglevel_value
!= b_loglevel_value
) {
83 /* Loglevel type is different: no match. */
90 const char *session_get_base_path(const struct ltt_session
*session
)
92 return consumer_output_get_base_path(session
->consumer
);
95 const char *consumer_output_get_base_path(const struct consumer_output
*output
)
97 return output
->type
== CONSUMER_DST_LOCAL
?
98 output
->dst
.session_root_path
:
99 output
->dst
.net
.base_dir
;
This page took 0.031618 seconds and 4 git commands to generate.