[ovs-dev] [PATCH] ovs-rcu: Log the name of the main thread as "main" instead of "".

Alex Wang alexw at nicira.com
Tue Apr 29 21:49:15 UTC 2014


Acked-by: Alex Wang <alexw at nicira.com>


On Tue, Apr 29, 2014 at 2:44 PM, Ben Pfaff <blp at nicira.com> wrote:

> The main thread has the empty string as its name, but that's not a good
> log string.
>
> Without this patch we can get log message like
>     blocked 1000 ms waiting for  to quiesce
> from ovsrcu_synchronize().
>
> Signed-off-by: Ben Pfaff <blp at nicira.com>
> ---
>  lib/ovs-rcu.c |    4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/lib/ovs-rcu.c b/lib/ovs-rcu.c
> index 8a12564..7aed6db 100644
> --- a/lib/ovs-rcu.c
> +++ b/lib/ovs-rcu.c
> @@ -71,11 +71,13 @@ ovsrcu_perthread_get(void)
>
>      perthread = pthread_getspecific(perthread_key);
>      if (!perthread) {
> +        const char *name = get_subprogram_name();
> +
>          perthread = xmalloc(sizeof *perthread);
>          ovs_mutex_init(&perthread->mutex);
>          perthread->seqno = seq_read(global_seqno);
>          perthread->cbset = NULL;
> -        ovs_strlcpy(perthread->name, get_subprogram_name(),
> +        ovs_strlcpy(perthread->name, name[0] ? name : "main",
>                      sizeof perthread->name);
>
>          ovs_mutex_lock(&ovsrcu_threads_mutex);
> --
> 1.7.10.4
>
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openvswitch.org/pipermail/ovs-dev/attachments/20140429/b5365d08/attachment-0005.html>


More information about the dev mailing list