From patchwork Tue Jul 15 15:09:31 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Dickson X-Patchwork-Id: 4554721 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 9FF1CC0514 for ; Tue, 15 Jul 2014 15:10:03 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CF7FC20170 for ; Tue, 15 Jul 2014 15:10:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DD6202015E for ; Tue, 15 Jul 2014 15:10:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754359AbaGOPJy (ORCPT ); Tue, 15 Jul 2014 11:09:54 -0400 Received: from mx1.redhat.com ([209.132.183.28]:29532 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754008AbaGOPJu (ORCPT ); Tue, 15 Jul 2014 11:09:50 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s6FF9hs0006333 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 15 Jul 2014 11:09:43 -0400 Received: from smallhat.boston.devel.redhat.com (smallhat.boston.devel.redhat.com [10.19.60.65]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s6FF9ahY009793; Tue, 15 Jul 2014 11:09:43 -0400 From: Steve Dickson To: Libtirpc-devel Mailing List Cc: Linux NFS Mailing list Subject: [PATCH 12/15] clnt_bcast: Convert local debug() calls to LIBTIRPC_DEBUG() calls Date: Tue, 15 Jul 2014 11:09:31 -0400 Message-Id: <1405436974-4161-13-git-send-email-steved@redhat.com> In-Reply-To: <1405436974-4161-1-git-send-email-steved@redhat.com> References: <1405436974-4161-1-git-send-email-steved@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Steve Dickson --- src/clnt_bcast.c | 36 +++++++++++------------------------- 1 file changed, 11 insertions(+), 25 deletions(-) diff --git a/src/clnt_bcast.c b/src/clnt_bcast.c index 1055545..373d8a5 100644 --- a/src/clnt_bcast.c +++ b/src/clnt_bcast.c @@ -55,9 +55,7 @@ #endif /* PORTMAP */ #include #include -#ifdef RPC_DEBUG #include -#endif #include #include #include @@ -66,6 +64,7 @@ #include #include "rpc_com.h" +#include "debug.h" #define MAXBCAST 20 /* Max no of broadcasting transports */ #define INITTIME 4000 /* Time to wait initially */ @@ -454,20 +453,15 @@ rpc_broadcast_exp(prog, vers, proc, xargs, argsp, xresults, resultsp, outlen, 0, (struct sockaddr*)addr, (size_t)fdlist[i].asize) != outlen) { -#ifdef RPC_DEBUG - perror("sendto"); -#endif - warnx("clnt_bcast: cannot send" - "broadcast packet"); + LIBTIRPC_DEBUG(1, + ("rpc_broadcast_exp: sendto failed: errno %d", errno)); + warnx("rpc_broadcast_exp: cannot send broadcast packet"); stat = RPC_CANTSEND; continue; }; -#ifdef RPC_DEBUG if (!__rpc_lowvers) - fprintf(stderr, "Broadcast packet sent " - "for %s\n", - fdlist[i].nconf->nc_netid); -#endif + LIBTIRPC_DEBUG(3, ("rpc_broadcast_exp: Broadcast packet sent for %s\n", + fdlist[i].nconf->nc_netid)); #ifdef PORTMAP /* * Send the version 2 packet also @@ -485,11 +479,8 @@ rpc_broadcast_exp(prog, vers, proc, xargs, argsp, xresults, resultsp, continue; } } -#ifdef RPC_DEBUG - fprintf(stderr, "PMAP Broadcast packet " - "sent for %s\n", - fdlist[i].nconf->nc_netid); -#endif + LIBTIRPC_DEBUG(3, ("rpc_broadcast_exp: PMAP Broadcast packet sent for %s\n", + fdlist[i].nconf->nc_netid)); #endif /* PORTMAP */ } /* End for sending all packets on this transport */ @@ -532,10 +523,8 @@ rpc_broadcast_exp(prog, vers, proc, xargs, argsp, xresults, resultsp, continue; } else fds_found++; -#ifdef RPC_DEBUG - fprintf(stderr, "response for %s\n", - fdlist[i].nconf->nc_netid); -#endif + LIBTIRPC_DEBUG(3, ("rpc_broadcast_exp: response for %s\n", + fdlist[i].nconf->nc_netid)); try_again: inlen = recvfrom(fdlist[i].fd, inbuf, fdlist[i].dsize, 0, (struct sockaddr *)(void *)&fdlist[i].raddr, @@ -596,10 +585,7 @@ rpc_broadcast_exp(prog, vers, proc, xargs, argsp, xresults, resultsp, &taddr, fdlist[i].nconf); } else { #endif /* PORTMAP */ -#ifdef RPC_DEBUG - fprintf(stderr, "uaddr %s\n", - uaddrp); -#endif + LIBTIRPC_DEBUG(3, ("rpc_broadcast_exp: uaddr %s\n", uaddrp)); np = uaddr2taddr( fdlist[i].nconf, uaddrp); done = (*eachresult)(resultsp,