ltt_unlock_traces();
if(trace == NULL) {
- ERR("cannot find trace!");
- retval = -1;
+ char *reply;
+ int result;
+
+ WARN("Cannot find trace. It was likely destroyed by the user.");
+ asprintf(&reply, "%s", "NOTFOUND");
+ result = ustcomm_send_reply(&ustcomm_app.server, reply, src);
+ if(result) {
+ ERR("ustcomm_send_reply failed");
+ free(reply);
+ retval = -1;
+ goto free_short_chan_name;
+ }
+
+ free(reply);
goto free_short_chan_name;
}
long consumed_old;
char *consumed_old_str;
char *endptr;
+ char *reply = NULL;
DBG("put_subbuf");
ltt_unlock_traces();
if(trace == NULL) {
- ERR("cannot find trace!");
- retval = -1;
+ WARN("Cannot find trace. It was likely destroyed by the user.");
+ asprintf(&reply, "%s", "NOTFOUND");
+ result = ustcomm_send_reply(&ustcomm_app.server, reply, src);
+ if(result) {
+ ERR("ustcomm_send_reply failed");
+ free(reply);
+ retval = -1;
+ goto free_short_chan_name;
+ }
+
+ free(reply);
goto free_short_chan_name;
}
if(!strcmp(trace->channels[i].channel_name, ch_name)) {
struct ust_buffer *buf = channel->buf[ch_cpu];
- char *reply;
- long consumed_old=0;
found = 1;
}
}
if(found == 0) {
- ERR("get_subbuf_size: unable to find channel");
+ ERR("unable to find channel");
}
- free_channel_and_cpu:
- free(channel_and_cpu);
- free_consumed_old_str:
- free(consumed_old_str);
free_short_chan_name:
free(ch_name);
+ free_consumed_old_str:
+ free(consumed_old_str);
+ free_channel_and_cpu:
+ free(channel_and_cpu);
end:
return retval;
/* Ensure markers are initialized */
init_markers();
+ /* Ensure buffers are initialized, for the transport to be available.
+ * We are about to set a trace type and it will fail without this.
+ */
+ init_ustrelay_transport();
+
/* FIXME: When starting early tracing (here), depending on the
* order of constructors, it is very well possible some marker
* sections are not yet registered. Because of this, some