X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=libust%2Ftracectl.c;h=830e777bb5114391e7525ca6713b138219125f38;hb=1d7304a3f27fd639b513415c27b759e133e3d484;hp=b058cb3ce19d0d317790ddbf03103164508d1eb4;hpb=e625e9191bcb16522072aa34301cc517392f85ba;p=ust.git diff --git a/libust/tracectl.c b/libust/tracectl.c index b058cb3..830e777 100644 --- a/libust/tracectl.c +++ b/libust/tracectl.c @@ -957,7 +957,7 @@ static void process_client_cmd(struct ustcomm_header *recv_header, print_markers(fp); fclose(fp); - reply_header->size = size; + reply_header->size = size + 1; /* Include final \0 */ result = ustcomm_send(sock, reply_header, ptr); @@ -983,7 +983,7 @@ static void process_client_cmd(struct ustcomm_header *recv_header, print_trace_events(fp); fclose(fp); - reply_header->size = size; + reply_header->size = size + 1; /* Include final \0 */ result = ustcomm_send(sock, reply_header, ptr); @@ -1697,6 +1697,7 @@ void ust_before_fork(ust_fork_info_t *fork_info) * Hold listen_sock_mutex to protect from listen_sock teardown. */ pthread_mutex_lock(&listen_sock_mutex); + rcu_bp_before_fork(); } /* Don't call this function directly in a traced program */ @@ -1717,24 +1718,20 @@ static void ust_after_fork_common(ust_fork_info_t *fork_info) void ust_after_fork_parent(ust_fork_info_t *fork_info) { + rcu_bp_after_fork_parent(); /* Release mutexes and reenable signals */ ust_after_fork_common(fork_info); } void ust_after_fork_child(ust_fork_info_t *fork_info) { - /* First sanitize the child */ + /* Release urcu mutexes */ + rcu_bp_after_fork_child(); + + /* Sanitize the child */ ust_fork(); /* Then release mutexes and reenable signals */ ust_after_fork_common(fork_info); - - /* - * Make sure we clean up the urcu-bp thread list in the child by running - * the garbage collection before any pthread_create can be called. - * Failure to do so could lead to a deadlock caused by reuse of a thread - * ID before urcu-bp garbage collection is performed. - */ - synchronize_rcu(); }