From patchwork Tue Oct 9 11:20:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rasmus Villemoes X-Patchwork-Id: 10632355 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 AC911112B for ; Tue, 9 Oct 2018 11:21:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8D40F289FB for ; Tue, 9 Oct 2018 11:21:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 813DA28A73; Tue, 9 Oct 2018 11:21:55 +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=ham 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 16CBA289FB for ; Tue, 9 Oct 2018 11:21:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727486AbeJIShG (ORCPT ); Tue, 9 Oct 2018 14:37:06 -0400 Received: from mail-ed1-f67.google.com ([209.85.208.67]:44259 "EHLO mail-ed1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727284AbeJIShF (ORCPT ); Tue, 9 Oct 2018 14:37:05 -0400 Received: by mail-ed1-f67.google.com with SMTP id z21-v6so1304534edb.11 for ; Tue, 09 Oct 2018 04:20:35 -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=jlaMlnDD3Ii16jAg/Lcwqism2m+Mq3AaZpU6R5FfxQc=; b=dvvBadQ/+q7Cb75Rvd9fiLdENLJws6LhTvYLGKQ0Ew4swyM0YDHDbuYMT4xSxhf3Oj KXVPCStOXlBAau/HBk4c7udeXqXy/a5Z7M2xNzWKyaU6avLzC9wam3jlShc4TkUWCv5v CNV96/yOfdqEdtsJbWHAFHpSCNn5WLhJSrFtw= 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=jlaMlnDD3Ii16jAg/Lcwqism2m+Mq3AaZpU6R5FfxQc=; b=bhfKkRhEyx8UjFpDCLymOWD7xQ71/2swDqD01I96TS+1ha5kWY7UDzepet62xE4ozc RCaS0E45fq6ZghprdeICKBlxsGfE8kiDeoS7zBxh4TWNf3o+VYJTLRbvl6kJ0sZR42UD vXbbl64+qDmJKFXigBG8ZitsL8xDFAAwBoSGS1xE/dp0liWAkBp8VRHvlPHrW7X/voU5 SK+OvpyLUBlpVOKc53BZ3uV8pSF6kXXjzJcyQ7/00wnAI4fSjYoMD6sSTodmhI0n7qWw +eZSS+JwmbpOVGRKW4hKYvrCMddWqRs7GSx7DQtIMS7BXCi9jcfBTMUy85dvEJJWwcid dUZg== X-Gm-Message-State: ABuFfohQtI6AvkLQM4KpvrFyQmYWA7kyMW0hDM3Slpor5yFf5GwMLKoY JZNVaEdSTLpJ1n3LcTIaMa5fQw== X-Google-Smtp-Source: ACcGV61DncgNN/5DWqDyjRnBSiYjlO+bnhuy12hsYOkefhzFr0Njo5CZh8/n9Ic+E5i5f2m4Jx7Z9A== X-Received: by 2002:a50:b404:: with SMTP id b4-v6mr13233795edh.141.1539084034556; Tue, 09 Oct 2018 04:20:34 -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.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 09 Oct 2018 04:20:34 -0700 (PDT) From: Rasmus Villemoes To: Jason Baron , Andrew Morton Cc: linux-kernel@vger.kernel.org, Rasmus Villemoes , linux-btrfs@vger.kernel.org, David Sterba Subject: [PATCH v2 14/23] btrfs: implement btrfs_debug* in terms of helper macro Date: Tue, 9 Oct 2018 13:20:04 +0200 Message-Id: <20181009112013.14238-15-linux@rasmusvillemoes.dk> X-Mailer: git-send-email 2.19.1.4.g721af0fda3 In-Reply-To: <20181009112013.14238-1-linux@rasmusvillemoes.dk> References: <20180919220444.23190-1-linux@rasmusvillemoes.dk> <20181009112013.14238-1-linux@rasmusvillemoes.dk> MIME-Version: 1.0 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 First, the btrfs_debug macros open-code (one possible definition of) DYNAMIC_DEBUG_BRANCH, so they don't benefit from the HAVE_JUMP_LABEL optimization. Second, changes on x86-64 later in this series require that all struct _ddebug descriptors in a translation unit use distinct identifiers. Using the new _dynamic_func_call_no_desc helper macro from dynamic_debug.h takes care of both of these. Cc: linux-btrfs@vger.kernel.org Acked-by: David Sterba Acked-by: Jason Baron Signed-off-by: Rasmus Villemoes --- fs/btrfs/ctree.h | 34 ++++++++++------------------------ 1 file changed, 10 insertions(+), 24 deletions(-) diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index 2cddfe7806a4..7ae6cdad5b38 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h @@ -3353,31 +3353,17 @@ void btrfs_printk(const struct btrfs_fs_info *fs_info, const char *fmt, ...); #if defined(CONFIG_DYNAMIC_DEBUG) #define btrfs_debug(fs_info, fmt, args...) \ -do { \ - DEFINE_DYNAMIC_DEBUG_METADATA(descriptor, fmt); \ - if (unlikely(descriptor.flags & _DPRINTK_FLAGS_PRINT)) \ - btrfs_printk(fs_info, KERN_DEBUG fmt, ##args); \ -} while (0) -#define btrfs_debug_in_rcu(fs_info, fmt, args...) \ -do { \ - DEFINE_DYNAMIC_DEBUG_METADATA(descriptor, fmt); \ - if (unlikely(descriptor.flags & _DPRINTK_FLAGS_PRINT)) \ - btrfs_printk_in_rcu(fs_info, KERN_DEBUG fmt, ##args); \ -} while (0) + _dynamic_func_call_no_desc(fmt, btrfs_printk, \ + fs_info, KERN_DEBUG fmt, ##args) +#define btrfs_debug_in_rcu(fs_info, fmt, args...) \ + _dynamic_func_call_no_desc(fmt, btrfs_printk_in_rcu, \ + fs_info, KERN_DEBUG fmt, ##args) #define btrfs_debug_rl_in_rcu(fs_info, fmt, args...) \ -do { \ - DEFINE_DYNAMIC_DEBUG_METADATA(descriptor, fmt); \ - if (unlikely(descriptor.flags & _DPRINTK_FLAGS_PRINT)) \ - btrfs_printk_rl_in_rcu(fs_info, KERN_DEBUG fmt, \ - ##args);\ -} while (0) -#define btrfs_debug_rl(fs_info, fmt, args...) \ -do { \ - DEFINE_DYNAMIC_DEBUG_METADATA(descriptor, fmt); \ - if (unlikely(descriptor.flags & _DPRINTK_FLAGS_PRINT)) \ - btrfs_printk_ratelimited(fs_info, KERN_DEBUG fmt, \ - ##args); \ -} while (0) + _dynamic_func_call_no_desc(fmt, btrfs_printk_rl_in_rcu, \ + fs_info, KERN_DEBUG fmt, ##args) +#define btrfs_debug_rl(fs_info, fmt, args...) \ + _dynamic_func_call_no_desc(fmt, btrfs_printk_ratelimited, \ + fs_info, KERN_DEBUG fmt, ##args) #elif defined(DEBUG) #define btrfs_debug(fs_info, fmt, args...) \ btrfs_printk(fs_info, KERN_DEBUG fmt, ##args)