Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp4725426imm; Tue, 9 Oct 2018 04:25:18 -0700 (PDT) X-Google-Smtp-Source: ACcGV60OwhAs6OUlbAB772vadnXdwSJ+Fh8bqdggd+JpvjkGnKJq5CqqjKackDpQs2SlqzFdjBFV X-Received: by 2002:a63:ee43:: with SMTP id n3-v6mr23940484pgk.234.1539084318639; Tue, 09 Oct 2018 04:25:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539084318; cv=none; d=google.com; s=arc-20160816; b=Lmj4kfVaOXYDiQVM7DicFduAluSXv3rv7e5NxU/IlXOizkm+Yq3klu6iH6Iu2krD7B oRTMTEOShrgMOB6LnwZpA1O6K/MR1Aroqrg4/KdFJCqeGZA94v2xSRc2Qr9XCOiFoH5w obW/jL1gcxbn5aPINbaWR75Bnj8ogkLNU8uCWMdGD3SfjRJulGE1vXpABKeKJ8ptidm4 3YOyTPzQXU3IMIsU5HiwbQqFl7fFZ0n7SVBrrpoPJi2lGb1DaqgxvlRHeymDh1Ef+Cao PPeTzczmm/aQl2BCy6G6nMgYuABC/j+eQNCrHagBhN7o8WZQ4UH3GEnQMBcxebrOYvyY qxaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Sn/AWD4WRDQ2Msz68IUClU2wTNTckgQGW9iv1MLre4Q=; b=MwEN3FDnLxq5LOxx90tl5rFLf8wDOMu4DBBo/WnCzjjRftiLC7oVpwoIawJYds8kdh AUE/45KvvAj+79VJeBMdwo7LoaVmP732zIJpiA0hKrLvRN6vEz8fGvWZtuLYkVmwr6BJ b18b3HSKDAU/5koaw+4IGQErO8fnkZ8ZFvXHj3oAJh+Us3QkrVO5cHjguaGZLBbSdcs+ Nyz5YzXomc+X+l3GdaZPmPq2XpfpJTDQrLUBh06EGjsKa8xHS0a8ese4MhP4D6+ShinX dtlsDUSm+/24qtmtdyKjKrEDfG/ttmbRRgeiDOvwk3ae0AQVWXUTK3BHZnb77UvhcRxB VAcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rasmusvillemoes.dk header.s=google header.b="SfUENK1/"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 72-v6si3674436pla.334.2018.10.09.04.25.04; Tue, 09 Oct 2018 04:25:18 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@rasmusvillemoes.dk header.s=google header.b="SfUENK1/"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726977AbeJISgw (ORCPT + 99 others); Tue, 9 Oct 2018 14:36:52 -0400 Received: from mail-ed1-f65.google.com ([209.85.208.65]:36175 "EHLO mail-ed1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726439AbeJISgv (ORCPT ); Tue, 9 Oct 2018 14:36:51 -0400 Received: by mail-ed1-f65.google.com with SMTP id c26-v6so1330032edt.3 for ; Tue, 09 Oct 2018 04:20:22 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=Sn/AWD4WRDQ2Msz68IUClU2wTNTckgQGW9iv1MLre4Q=; b=SfUENK1/2RHdd9jyU5+p/ByeQTQt8SlPigGrHXc50eAluvFrJt13K1d03Rw67JBvqj JpZ4JokO7kRP+9t41mUhTDl9fMbWOzBf6cSluKruXyW2GvvEFuZTK7LCs8sspmy2JDQx vsI5WOiOb2X73TCDBUNPYO4K3M3nwmRSJxgB8= 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=Sn/AWD4WRDQ2Msz68IUClU2wTNTckgQGW9iv1MLre4Q=; b=DzKuUtNiCZLKbbObpPXkJ3pIZSKNXC8WqM1KHt4WxDTuS1B4phRbOx3nBTuLoqzmKZ Ee/IkbREBg0YiS8QIfnrhLNmHPvz+oBhWzKtNXKO0Vu4bOCH4y1iYe+j+x/RGkz64ubd qYt1MjWmliFL61+WOWrz0Dz5qXhPuAUS1/3Qt8rn0dD3bPAnVa+xvrTgDEAoPv/EQw22 daaKOuXMkQr8QElSQazhrQc0/7QRVajOM6zF++i1moSBBmlfIShg4GRiFoAJqfrSx+kh y2SgWI/iSBWD8sEYplGGN0wQf6tbeppa4xLzt3xShwxZ88Jc5LNOUjh1vskS7gZ/E+x8 mdlQ== X-Gm-Message-State: ABuFfojffZsp2SNEyT9szDmmQ86JL8tx3OhxUx1gKMQKWdQiAGSuhRpg NrhUhPWatk5qdfIQXD8PztV+eQ== X-Received: by 2002:a17:906:95da:: with SMTP id n26-v6mr26423798ejy.205.1539084019800; Tue, 09 Oct 2018 04:20:19 -0700 (PDT) Received: from prevas-ravi.vestasvisitor.net ([193.47.71.171]) by smtp.gmail.com with ESMTPSA id n23-v6sm3595821eja.41.2018.10.09.04.20.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 09 Oct 2018 04:20:19 -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 v2 00/23] various dynamic_debug patches Date: Tue, 9 Oct 2018 13:19:50 +0200 Message-Id: <20181009112013.14238-1-linux@rasmusvillemoes.dk> X-Mailer: git-send-email 2.19.1.4.g721af0fda3 In-Reply-To: <20180919220444.23190-1-linux@rasmusvillemoes.dk> References: <20180919220444.23190-1-linux@rasmusvillemoes.dk> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org v2: Added various acks/reviews. I'll follow up with rewriting the x86 part as asm macros once that work is in mainline. Patches 15, 16 are in next-20181009; in hindsight I should probably have asked Rafael not to pick those. Patch 17 textually depend on those, and patch 19 removes the .flags field, so depends on 15 so that there are no references to that field. I'm included all patches here hoping that the merge conflicts are trivial, given that it's just same patches present in multiple branches. Andrew, can you pick up these to give them some time in -next? v1 cover letter: 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 (23): 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 x86: dynamic_debug: protect against dynamic debug identifier reuse arch/x86/Kconfig | 1 + arch/x86/include/asm/dynamic_debug.h | 40 ++++++++ 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, 256 insertions(+), 136 deletions(-) create mode 100644 arch/x86/include/asm/dynamic_debug.h -- 2.19.1.3.g1d92a00e68