From patchwork Wed Sep 19 22:04:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rasmus Villemoes X-Patchwork-Id: 10606599 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 5D734921 for ; Wed, 19 Sep 2018 22:06:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4D6DA2B8A1 for ; Wed, 19 Sep 2018 22:06:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 40EE12CA99; Wed, 19 Sep 2018 22:06: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=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 D6E4B2B8A1 for ; Wed, 19 Sep 2018 22:06:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387477AbeITDpI (ORCPT ); Wed, 19 Sep 2018 23:45:08 -0400 Received: from mail-ed1-f68.google.com ([209.85.208.68]:43208 "EHLO mail-ed1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387474AbeITDpH (ORCPT ); Wed, 19 Sep 2018 23:45:07 -0400 Received: by mail-ed1-f68.google.com with SMTP id z27-v6so6147664edb.10 for ; Wed, 19 Sep 2018 15:05:10 -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; bh=p2v8O54H/+GBJz9AUMbqfK21ypoorYU8wjZ4lwLUBfg=; b=Csh6Unsa3Mgk/RJ6v6ei8xKwwsYPuTAY7OzrgdCZtmZlAR4U74BvHiIe0XnqNLgxbd rPbaFtRY3LDtKsBuTN6dWjnwOAo5v9dTi7MpjULAhr0XiuyxoAdllYIBBTk98k8WfSXK LXub6uI9dmX+KOQQV+cus1wFQNPJ14UPLKkwA= 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; bh=p2v8O54H/+GBJz9AUMbqfK21ypoorYU8wjZ4lwLUBfg=; b=kkjRSdKvWJYGcwggTftAwqT9Tthfli9BIXcFkFSJmP+ku2CJFouDM+A/R8S1l7PfGj ftUupP1FGbDa7ADbE/ywKm3bE5NgS2flERMw01yz0+HM7vQFct5oPoVzDx2tkBnohslT l3pDq74AVcUaqV5nB2m2or1Ehg4U0Ur0Rx2btorayw+rdzuiuFnKmyoPaVuyXEkcFmzJ CYaPMbgfJlysKLAYBnhRB9aGFRGbswEwBFCfqRw4b5aw+1JA4rkrJF7fct2UGJDRyyBT Ixnjrnr+MxNN+Y84FUDcNXuYivF/svLnaaJ6uiEuUOgFdd5nERDlPbxoHXYRjOzlas6p eW4A== X-Gm-Message-State: APzg51BEU/zEc1IELRuzhpHwmQaPX2VPTBW81rGmjHU6COQiD1ZfJ/zj FVxQcsXakP+CY2AMv4X+rSka8Q== X-Google-Smtp-Source: ANB0VdYq5zEUHzGXAGBGVOnDpcIoWO5QR4Gf3jEV53Z8r5jAHBcAra63/uxnO/My5XBRj23P0vrSQw== X-Received: by 2002:a50:b5e6:: with SMTP id a93-v6mr61290668ede.94.1537394709474; Wed, 19 Sep 2018 15:05:09 -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.05.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 19 Sep 2018 15:05:09 -0700 (PDT) From: Rasmus Villemoes To: Jason Baron , Andrew Morton Cc: linux-kernel@vger.kernel.org, Rasmus Villemoes , linux-btrfs@vger.kernel.org Subject: [PATCH 14/22] btrfs: implement btrfs_debug* in terms of helper macro Date: Thu, 20 Sep 2018 00:04:36 +0200 Message-Id: <20180919220444.23190-15-linux@rasmusvillemoes.dk> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20180919220444.23190-1-linux@rasmusvillemoes.dk> References: <20180919220444.23190-1-linux@rasmusvillemoes.dk> 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 Signed-off-by: Rasmus Villemoes Acked-by: David Sterba --- 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)