//ust// }
static CDS_LIST_HEAD(ltt_transport_list);
-
+/* transport mutex, nests inside traces mutex (ltt_lock_traces) */
+static DEFINE_MUTEX(ltt_transport_mutex);
/**
* ltt_transport_register - LTT transport registration
* @transport: transport structure
*/
//ust// vmalloc_sync_all();
- ltt_lock_traces();
+ pthread_mutex_lock(<t_transport_mutex);
cds_list_add_tail(&transport->node, <t_transport_list);
- ltt_unlock_traces();
+ pthread_mutex_unlock(<t_transport_mutex);
}
/**
*/
void ltt_transport_unregister(struct ltt_transport *transport)
{
- ltt_lock_traces();
+ pthread_mutex_lock(<t_transport_mutex);
cds_list_del(&transport->node);
- ltt_unlock_traces();
+ pthread_mutex_unlock(<t_transport_mutex);
}
static inline int is_channel_overwrite(enum ltt_channels chan,
goto traces_error;
}
+ pthread_mutex_lock(<t_transport_mutex);
cds_list_for_each_entry(tran_iter, <t_transport_list, node) {
if (!strcmp(tran_iter->name, trace_type)) {
transport = tran_iter;
break;
}
}
+ pthread_mutex_unlock(<t_transport_mutex);
+
if (!transport) {
ERR("Transport %s is not present", trace_type);
err = -EINVAL;
}
}
- return; /* FIXME: temporary for ust */
-//ust// flush_scheduled_work();
-
/*
* The currently destroyed trace is not in the trace list anymore,
* so it's safe to call the async wakeup ourself. It will deliver
ltt_unlock_traces();
/*
- * Call the kernel state dump.
- * Events will be mixed with real kernel events, it's ok.
+ * Call the process-wide state dump.
* Notice that there is no protection on the trace : that's exactly
* why we iterate on the list and check for trace equality instead of
- * directly using this trace handle inside the logging function.
+ * directly using this trace handle inside the logging function: we want
+ * to record events only in a single trace in the trace session list.
*/
ltt_dump_marker_state(trace);