From patchwork Sun Oct 21 09:30:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Eckelmann X-Patchwork-Id: 17506 X-Patchwork-Delegate: sw@simonwunderlich.de Return-Path: X-Original-To: patchwork@open-mesh.org Delivered-To: patchwork@open-mesh.org Received: from open-mesh.org (localhost [IPv6:::1]) by open-mesh.org (Postfix) with ESMTP id BDAA08302B; Sun, 21 Oct 2018 11:30:49 +0200 (CEST) Authentication-Results: open-mesh.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=narfation.org header.i=@narfation.org header.b="Wntr6/4x"; dkim-atps=neutral Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2001:4d88:2000:7::2; helo=v3-1039.vlinux.de; envelope-from=sven@narfation.org; receiver= Received: from v3-1039.vlinux.de (narfation.org [IPv6:2001:4d88:2000:7::2]) by open-mesh.org (Postfix) with ESMTPS id 3703B826C4 for ; Sun, 21 Oct 2018 11:30:46 +0200 (CEST) Received: from sven-desktop.home.narfation.org (p200300C593D704FD0000000000008096.dip0.t-ipconnect.de [IPv6:2003:c5:93d7:4fd::8096]) by v3-1039.vlinux.de (Postfix) with ESMTPSA id 29288110109; Sun, 21 Oct 2018 11:30:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=narfation.org; s=20121; t=1540114246; bh=H8dP6Fs1TMCv6qs9ymkbMY1hAsXWBw6VnTUFWC0eyv0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Wntr6/4xjPSSzf2ktBGRZ2oV9yTz+CioEC56PfzsFX26fhVIre/TImo8jwOS8EMJd bixHNLyRYSqm9fQy8kSLfgz0/Z5DFR5gsDqpeqZZe3bCZaYJzJBMZ5XT0QHV9pSBCz ru75CpBNdK9TH3d7HE+UT/B3vRt3Fy6x/V34s0Do= From: Sven Eckelmann To: b.a.t.m.a.n@lists.open-mesh.org Date: Sun, 21 Oct 2018 11:30:28 +0200 Message-Id: <20181021093032.19928-2-sven@narfation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181021093032.19928-1-sven@narfation.org> References: <20181021093032.19928-1-sven@narfation.org> MIME-Version: 1.0 Subject: [B.A.T.M.A.N.] [PATCH 1/5] batman-adv: Drop unused lockdep include X-BeenThere: b.a.t.m.a.n@lists.open-mesh.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: The list for a Better Approach To Mobile Ad-hoc Networking List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: The list for a Better Approach To Mobile Ad-hoc Networking Errors-To: b.a.t.m.a.n-bounces@lists.open-mesh.org Sender: "B.A.T.M.A.N" The commit f36b93064420 ("batman-adv: Move OGM rebroadcast stats to orig_ifinfo") removed all used functionality of the include linux/lockdep.h from batadv_iv_ogm.c. Signed-off-by: Sven Eckelmann --- net/batman-adv/bat_iv_ogm.c | 1 - 1 file changed, 1 deletion(-) diff --git a/net/batman-adv/bat_iv_ogm.c b/net/batman-adv/bat_iv_ogm.c index d2227091..1d31ac84 100644 --- a/net/batman-adv/bat_iv_ogm.c +++ b/net/batman-adv/bat_iv_ogm.c @@ -34,7 +34,6 @@ #include #include #include -#include #include #include #include From patchwork Sun Oct 21 09:30:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Eckelmann X-Patchwork-Id: 17507 X-Patchwork-Delegate: sw@simonwunderlich.de Return-Path: X-Original-To: patchwork@open-mesh.org Delivered-To: patchwork@open-mesh.org Received: from open-mesh.org (localhost [IPv6:::1]) by open-mesh.org (Postfix) with ESMTP id C57E38303F; Sun, 21 Oct 2018 11:30:52 +0200 (CEST) Authentication-Results: open-mesh.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=narfation.org header.i=@narfation.org header.b="fqAEKpav"; dkim-atps=neutral Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=79.140.41.39; helo=v3-1039.vlinux.de; envelope-from=sven@narfation.org; receiver= Received: from v3-1039.vlinux.de (narfation.org [79.140.41.39]) by open-mesh.org (Postfix) with ESMTPS id CF3518303E for ; Sun, 21 Oct 2018 11:30:50 +0200 (CEST) Received: from sven-desktop.home.narfation.org (p200300C593D704FD0000000000008096.dip0.t-ipconnect.de [IPv6:2003:c5:93d7:4fd::8096]) by v3-1039.vlinux.de (Postfix) with ESMTPSA id A64AF110109; Sun, 21 Oct 2018 11:30:49 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=narfation.org; s=20121; t=1540114249; bh=tBMy2tsWkANp4/g+qEwJDZyccW6z1iX+wjr6rSjSR/Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fqAEKpavXB4wba6pmr+fv/YoTtKyW2cJeryxx6s7UmGdA0K8LYJb17gE3AbP47wKV iqFaLToRjvjIwf3GvM6LrP/oyLucHwM6BBrDy+bsx1dBYyMKeFypwSVaMtJA2YM4QW JgzRsH9puWN1QeueY4g8onDB0aIAiIn1VvGFJP1Y= From: Sven Eckelmann To: b.a.t.m.a.n@lists.open-mesh.org Date: Sun, 21 Oct 2018 11:30:29 +0200 Message-Id: <20181021093032.19928-3-sven@narfation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181021093032.19928-1-sven@narfation.org> References: <20181021093032.19928-1-sven@narfation.org> MIME-Version: 1.0 Subject: [B.A.T.M.A.N.] [PATCH 2/5] batman-adv: Add includes for deprecation warning X-BeenThere: b.a.t.m.a.n@lists.open-mesh.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: The list for a Better Approach To Mobile Ad-hoc Networking List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: The list for a Better Approach To Mobile Ad-hoc Networking Errors-To: b.a.t.m.a.n-bounces@lists.open-mesh.org Sender: "B.A.T.M.A.N" The commit fee04b6f72cf ("batman-adv: Mark debugfs functionality as deprecated") introduced various messages to inform the user about the deprecation of the debugfs based functionality. The messages also include the context/task in which this problem was observed. The datastructures and functions to access this information require special headers. These should be included directly instead of depending on a more complex and fragile include chain. Signed-off-by: Sven Eckelmann --- net/batman-adv/debugfs.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/batman-adv/debugfs.c b/net/batman-adv/debugfs.c index 8b608a2e..d4a7702e 100644 --- a/net/batman-adv/debugfs.c +++ b/net/batman-adv/debugfs.c @@ -19,6 +19,7 @@ #include "debugfs.h" #include "main.h" +#include #include #include #include @@ -27,6 +28,7 @@ #include #include #include +#include #include #include #include From patchwork Sun Oct 21 09:30:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Eckelmann X-Patchwork-Id: 17508 X-Patchwork-Delegate: sw@simonwunderlich.de Return-Path: X-Original-To: patchwork@open-mesh.org Delivered-To: patchwork@open-mesh.org Received: from open-mesh.org (localhost [IPv6:::1]) by open-mesh.org (Postfix) with ESMTP id 0083183051; Sun, 21 Oct 2018 11:30:55 +0200 (CEST) Authentication-Results: open-mesh.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=narfation.org header.i=@narfation.org header.b="kPMOQeUt"; dkim-atps=neutral Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=79.140.41.39; helo=v3-1039.vlinux.de; envelope-from=sven@narfation.org; receiver= Received: from v3-1039.vlinux.de (narfation.org [79.140.41.39]) by open-mesh.org (Postfix) with ESMTPS id A83338304B for ; Sun, 21 Oct 2018 11:30:53 +0200 (CEST) Received: from sven-desktop.home.narfation.org (p200300C593D704FD0000000000008096.dip0.t-ipconnect.de [IPv6:2003:c5:93d7:4fd::8096]) by v3-1039.vlinux.de (Postfix) with ESMTPSA id A35D5110109; Sun, 21 Oct 2018 11:30:52 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=narfation.org; s=20121; t=1540114252; bh=+XgYIqo40g72cuoyPAfbqcV2Sj4D49cd4ohK5+A4yXA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kPMOQeUt+N0lcdbWeGm/HC0fp39QaUz8adX9sq3vEDcKsdrzKmXSy6TFWLHgQAbNR Ku8aSG6HFRxCC/EdX+wlQd25kM57powgtyC1JU8WCkNcbGzYJi4AcCwz6IzvUHTgfu d5zURMNFrMWM8XEkGvyGUveUTfFZvsn7A0N5qCmE= From: Sven Eckelmann To: b.a.t.m.a.n@lists.open-mesh.org Date: Sun, 21 Oct 2018 11:30:30 +0200 Message-Id: <20181021093032.19928-4-sven@narfation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181021093032.19928-1-sven@narfation.org> References: <20181021093032.19928-1-sven@narfation.org> MIME-Version: 1.0 Subject: [B.A.T.M.A.N.] [PATCH 3/5] batman-adv: Improve includes for trace functionality X-BeenThere: b.a.t.m.a.n@lists.open-mesh.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: The list for a Better Approach To Mobile Ad-hoc Networking List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: The list for a Better Approach To Mobile Ad-hoc Networking Errors-To: b.a.t.m.a.n-bounces@lists.open-mesh.org Sender: "B.A.T.M.A.N" The batadv_dbg trace event uses different functionality and datastructures which are not directly associated with the trace infrastructure. It should not be expected that the trace headers indirectly provide them and instead include the required headers directly. Signed-off-by: Sven Eckelmann --- net/batman-adv/trace.c | 2 -- net/batman-adv/trace.h | 6 ++++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/net/batman-adv/trace.c b/net/batman-adv/trace.c index 3d57f998..8e102421 100644 --- a/net/batman-adv/trace.c +++ b/net/batman-adv/trace.c @@ -16,7 +16,5 @@ * along with this program; if not, see . */ -#include - #define CREATE_TRACE_POINTS #include "trace.h" diff --git a/net/batman-adv/trace.h b/net/batman-adv/trace.h index 3acda26a..104784be 100644 --- a/net/batman-adv/trace.h +++ b/net/batman-adv/trace.h @@ -21,7 +21,13 @@ #include "main.h" +#include +#include +#include +#include +#include #include +#include #undef TRACE_SYSTEM #define TRACE_SYSTEM batadv From patchwork Sun Oct 21 09:30:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Eckelmann X-Patchwork-Id: 17509 X-Patchwork-Delegate: sw@simonwunderlich.de Return-Path: X-Original-To: patchwork@open-mesh.org Delivered-To: patchwork@open-mesh.org Received: from open-mesh.org (localhost [IPv6:::1]) by open-mesh.org (Postfix) with ESMTP id 8168D83057; Sun, 21 Oct 2018 11:30:58 +0200 (CEST) Authentication-Results: open-mesh.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=narfation.org header.i=@narfation.org header.b="F9ljcAz8"; dkim-atps=neutral Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2001:4d88:2000:7::2; helo=v3-1039.vlinux.de; envelope-from=sven@narfation.org; receiver= Received: from v3-1039.vlinux.de (narfation.org [IPv6:2001:4d88:2000:7::2]) by open-mesh.org (Postfix) with ESMTPS id 7FC9F83053 for ; Sun, 21 Oct 2018 11:30:56 +0200 (CEST) Received: from sven-desktop.home.narfation.org (p200300C593D704FD0000000000008096.dip0.t-ipconnect.de [IPv6:2003:c5:93d7:4fd::8096]) by v3-1039.vlinux.de (Postfix) with ESMTPSA id 776D6110109; Sun, 21 Oct 2018 11:30:55 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=narfation.org; s=20121; t=1540114255; bh=OUDlcLqTHeEXvrTSKqHLtDhoVKrCk7ZfVKhVQWsFdAc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=F9ljcAz8agW6wz9yvaLPJM0IilWZR9vxVsHGDSP/Hir6Te0bvJEE7Y5y9rMVbMPY+ pMvf6UtF2GZeEfHCbJ1O+nd19IfxcMqP+E9DeayoxbLSy86IuLXJL0oVB49PjqaYpW PphywsQP3obbMJ+eAMa0hfcf2GsT5O9QRSrA6BAM= From: Sven Eckelmann To: b.a.t.m.a.n@lists.open-mesh.org Date: Sun, 21 Oct 2018 11:30:31 +0200 Message-Id: <20181021093032.19928-5-sven@narfation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181021093032.19928-1-sven@narfation.org> References: <20181021093032.19928-1-sven@narfation.org> MIME-Version: 1.0 Subject: [B.A.T.M.A.N.] [PATCH 4/5] batman-adv: Allow to use BATMAN_ADV_DEBUG without BATMAN_ADV_DEBUGFS X-BeenThere: b.a.t.m.a.n@lists.open-mesh.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: The list for a Better Approach To Mobile Ad-hoc Networking List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: The list for a Better Approach To Mobile Ad-hoc Networking Errors-To: b.a.t.m.a.n-bounces@lists.open-mesh.org Sender: "B.A.T.M.A.N" The BATMAN_ADV_DEBUGFS portion of batman-adv is marked as deprecated. Thus all required functionality should be available without it. The debug log was already modified to also output via the kernel tracing function but still retained its BATMAN_ADV_DEBUGFS functionality. Separate the entry point for the debug log from the debugfs portions to make it possible to build with BATMAN_ADV_DEBUG and without BATMAN_ADV_DEBUGFS. Signed-off-by: Sven Eckelmann --- compat.h | 5 ---- net/batman-adv/Kconfig | 2 +- net/batman-adv/log.c | 60 +++++++++++++++++++++++------------------- 3 files changed, 34 insertions(+), 33 deletions(-) diff --git a/compat.h b/compat.h index 385b629c..559df2f3 100644 --- a/compat.h +++ b/compat.h @@ -30,11 +30,6 @@ #include "compat-autoconf.h" -/* test for dependency CONFIG_BATMAN_ADV_DEBUG -> CONFIG_BATMAN_ADV_DEBUGFS */ -#if defined(CONFIG_BATMAN_ADV_DEBUG) && !defined(CONFIG_BATMAN_ADV_DEBUGFS) -#error CONFIG_BATMAN_ADV_DEBUG=y requires CONFIG_BATMAN_ADV_DEBUGFS=y -#endif - #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 0, 0) /* wild hack for batadv_getlink_net only */ diff --git a/net/batman-adv/Kconfig b/net/batman-adv/Kconfig index f75816f5..7b0e1fcd 100644 --- a/net/batman-adv/Kconfig +++ b/net/batman-adv/Kconfig @@ -100,7 +100,7 @@ config BATMAN_ADV_DEBUGFS config BATMAN_ADV_DEBUG bool "B.A.T.M.A.N. debugging" - depends on BATMAN_ADV_DEBUGFS + depends on BATMAN_ADV help This is an option for use by developers; most people should say N here. This enables compilation of support for diff --git a/net/batman-adv/log.c b/net/batman-adv/log.c index 6beb5f06..02e55b78 100644 --- a/net/batman-adv/log.c +++ b/net/batman-adv/log.c @@ -43,6 +43,8 @@ #include "debugfs.h" #include "trace.h" +#ifdef CONFIG_BATMAN_ADV_DEBUGFS + #define BATADV_LOG_BUFF_MASK (batadv_log_buff_len - 1) static const int batadv_log_buff_len = BATADV_LOG_BUF_LEN; @@ -92,33 +94,6 @@ static int batadv_fdebug_log(struct batadv_priv_debug_log *debug_log, return 0; } -/** - * batadv_debug_log() - Add debug log entry - * @bat_priv: the bat priv with all the soft interface information - * @fmt: format string - * - * Return: 0 on success or negative error number in case of failure - */ -int batadv_debug_log(struct batadv_priv *bat_priv, const char *fmt, ...) -{ - struct va_format vaf; - va_list args; - - va_start(args, fmt); - - vaf.fmt = fmt; - vaf.va = &args; - - batadv_fdebug_log(bat_priv->debug_log, "[%10u] %pV", - jiffies_to_msecs(jiffies), &vaf); - - trace_batadv_dbg(bat_priv, &vaf); - - va_end(args); - - return 0; -} - static int batadv_log_open(struct inode *inode, struct file *file) { if (!try_module_get(THIS_MODULE)) @@ -259,3 +234,34 @@ void batadv_debug_log_cleanup(struct batadv_priv *bat_priv) kfree(bat_priv->debug_log); bat_priv->debug_log = NULL; } + +#endif /* CONFIG_BATMAN_ADV_DEBUGFS */ + +/** + * batadv_debug_log() - Add debug log entry + * @bat_priv: the bat priv with all the soft interface information + * @fmt: format string + * + * Return: 0 on success or negative error number in case of failure + */ +int batadv_debug_log(struct batadv_priv *bat_priv, const char *fmt, ...) +{ + struct va_format vaf; + va_list args; + + va_start(args, fmt); + + vaf.fmt = fmt; + vaf.va = &args; + +#ifdef CONFIG_BATMAN_ADV_DEBUGFS + batadv_fdebug_log(bat_priv->debug_log, "[%10u] %pV", + jiffies_to_msecs(jiffies), &vaf); +#endif + + trace_batadv_dbg(bat_priv, &vaf); + + va_end(args); + + return 0; +} From patchwork Sun Oct 21 09:30:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Eckelmann X-Patchwork-Id: 17510 X-Patchwork-Delegate: sw@simonwunderlich.de Return-Path: X-Original-To: patchwork@open-mesh.org Delivered-To: patchwork@open-mesh.org Received: from open-mesh.org (localhost [IPv6:::1]) by open-mesh.org (Postfix) with ESMTP id AF09B83062; Sun, 21 Oct 2018 11:31:01 +0200 (CEST) Authentication-Results: open-mesh.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=narfation.org header.i=@narfation.org header.b="Zzna+Cqv"; dkim-atps=neutral Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=79.140.41.39; helo=v3-1039.vlinux.de; envelope-from=sven@narfation.org; receiver= Received: from v3-1039.vlinux.de (narfation.org [79.140.41.39]) by open-mesh.org (Postfix) with ESMTPS id 3CB748305C for ; Sun, 21 Oct 2018 11:30:59 +0200 (CEST) Received: from sven-desktop.home.narfation.org (p200300C593D704FD0000000000008096.dip0.t-ipconnect.de [IPv6:2003:c5:93d7:4fd::8096]) by v3-1039.vlinux.de (Postfix) with ESMTPSA id 34E2B110109; Sun, 21 Oct 2018 11:30:58 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=narfation.org; s=20121; t=1540114258; bh=osjL0m4MQFscJDIeR14VP30StRNkr50Xmg5TGzw1+8Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Zzna+Cqv8IRO50xuP4t7izz+odurLVw+1n72himE9y58jw0A4jAWbNiixPB9MVoFP aUoLrnCIN5SdmVr5zbrS9KqblVxAcd+KW7rSgeFOFXC1Ew972Tvw/9n2Xo8P0+YWsh iH18wog4D9lhYTAQCFNbM/wqaAr0SobB0IfYhX5w= From: Sven Eckelmann To: b.a.t.m.a.n@lists.open-mesh.org Date: Sun, 21 Oct 2018 11:30:32 +0200 Message-Id: <20181021093032.19928-6-sven@narfation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181021093032.19928-1-sven@narfation.org> References: <20181021093032.19928-1-sven@narfation.org> MIME-Version: 1.0 Subject: [B.A.T.M.A.N.] [PATCH 5/5] batman-adv: Fix description for BATMAN_ADV_DEBUG X-BeenThere: b.a.t.m.a.n@lists.open-mesh.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: The list for a Better Approach To Mobile Ad-hoc Networking List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: The list for a Better Approach To Mobile Ad-hoc Networking Errors-To: b.a.t.m.a.n-bounces@lists.open-mesh.org Sender: "B.A.T.M.A.N" The debug messages of batman-adv are not printed to the kernel log at all but can be stored (depending on the compile setting) in the tracing buffer or the batadv specific log buffer. There is also no debug module parameter but a batadv netdev specific log_level setting to enable/disable different classes of debug messages at runtime. Signed-off-by: Sven Eckelmann --- net/batman-adv/Kconfig | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/net/batman-adv/Kconfig b/net/batman-adv/Kconfig index 7b0e1fcd..082e9606 100644 --- a/net/batman-adv/Kconfig +++ b/net/batman-adv/Kconfig @@ -104,8 +104,9 @@ config BATMAN_ADV_DEBUG help This is an option for use by developers; most people should say N here. This enables compilation of support for - outputting debugging information to the kernel log. The - output is controlled via the module parameter debug. + outputting debugging information to the debugfs log or tracing + buffer. The output is controlled via the batadv netdev specific + log_level setting. config BATMAN_ADV_TRACING bool "B.A.T.M.A.N. tracing support"