From patchwork Wed Sep 19 22:04:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rasmus Villemoes X-Patchwork-Id: 10606601 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 518C614BD for ; Wed, 19 Sep 2018 22:07:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 42AA02CA99 for ; Wed, 19 Sep 2018 22:07:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 369752CAE5; Wed, 19 Sep 2018 22:07:01 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D661F2CA99 for ; Wed, 19 Sep 2018 22:07:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732416AbeITDos (ORCPT ); Wed, 19 Sep 2018 23:44:48 -0400 Received: from mail-ed1-f68.google.com ([209.85.208.68]:37272 "EHLO mail-ed1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728124AbeITDos (ORCPT ); Wed, 19 Sep 2018 23:44:48 -0400 Received: by mail-ed1-f68.google.com with SMTP id a20-v6so6176546edd.4 for ; Wed, 19 Sep 2018 15:04:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rasmusvillemoes.dk; s=google; h=from:to:cc:subject:date:message-id; bh=WWj2L2WQXo7BL7l3DmKOuE0YLVjmMR3vjyM0Ya9gp60=; b=icNzbWcb8UfIHdfHEQAFD3YVOvuXgi1uJv+bgYLkN6nd2Isn6GqQnvOr9NUz3PAdZQ DJm9zRD1NtKu8txbyqMFedd3IQlDZ/ZpcM1mx5qEx2ABgXYmnW0qYejXY+K87aCNdy2O ye9GO6xLn8k2ngjjTnmAUPtfm/NYQNqy5wZ7I= 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; bh=WWj2L2WQXo7BL7l3DmKOuE0YLVjmMR3vjyM0Ya9gp60=; b=MVaF3EELPRFKKyxyOjgUh7KHUwAKRDSlFXtFMPirt269IuKgWFVo/dgk8VOQwxLV4f FgzMcz5y0368zQMHARM3rotNEY6NdfSjXUo+7j2oD+7g2HuVVO00uu7V/e7teeTNwdDK RdLLEnCkKzD7LZcPpClrraKjDXWOrmc5LfmSAF4eR8v62Ya4+RxP+ujhEVqY2at70dyS dhlLE18DC8b7rm0ZaDaquojcf8k/hyx/gIXNFP6ldpcybg0NJW9lrspehTzfnBjrYvah yqYjYCDGo0uTIf8Uek559Fr22FVdg4W2YE6H/tfRYQQh1p3yZpYTnfwu0HLzYREw3c1l X6gw== X-Gm-Message-State: APzg51DffRw+D+MKJz8An+XdSGkajo1zRfpDN16yGd2qOCTbh3tmC1ko C5MJ2nBq+XriwoacOk3a8X7DtA== X-Google-Smtp-Source: ANB0VdbdbNhiS6ro/yQl2J8IMflK6qxvybrRmg8nhXBrvos30+ZGYVDQpXiqZ+XvpSU/XZkCJHsGVw== X-Received: by 2002:a50:b5e6:: with SMTP id a93-v6mr61288901ede.94.1537394690539; Wed, 19 Sep 2018 15:04:50 -0700 (PDT) Received: from prevas-ravi.waoo.dk (dhcp-5-186-115-161.cgn.ip.fibianet.dk. [5.186.115.161]) by smtp.gmail.com with ESMTPSA id a9-v6sm2798edi.26.2018.09.19.15.04.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 19 Sep 2018 15:04:49 -0700 (PDT) From: Rasmus Villemoes To: Jason Baron , Andrew Morton Cc: linux-kernel@vger.kernel.org, Rasmus Villemoes , Greg Kroah-Hartman , netdev@vger.kernel.org, Petr Mladek , Steven Rostedt , linux-btrfs@vger.kernel.org, linux-acpi@vger.kernel.org, x86@kernel.org Subject: [PATCH 00/22] various dynamic_debug patches Date: Thu, 20 Sep 2018 00:04:22 +0200 Message-Id: <20180919220444.23190-1-linux@rasmusvillemoes.dk> X-Mailer: git-send-email 2.16.4 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This started as an experiment to see how hard it would be to change the four pointers in struct _ddebug into relative offsets, a la CONFIG_GENERIC_BUG_RELATIVE_POINTERS, thus saving 16 bytes per pr_debug site (and thus exactly making up for the extra space used by the introduction of jump labels in 9049fc74). I stumbled on a few things that are probably worth fixing regardless of whether the latter half of this series is deemed worthwhile. Patch relationships: 1-2, 3-4, 5-6 and 15-16 can be applied individually, though 2, 4 and 6 probably makes most sense in the context of the final goal of the series. 7-12 I believe make sense on their own. Patch 13 again only makes sense if we go all the way, and 14 and 17 depend on 13. 18-21 are more preparatory patches, and finally 22 switch over x86-64 to use CONFIG_DYNAMIC_DEBUG_RELATIVE_POINTERS. I've tested that the end result boots under virtme and that the dynamic_debug control file has the expected contents. Rasmus Villemoes (22): linux/device.h: use DYNAMIC_DEBUG_BRANCH in dev_dbg_ratelimited linux/device.h: use unique identifier for each struct _ddebug linux/net.h: use DYNAMIC_DEBUG_BRANCH in net_dbg_ratelimited linux/net.h: use unique identifier for each struct _ddebug linux/printk.h: use DYNAMIC_DEBUG_BRANCH in pr_debug_ratelimited linux/printk.h: use unique identifier for each struct _ddebug dynamic_debug: consolidate DEFINE_DYNAMIC_DEBUG_METADATA definitions dynamic_debug: don't duplicate modname in ddebug_add_module dynamic_debug: use pointer comparison in ddebug_remove_module dynamic_debug: remove unused EXPORT_SYMBOLs dynamic_debug: move pr_err from module.c to ddebug_add_module dynamic_debug: add static inline stub for ddebug_add_module dynamic_debug: refactor dynamic_pr_debug and friends btrfs: implement btrfs_debug* in terms of helper macro ACPI: use proper DYNAMIC_DEBUG_BRANCH macro ACPI: remove unused __acpi_handle_debug macro ACPI: implement acpi_handle_debug in terms of _dynamic_func_call dynamic_debug: introduce accessors for string members of struct _ddebug dynamic_debug: drop use of bitfields in struct _ddebug dynamic_debug: introduce CONFIG_DYNAMIC_DEBUG_RELATIVE_POINTERS x86: jump_label: introduce ASM_STATIC_KEY_INIT_{TRUE,FALSE} x86_64: use relative pointers with dynamic debug arch/x86/Kconfig | 1 + arch/x86/include/asm/dynamic_debug.h | 35 +++++++++ arch/x86/include/asm/jump_label.h | 18 +++++ fs/btrfs/ctree.h | 34 +++------ include/linux/acpi.h | 11 +-- include/linux/device.h | 6 +- include/linux/dynamic_debug.h | 126 +++++++++++++++++++-------------- include/linux/jump_label.h | 2 + include/linux/net.h | 6 +- include/linux/printk.h | 6 +- kernel/module.c | 6 +- lib/Kconfig.debug | 3 + lib/dynamic_debug.c | 133 ++++++++++++++++++++++++----------- 13 files changed, 251 insertions(+), 136 deletions(-) create mode 100644 arch/x86/include/asm/dynamic_debug.h Acked-by: Jason Baron