From patchwork Wed Sep 19 22:04:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rasmus Villemoes X-Patchwork-Id: 971963 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=rasmusvillemoes.dk Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=rasmusvillemoes.dk header.i=@rasmusvillemoes.dk header.b="K6YSSdux"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 42Fv8s3JY9z9sCS for ; Thu, 20 Sep 2018 08:06:53 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387523AbeITDqn (ORCPT ); Wed, 19 Sep 2018 23:46:43 -0400 Received: from mail-ed1-f65.google.com ([209.85.208.65]:39017 "EHLO mail-ed1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732856AbeITDow (ORCPT ); Wed, 19 Sep 2018 23:44:52 -0400 Received: by mail-ed1-f65.google.com with SMTP id h4-v6so6175622edi.6 for ; Wed, 19 Sep 2018 15:04:55 -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=8rvxkeg1oDAWlydjv//E8LWHw6C5aIOn5eLGuaD3b2s=; b=K6YSSduxlajtjwT2+FqRExRH7XJmfV9CcL+wIsLEvrtrAgkUO7OCEwgMyTF5Ej0g5u 58M6GprpLDWDZbLc2XtoQ5RoJ3j89q0s6K3ps+aL2AXmwyXPAyV1EBzSQkocoeUoIHRe umiMQfqGQAU2RMOc3+iD3g1qV0z7UUDf8r2Hs= 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=8rvxkeg1oDAWlydjv//E8LWHw6C5aIOn5eLGuaD3b2s=; b=G511U/eZ/gU18+DzriVpe01kGLXGI2SHasZJrvIENZ2rWN9KgWL+ALh0nfVGa+v3vr DflrGLtghV/cNpR47MuINEjKTquKCO/QQiPe3vUVNVlI9VlnIUrLhv0cOvR0MduLz36O e5Fw1yIaMmIeOkD11oONfyZ5buBZ0f/nomO7PZdZVtPpbkZ+Q4vu/5H9SLdRXv84fc3T m/9PZi+rldEcuAmXBRNB1ePe1cxIBVB6qOOhLNIyLePVFpdqw6MZK4LfM4nUnW8xWgs/ mwC2nzd0i2DZSnjqVTCBoFmrv7XfQDCKeXd9CX/GRGDfTxB6gUquZi/ilRemkzboA+9n dEag== X-Gm-Message-State: APzg51Btfd4ENELkceJxhrYDKqCxru/o8N561Io8GFf1ovc20ArDcuhQ 1Z3IsaJ3yK2/iwqErzb65mWvzQ== X-Google-Smtp-Source: ANB0VdaVyJ9ZOCEnZ9RbQP/xZT8BNm8RPOC2sFjL8nkOW8D3+5S3lEQTzj95X6R1stIFzIL0vuhdqw== X-Received: by 2002:a50:8f66:: with SMTP id 93-v6mr61772464edy.248.1537394694590; Wed, 19 Sep 2018 15:04:54 -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.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 19 Sep 2018 15:04:54 -0700 (PDT) From: Rasmus Villemoes To: Jason Baron , Andrew Morton Cc: linux-kernel@vger.kernel.org, Rasmus Villemoes , netdev@vger.kernel.org Subject: [PATCH 03/22] linux/net.h: use DYNAMIC_DEBUG_BRANCH in net_dbg_ratelimited Date: Thu, 20 Sep 2018 00:04:25 +0200 Message-Id: <20180919220444.23190-4-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: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org net_dbg_ratelimited tests the dynamic debug descriptor the old-fashioned way, and doesn't utilize the static key/jump label implementation on architectures that HAVE_JUMP_LABEL. Use the DYNAMIC_DEBUG_BRANCH which is defined appropriately. Cc: netdev@vger.kernel.org Signed-off-by: Rasmus Villemoes --- include/linux/net.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/net.h b/include/linux/net.h index e0930678c8bf..651fca72286c 100644 --- a/include/linux/net.h +++ b/include/linux/net.h @@ -263,7 +263,7 @@ do { \ #define net_dbg_ratelimited(fmt, ...) \ do { \ DEFINE_DYNAMIC_DEBUG_METADATA(descriptor, fmt); \ - if (unlikely(descriptor.flags & _DPRINTK_FLAGS_PRINT) && \ + if (DYNAMIC_DEBUG_BRANCH(descriptor) && \ net_ratelimit()) \ __dynamic_pr_debug(&descriptor, pr_fmt(fmt), \ ##__VA_ARGS__); \ From patchwork Wed Sep 19 22:04:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rasmus Villemoes X-Patchwork-Id: 971962 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=rasmusvillemoes.dk Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=rasmusvillemoes.dk header.i=@rasmusvillemoes.dk header.b="W0Bg8h21"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 42Fv6h1sfMz9sCV for ; Thu, 20 Sep 2018 08:05:00 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733223AbeITDox (ORCPT ); Wed, 19 Sep 2018 23:44:53 -0400 Received: from mail-ed1-f67.google.com ([209.85.208.67]:37970 "EHLO mail-ed1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733065AbeITDox (ORCPT ); Wed, 19 Sep 2018 23:44:53 -0400 Received: by mail-ed1-f67.google.com with SMTP id h33-v6so6182501edb.5 for ; Wed, 19 Sep 2018 15:04:56 -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=Av/QbXrtGl2sZ3B3dVs/I7MgqzR6B1VGUfMvV4GEX70=; b=W0Bg8h212pEdlh+Awvd3xXpyKeJe0zXT9e2wx/wq/sWYsb/Hw/PSOYyvcvkOevc15k EzyrtBfHR3eY4B6phUcDk6AXvYLHHjLGf4aW4KGF/vlEJ+jU0oG2lcI+lFD1pGIdbcaO WH0ed7+tJFL5RcX/zh3fi4tpWo+EdkQHYE8Ik= 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=Av/QbXrtGl2sZ3B3dVs/I7MgqzR6B1VGUfMvV4GEX70=; b=pPbeqacJuOXZKJ2Mmyed5y9Acnh8ttQnBXmXPxMmFXueWq1D19Gt3sCbYju7Ess5aM 5KSuDQqGzUs6MKc5n3W/alHI2XxR8GkI159XcfWT9qWUl+YYOTDm/E+vdkRdQ8119y2c cV9DK/QDLo0VtCVL+Aozr98R0yD4+rsZV09oW9dI0Ddoo/fNfo7fhGsDeocFSpzKHp/a 6HDzNp0YBb/6qKEYxfS995B2zwnpch7S/NXP7jCUlqnn2Gu72F/xecjTbr5gV044uNXK 0W8AEbOqjt+OqUqrXwmHKiGZbs8EnJm5KPUBh+Oz5eqKUQ3uFCj8HvOdiPeIviDwhP8d T8xg== X-Gm-Message-State: APzg51Cp1r9FIVHgOh989XIbJg+e3e+Xz0286TV9KgXC6zTHU295X10H 9c8S6NT56eZ5CpL30ih6I6Uiwg9ZsSZ9BzEb X-Google-Smtp-Source: ANB0VdaLg4iQlEpV/LrKrfc88JUtvctwrF0ItWQL4EeGW3cDtMBsysuwGqScy4eA85XBXbURb/gGNQ== X-Received: by 2002:a50:b12e:: with SMTP id k43-v6mr61656865edd.269.1537394695579; Wed, 19 Sep 2018 15:04:55 -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.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 19 Sep 2018 15:04:55 -0700 (PDT) From: Rasmus Villemoes To: Jason Baron , Andrew Morton Cc: linux-kernel@vger.kernel.org, Rasmus Villemoes , netdev@vger.kernel.org Subject: [PATCH 04/22] linux/net.h: use unique identifier for each struct _ddebug Date: Thu, 20 Sep 2018 00:04:26 +0200 Message-Id: <20180919220444.23190-5-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: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Changes on x86-64 later in this series require that all struct _ddebug descriptors in a translation unit uses distinct identifiers. Realize that for net_dbg_ratelimited by generating such an identifier via __UNIQUE_ID and pass that to an extra level of macros. No functional change. Cc: netdev@vger.kernel.org Signed-off-by: Rasmus Villemoes --- include/linux/net.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/linux/net.h b/include/linux/net.h index 651fca72286c..397243a25f56 100644 --- a/include/linux/net.h +++ b/include/linux/net.h @@ -260,7 +260,7 @@ do { \ #define net_info_ratelimited(fmt, ...) \ net_ratelimited_function(pr_info, fmt, ##__VA_ARGS__) #if defined(CONFIG_DYNAMIC_DEBUG) -#define net_dbg_ratelimited(fmt, ...) \ +#define _net_dbg_ratelimited(descriptor, fmt, ...) \ do { \ DEFINE_DYNAMIC_DEBUG_METADATA(descriptor, fmt); \ if (DYNAMIC_DEBUG_BRANCH(descriptor) && \ @@ -268,6 +268,8 @@ do { \ __dynamic_pr_debug(&descriptor, pr_fmt(fmt), \ ##__VA_ARGS__); \ } while (0) +#define net_dbg_ratelimited(fmt, ...) \ + _net_dbg_ratelimited(__UNIQUE_ID(ddebug), fmt, ##__VA_ARGS__) #elif defined(DEBUG) #define net_dbg_ratelimited(fmt, ...) \ net_ratelimited_function(pr_debug, fmt, ##__VA_ARGS__)