DBG("trace destroy");
- result = ltt_trace_destroy(trace_name);
+ result = ltt_trace_destroy(trace_name, 0);
if(result < 0) {
ERR("ltt_trace_destroy failed");
return (void *)1;
ERR("ltt_trace_stop error");
}
- result = ltt_trace_destroy("auto");
+ result = ltt_trace_destroy("auto", 0);
if(result == -1) {
ERR("ltt_trace_destroy error");
}
struct blocked_consumer *deletable_bc = NULL;
int result;
+ /* FIXME: technically, the locks could have been taken before the fork */
DBG("ust: forking");
ltt_trace_stop("auto");
- ltt_trace_destroy("auto");
+ ltt_trace_destroy("auto", 1);
/* Delete all active connections */
ustcomm_close_all_connections(&ustcomm_app.server);
}
/* Sleepable part of the destroy */
-static void __ltt_trace_destroy(struct ust_trace *trace)
+static void __ltt_trace_destroy(struct ust_trace *trace, int drop)
{
int i;
struct ust_channel *chan;
- for (i = 0; i < trace->nr_channels; i++) {
- chan = &trace->channels[i];
- if (chan->active)
- trace->ops->finish_channel(chan);
+ if(!drop) {
+ for (i = 0; i < trace->nr_channels; i++) {
+ chan = &trace->channels[i];
+ if (chan->active)
+ trace->ops->finish_channel(chan);
+ }
}
return; /* FIXME: temporary for ust */
kref_put(&trace->kref, ltt_release_trace);
}
-int ltt_trace_destroy(const char *trace_name)
+int ltt_trace_destroy(const char *trace_name, int drop)
{
int err = 0;
struct ust_trace *trace;
ltt_unlock_traces();
- __ltt_trace_destroy(trace);
+ __ltt_trace_destroy(trace, drop);
//ust// put_trace_clock();
return 0;
extern int ltt_trace_set_channel_overwrite(const char *trace_name,
const char *channel_name, unsigned int overwrite);
extern int ltt_trace_alloc(const char *trace_name);
-extern int ltt_trace_destroy(const char *trace_name);
+extern int ltt_trace_destroy(const char *trace_name, int drop);
extern int ltt_trace_start(const char *trace_name);
extern int ltt_trace_stop(const char *trace_name);
scanf("%*s");
ltt_trace_stop("auto");
- ltt_trace_destroy("auto");
+ ltt_trace_destroy("auto", 0);
DBG("TRACE STOPPED");
scanf("%*s");