Changes since v1:
Add a nesting comment
Make the locking around the transport list more intelligent, give
it its own mutex.
Signed-off-by: Nils Carlson <nils.carlson@ericsson.com>
//ust// }
static CDS_LIST_HEAD(ltt_transport_list);
//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
/**
* ltt_transport_register - LTT transport registration
* @transport: transport structure
*/
//ust// vmalloc_sync_all();
*/
//ust// vmalloc_sync_all();
+ pthread_mutex_lock(<t_transport_mutex);
cds_list_add_tail(&transport->node, <t_transport_list);
cds_list_add_tail(&transport->node, <t_transport_list);
+ pthread_mutex_unlock(<t_transport_mutex);
*/
void ltt_transport_unregister(struct ltt_transport *transport)
{
*/
void ltt_transport_unregister(struct ltt_transport *transport)
{
+ pthread_mutex_lock(<t_transport_mutex);
cds_list_del(&transport->node);
cds_list_del(&transport->node);
+ pthread_mutex_unlock(<t_transport_mutex);
}
static inline int is_channel_overwrite(enum ltt_channels chan,
}
static inline int is_channel_overwrite(enum ltt_channels chan,
+ 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;
}
}
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;
if (!transport) {
ERR("Transport %s is not present", trace_type);
err = -EINVAL;