From patchwork Fri Oct 18 11:12:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hangbin Liu X-Patchwork-Id: 11198289 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DC2DD69B1 for ; Fri, 18 Oct 2019 11:12:39 +0000 (UTC) Received: from bastion.fedoraproject.org (bastion01.fedoraproject.org [209.132.181.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AAA8E20700 for ; Fri, 18 Oct 2019 11:12:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AAA8E20700 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=libteam-bounces@lists.fedorahosted.org Received: from mailman01.phx2.fedoraproject.org (mailman01.phx2.fedoraproject.org [10.5.126.36]) by bastion01.phx2.fedoraproject.org (Postfix) with ESMTP id 0D98C6075D92; Fri, 18 Oct 2019 11:12:39 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 bastion01.phx2.fedoraproject.org 0D98C6075D92 Received: from mailman01.phx2.fedoraproject.org (localhost [IPv6:::1]) by mailman01.phx2.fedoraproject.org (Postfix) with ESMTP id 04AD45A3324E5; Fri, 18 Oct 2019 11:12:39 +0000 (UTC) Received: by mailman01.phx2.fedoraproject.org (Postfix, from userid 991) id 817555A3324E4; Fri, 18 Oct 2019 11:12:34 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mailman01.phx2.fedoraproject.org X-Spam-Level: X-Spam-Status: No, score=-0.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE autolearn=disabled version=3.4.0 Received: from smtp-mm-ib01.fedoraproject.org (smtp-mm-ib01.vpn.fedoraproject.org [192.168.1.83]) by mailman01.phx2.fedoraproject.org (Postfix) with ESMTP id F20F85A3324ED for ; Fri, 18 Oct 2019 11:12:33 +0000 (UTC) Received: from mail-pl1-f193.google.com (mail-pl1-f193.google.com [209.85.214.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by smtp-mm-ib01.fedoraproject.org (Postfix) with ESMTPS id 7904B6064181 for ; Fri, 18 Oct 2019 11:12:33 +0000 (UTC) Received: by mail-pl1-f193.google.com with SMTP id d22so2695947pll.7 for ; Fri, 18 Oct 2019 04:12:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=tNxc2cWS4D9ut9uCPoZCbjrXwo25FLvwAHD/uZYmQWQ=; b=YQxL4eTK3chtPOav94rw1fq5U5jiqnpq55uxbvSMKToAP0o9zLgnq5StauVAB1bo4U xoHHI3cGAEQ38qrgOkofNC9GM2SRG+neKlgzNmQRci+JDm/pOQS5Qz1xBysiWS3go9j0 /YB2ki9TaxxV2Mjf+T0ZAO2cTJbufygyibRZz/k5pBOTIIDPpdD2FLHZHPQ6irvhW2XK A/yOfPkEW4KtmSyBfl9gfYZ04ab0hKE0lA/vUpOuncUH1enRWfD1BnVtvKCNH+rVA2SG 0IOh1x2ea1fu6I8G9YEWIgmaYQBxbK+xjF3YWvBdQ1wcVTEWO/+eU5TvJXitJ5KGWSwk 8/MA== X-Gm-Message-State: APjAAAUrCxLB4Yie0gX0sJYn6ylRv4GpkddD4u5E/u8WHtQxIxDlyak9 OoAHWM9iIu2We6gaNdnF1436hEeOs6M= X-Google-Smtp-Source: APXvYqwseEK0DnxyzWR0K0Q7HqVshgXveuG4IPs2pKLhdkE3pWYof562dNT9cBnTsPIkIGH/zrzGbQ== X-Received: by 2002:a17:902:a608:: with SMTP id u8mr9241932plq.72.1571397152289; Fri, 18 Oct 2019 04:12:32 -0700 (PDT) Received: from dhcp-12-139.nay.redhat.com ([209.132.188.80]) by smtp.gmail.com with ESMTPSA id c7sm5490270pfr.75.2019.10.18.04.12.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Oct 2019 04:12:31 -0700 (PDT) From: Hangbin Liu To: libteam@lists.fedorahosted.org Subject: [PATCH libteam] teamd: lacp: use teamd_log_dbgx to print lacp info state Date: Fri, 18 Oct 2019 19:12:18 +0800 Message-Id: <20191018111218.24713-1-liuhangbin@gmail.com> X-Mailer: git-send-email 2.19.2 MIME-Version: 1.0 Message-ID-Hash: RBXB6X53VMXCYVVKG7IJBDWSFFCLIXAD X-Message-ID-Hash: RBXB6X53VMXCYVVKG7IJBDWSFFCLIXAD X-MailFrom: liuhangbin@gmail.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header CC: Hangbin Liu , Jiri Pirko X-Mailman-Version: 3.1.1 Precedence: list List-Id: Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: When we set TEAM_LOG_OUTPUT=syslog in the environment, all the logs, including debug info will be printed to syslog, even though we set daemon_verbosity_level = LOG_INFO. The reason is the function daemon_logv() of libdaemon only check the daemon_verbosity_level for LOG_STDOUT and LOG_STDERR, not LOG_SYSLOG. Also here is the quote for daemon_set_verbosity() from libdaemon/dlog.h """ Allows to decide which messages to output on standard output/error streams. All messages are logged to syslog and this setting does not influence that. """ So libdaemon is intend to print all logs to syslog. But when we also enabled lacp fast_rate, the lacp state info may get a little annoying as it will print the state info every second, even the log level is LOG_INFO. So let's use teamd_log_dbgx() to print lacp info state, which would only print the state log message with -g option. Signed-off-by: Hangbin Liu --- teamd/teamd_runner_lacp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/teamd/teamd_runner_lacp.c b/teamd/teamd_runner_lacp.c index d292d69..179b954 100644 --- a/teamd/teamd_runner_lacp.c +++ b/teamd/teamd_runner_lacp.c @@ -929,8 +929,8 @@ static void lacp_port_actor_update(struct lacp_port *lacp_port) state |= INFO_STATE_DEFAULTED; if (teamd_port_count(lacp_port->ctx) > 0) state |= INFO_STATE_AGGREGATION; - teamd_log_dbg("%s: lacp info state: 0x%02X.", lacp_port->tdport->ifname, - state); + teamd_log_dbgx(lacp_port->ctx, 1, "%s: lacp info state: 0x%02X.", + lacp_port->tdport->ifname, state); lacp_port->actor.state = state; }