projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix: default read timer values
[lttng-tools.git]
/
src
/
bin
/
lttng-sessiond
/
context.c
diff --git
a/src/bin/lttng-sessiond/context.c
b/src/bin/lttng-sessiond/context.c
index cee61f764ce192350583154df8e40d808ef7edac..a83cb46fc9dec796868dbb95157d901cb46cdb70 100644
(file)
--- a/
src/bin/lttng-sessiond/context.c
+++ b/
src/bin/lttng-sessiond/context.c
@@
-39,6
+39,9
@@
static int add_kctx_all_channels(struct ltt_kernel_session *ksession,
int ret;
struct ltt_kernel_channel *kchan;
int ret;
struct ltt_kernel_channel *kchan;
+ assert(ksession);
+ assert(kctx);
+
DBG("Adding kernel context to all channels");
/* Go over all channels */
DBG("Adding kernel context to all channels");
/* Go over all channels */
@@
-64,6
+67,9
@@
static int add_kctx_to_channel(struct lttng_kernel_context *kctx,
{
int ret;
{
int ret;
+ assert(kchan);
+ assert(kctx);
+
DBG("Add kernel context to channel '%s'", kchan->channel->name);
ret = kernel_add_channel_context(kchan, kctx);
DBG("Add kernel context to channel '%s'", kchan->channel->name);
ret = kernel_add_channel_context(kchan, kctx);
@@
-89,6
+95,10
@@
static int add_uctx_to_channel(struct ltt_ust_session *usess, int domain,
struct lttng_ht_iter iter;
struct lttng_ht_node_ulong *uctx_node;
struct lttng_ht_iter iter;
struct lttng_ht_node_ulong *uctx_node;
+ assert(usess);
+ assert(uchan);
+ assert(ctx);
+
/* Create ltt UST context */
uctx = trace_ust_create_context(ctx);
if (uctx == NULL) {
/* Create ltt UST context */
uctx = trace_ust_create_context(ctx);
if (uctx == NULL) {
@@
-142,6
+152,10
@@
int context_kernel_add(struct ltt_kernel_session *ksession,
struct ltt_kernel_channel *kchan;
struct lttng_kernel_context kctx;
struct ltt_kernel_channel *kchan;
struct lttng_kernel_context kctx;
+ assert(ksession);
+ assert(ctx);
+ assert(channel_name);
+
/* Setup kernel context structure */
switch (ctx->ctx) {
case LTTNG_EVENT_CONTEXT_PID:
/* Setup kernel context structure */
switch (ctx->ctx) {
case LTTNG_EVENT_CONTEXT_PID:
@@
-187,7
+201,7
@@
int context_kernel_add(struct ltt_kernel_session *ksession,
LTTNG_SYMBOL_NAME_LEN);
kctx.u.perf_counter.name[LTTNG_SYMBOL_NAME_LEN - 1] = '\0';
LTTNG_SYMBOL_NAME_LEN);
kctx.u.perf_counter.name[LTTNG_SYMBOL_NAME_LEN - 1] = '\0';
- if (
strlen(channel_name) == 0
) {
+ if (
*channel_name == '\0'
) {
ret = add_kctx_all_channels(ksession, &kctx);
if (ret != LTTNG_OK) {
goto error;
ret = add_kctx_all_channels(ksession, &kctx);
if (ret != LTTNG_OK) {
goto error;
@@
-223,6
+237,12
@@
int context_ust_add(struct ltt_ust_session *usess, int domain,
struct lttng_ht *chan_ht;
struct ltt_ust_channel *uchan = NULL;
struct lttng_ht *chan_ht;
struct ltt_ust_channel *uchan = NULL;
+ assert(usess);
+ assert(ctx);
+ assert(channel_name);
+
+ rcu_read_lock();
+
/*
* Define which channel's hashtable to use from the domain or quit if
* unknown domain.
/*
* Define which channel's hashtable to use from the domain or quit if
* unknown domain.
@@
-242,7
+262,7
@@
int context_ust_add(struct ltt_ust_session *usess, int domain,
}
/* Get UST channel if defined */
}
/* Get UST channel if defined */
- if (
strlen(channel_name) != 0
) {
+ if (
channel_name != '\0'
) {
uchan = trace_ust_find_channel_by_name(chan_ht, channel_name);
if (uchan == NULL) {
ret = LTTNG_ERR_UST_CHAN_NOT_FOUND;
uchan = trace_ust_find_channel_by_name(chan_ht, channel_name);
if (uchan == NULL) {
ret = LTTNG_ERR_UST_CHAN_NOT_FOUND;
@@
-285,5
+305,6
@@
int context_ust_add(struct ltt_ust_session *usess, int domain,
}
error:
}
error:
+ rcu_read_unlock();
return ret;
}
return ret;
}
This page took
0.027389 seconds
and
5
git commands to generate.