X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=libtracing%2Fchannels.c;h=a8df3c48ad916a03661d786e6860491dec68aca0;hb=b02e31e53039229b50d2f54ee31d68709aba1412;hp=1a23afef473c352e6ea61271c929fad7e599584a;hpb=b6bf28ecd4c07e7865d340f1600a35d6edc05ec8;p=ust.git diff --git a/libtracing/channels.c b/libtracing/channels.c index 1a23afe..a8df3c4 100644 --- a/libtracing/channels.c +++ b/libtracing/channels.c @@ -16,6 +16,7 @@ #include "kernelcompat.h" #include "channels.h" +#include "usterr.h" /* * ltt_channel_mutex may be nested inside the LTT trace mutex. @@ -239,8 +240,10 @@ struct ltt_channel_struct *ltt_channels_trace_alloc(unsigned int *nr_channels, struct ltt_channel_setting *iter; mutex_lock(<t_channel_mutex); - if (!free_index) + if (!free_index) { + WARN("ltt_channels_trace_alloc: no free_index; are there any probes connected?"); goto end; + } if (!atomic_read(&index_kref.refcount)) kref_init(&index_kref); else @@ -248,8 +251,10 @@ struct ltt_channel_struct *ltt_channels_trace_alloc(unsigned int *nr_channels, *nr_channels = free_index; channel = kzalloc(sizeof(struct ltt_channel_struct) * free_index, GFP_KERNEL); - if (!channel) + if (!channel) { + WARN("ltt_channel_struct: channel null after alloc"); goto end; + } list_for_each_entry(iter, <t_channels, list) { if (!atomic_read(&iter->kref.refcount)) continue; @@ -306,6 +311,8 @@ int _ltt_channels_get_event_id(const char *channel, const char *name) ret = 0; else if (strcmp(name, "core_marker_format") == 0) ret = 1; + else if (strcmp(name, "testev") == 0) + ret = 2; else ret = -ENOENT; goto end;