From patchwork Fri Aug 10 21:36:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Eckelmann X-Patchwork-Id: 17453 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 CCC6581B50; Sat, 11 Aug 2018 00:07:40 +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="R4YyKy12"; 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 5DAEF81012 for ; Fri, 10 Aug 2018 23:36:30 +0200 (CEST) Received: from sven-desktop.home.narfation.org (p200300C593C63CFD0000000000004065.dip0.t-ipconnect.de [IPv6:2003:c5:93c6:3cfd::4065]) by v3-1039.vlinux.de (Postfix) with ESMTPSA id 7580B1100D8; Fri, 10 Aug 2018 23:36:29 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=narfation.org; s=20121; t=1533936989; bh=fMgfegXzjlalNJcTnnZfY5KCBTbSpl71y0qJo1GOnYM=; h=From:To:Cc:Subject:Date:From; b=R4YyKy12nb2bT5GyjJktB7W1ubkfpoKVRuuDQG2fnMqmmUWkfa6swlbvcEJ08C1CK BZuKGqPpFAdqDiotFrnOmYqoNlaK7RrpwfsMcY4cHh63S6Iv0Jx4qz7hHcMuQDoS4a FLj3ddpBYVLxouwZiVhvcaF8zYlSGXmsVj/D2Ql8= From: Sven Eckelmann To: b.a.t.m.a.n@lists.open-mesh.org Date: Fri, 10 Aug 2018 23:36:14 +0200 Message-Id: <20180810213616.23794-1-sven@narfation.org> X-Mailer: git-send-email 2.18.0 Subject: [B.A.T.M.A.N.] [PATCH 0/2] batman-adv: Continue with deprecation of 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" Hi, these two changes should help batman-adv during the ongoing process of replacing the debugfs code. We already have: * replaced most debugfs "tables" with netlink dumpit commands * replaced the socket file code in batctl with direct captures/injects for traceroute/ping * made the debugfs code optional These first two things were required to get it working in network namespaces. The last point allows in theory to disable the debugfs code but distributions will still continue to build the debugfs support for a while. The first patch in this series will therefore log access requests to this deprecated functionality in the kernel message buffer. This will hopefully cause more developers to switch their tools to netlink in the near future: $ cat /sys/kernel/debug/batman_adv/bat0/neighbors > /dev/null batman_adv: [Deprecated]: cat (pid 12053) Use of debugfs file "neighbors". Use genl command BATADV_CMD_GET_NEIGHBORS instead But we also have some other functionality in batman-adv's debugfs which could be integrated better in the rest of the kernel infrastructure: the logging. The log ringbuffer from batman-adv is completely isolated from the rest of the kernel even when the kernel itself already provides its own tracing infrastructure. The tooling for the kernel infrastructure is also a lot better and should replace the batman_adv/*/log file in batman-adv/batctl completely - but let us postpone the removal for now. Some examples for the usage of batadv_dbg via tracepoints can be found in the commit message of this change. A lot more complex things are possible with TRACE_EVENT and co but let us start now with the conversion of the already existing messages. There is also a good introduction on LWN [1,2,3] Kind regards, Sven [1] https://lwn.net/Articles/379903/ [2] https://lwn.net/Articles/381064/ [3] https://lwn.net/Articles/383362/ Sven Eckelmann (2): batman-adv: Mark debugfs functionality as deprecated batman-adv: Provide debug messages as trace events Makefile | 3 ++ README.external.rst | 1 + compat-include/linux/fs.h | 37 +++++++++++++++++ gen-compat-autoconf.sh | 1 + net/batman-adv/Kconfig | 11 +++++ net/batman-adv/Makefile | 3 ++ net/batman-adv/debugfs.c | 37 +++++++++++++++++ net/batman-adv/debugfs.h | 6 +++ net/batman-adv/icmp_socket.c | 3 ++ net/batman-adv/log.c | 19 +++++++-- net/batman-adv/trace.c | 22 ++++++++++ net/batman-adv/trace.h | 78 ++++++++++++++++++++++++++++++++++++ 12 files changed, 217 insertions(+), 4 deletions(-) create mode 100644 compat-include/linux/fs.h create mode 100644 net/batman-adv/trace.c create mode 100644 net/batman-adv/trace.h