projects
/
deliverable
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
common: index: remove redundant separator for empty channel string
[deliverable/lttng-tools.git]
/
src
/
bin
/
lttng-sessiond
/
kernel-consumer.c
diff --git
a/src/bin/lttng-sessiond/kernel-consumer.c
b/src/bin/lttng-sessiond/kernel-consumer.c
index 2d0605e9bc1b308a13886cf9f38b9af64b118920..273b04f9da85145de523c248cb09da1798e691ca 100644
(file)
--- a/
src/bin/lttng-sessiond/kernel-consumer.c
+++ b/
src/bin/lttng-sessiond/kernel-consumer.c
@@
-33,7
+33,8
@@
#include "session.h"
#include "lttng-sessiond.h"
#include "session.h"
#include "lttng-sessiond.h"
-static char *create_channel_path(struct consumer_output *consumer)
+static char *create_channel_path(struct consumer_output *consumer,
+ size_t *consumer_path_offset)
{
int ret;
char tmp_path[PATH_MAX];
{
int ret;
char tmp_path[PATH_MAX];
@@
-52,10
+53,11
@@
static char *create_channel_path(struct consumer_output *consumer)
consumer->domain_subdir);
goto error;
}
consumer->domain_subdir);
goto error;
}
+ *consumer_path_offset = strlen(consumer->domain_subdir);
DBG3("Kernel local consumer trace path relative to current trace chunk: \"%s\"",
pathname);
} else {
DBG3("Kernel local consumer trace path relative to current trace chunk: \"%s\"",
pathname);
} else {
- /* Network output. */
+ /* Network output
, relayd < 2.11
. */
ret = snprintf(tmp_path, sizeof(tmp_path), "%s%s",
consumer->dst.net.base_dir,
consumer->domain_subdir);
ret = snprintf(tmp_path, sizeof(tmp_path), "%s%s",
consumer->dst.net.base_dir,
consumer->domain_subdir);
@@
-74,6
+76,7
@@
static char *create_channel_path(struct consumer_output *consumer)
PERROR("lttng_strndup");
goto error;
}
PERROR("lttng_strndup");
goto error;
}
+ *consumer_path_offset = 0;
DBG3("Kernel network consumer subdir path: %s", pathname);
}
DBG3("Kernel network consumer subdir path: %s", pathname);
}
@@
-101,6
+104,7
@@
int kernel_consumer_add_channel(struct consumer_socket *sock,
struct ltt_session *session = NULL;
struct lttng_channel_extended *channel_attr_extended;
bool is_local_trace;
struct ltt_session *session = NULL;
struct lttng_channel_extended *channel_attr_extended;
bool is_local_trace;
+ size_t consumer_path_offset = 0;
/* Safety net */
assert(channel);
/* Safety net */
assert(channel);
@@
-115,7
+119,7
@@
int kernel_consumer_add_channel(struct consumer_socket *sock,
channel->channel->name);
is_local_trace = consumer->net_seq_index == -1ULL;
channel->channel->name);
is_local_trace = consumer->net_seq_index == -1ULL;
- pathname = create_channel_path(consumer);
+ pathname = create_channel_path(consumer
, &consumer_path_offset
);
if (!pathname) {
ret = -1;
goto error;
if (!pathname) {
ret = -1;
goto error;
@@
-150,7
+154,7
@@
int kernel_consumer_add_channel(struct consumer_socket *sock,
consumer_init_add_channel_comm_msg(&lkm,
channel->key,
ksession->id,
consumer_init_add_channel_comm_msg(&lkm,
channel->key,
ksession->id,
-
pathname
,
+
&pathname[consumer_path_offset]
,
ksession->uid,
ksession->gid,
consumer->net_seq_index,
ksession->uid,
ksession->gid,
consumer->net_seq_index,
@@
-230,7
+234,7
@@
int kernel_consumer_add_metadata(struct consumer_socket *sock,
consumer_init_add_channel_comm_msg(&lkm,
ksession->metadata->key,
ksession->id,
consumer_init_add_channel_comm_msg(&lkm,
ksession->metadata->key,
ksession->id,
-
DEFAULT_KERNEL_TRACE_DIR
,
+
""
,
ksession->uid,
ksession->gid,
consumer->net_seq_index,
ksession->uid,
ksession->gid,
consumer->net_seq_index,
This page took
0.025634 seconds
and
5
git commands to generate.