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;
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;
DBG("subbuffer put %s", buf->name);
retval = PUT_SUBBUF_OK;
}
+ else if(!strcmp(received_msg, "NOTFOUND")) {
+ WARN("For buffer %s, the trace was not found. This likely means it was destroyed by the user.", buf->name);
+ /* However, maybe this was not the last subbuffer. So
+ * we return the program died.
+ */
+ retval = PUT_SUBBUF_DIED;
+ goto end_rep;
+ }
else {
DBG("put_subbuffer: received error, we were pushed");
retval = PUT_SUBBUF_PUSHED;