X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;ds=sidebyside;f=libtracing%2Fchannels.c;h=fc0db8ea270bb0c7daa80413e84bd4a0f997619e;hb=5f54827b88b093974e4bf58f67490036718644c7;hp=1a23afef473c352e6ea61271c929fad7e599584a;hpb=b6bf28ecd4c07e7865d340f1600a35d6edc05ec8;p=lttng-ust.git diff --git a/libtracing/channels.c b/libtracing/channels.c index 1a23afef..fc0db8ea 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;