[sheepdog] [PATCH] local: remove unnecessary debug information

MORITA Kazutaka morita.kazutaka at gmail.com
Wed Aug 14 16:24:43 CEST 2013


At Wed, 14 Aug 2013 16:57:30 +0800,
Liu Yuan wrote:
> 
> Signed-off-by: Liu Yuan <namei.unix at gmail.com>
> ---
>  sheep/cluster/local.c |   10 ++--------
>  1 file changed, 2 insertions(+), 8 deletions(-)
> 
> diff --git a/sheep/cluster/local.c b/sheep/cluster/local.c
> index b4adf87..a8845aa 100644
> --- a/sheep/cluster/local.c
> +++ b/sheep/cluster/local.c
> @@ -182,10 +182,8 @@ static void shm_queue_notify(void)
>  
>  	nr = get_nodes(lnodes);
>  
> -	for (i = 0; i < nr; i++) {
> -		sd_debug("send signal to %s", lnode_to_str(lnodes + i));
> +	for (i = 0; i < nr; i++)
>  		kill(lnodes[i].pid, SIGUSR1);
> -	}
>  }
>  
>  static bool is_shm_queue_valid(void)
> @@ -282,8 +280,6 @@ static int add_event(enum local_event_type type, struct local_node *lnode,
>  	}
>  
>  	sd_debug("type = %d, sender = %s", ev.type, lnode_to_str(&ev.sender));
> -	for (int i = 0; i < ev.nr_lnodes; i++)
> -		sd_debug("%d: %s", i, lnode_to_str(ev.lnodes + i));
>  
>  	shm_queue_push(&ev);
>  
> @@ -394,11 +390,9 @@ static bool local_process_event(void)
>  	sd_debug("callbacked = %d, removed = %d", ev->callbacked, ev->removed);
>  
>  	nr_nodes = 0;
> -	for (i = 0; i < ev->nr_lnodes; i++) {
> -		sd_debug("%d: %s", i, lnode_to_str(ev->lnodes + i));
> +	for (i = 0; i < ev->nr_lnodes; i++)
>  		if (!ev->lnodes[i].gateway)
>  			nodes[nr_nodes++] = ev->lnodes[i].node;
> -	}
>  
>  	if (ev->removed)
>  		goto out;

I think we don't need to remove them.

I'm pretty sure that those sd_debug() helped me to debug the local
driver.  With the local driver, the sheep node list is embedded into
each local_event and we have to keep it consistent in the event queue.
Those sd_debug() are helpful to check it.

Thanks,

Kazutaka



More information about the sheepdog mailing list