From patchwork Tue Jun 9 10:46:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 217910 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9DCB0C433DF for ; Tue, 9 Jun 2020 10:49:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 76A49207C3 for ; Tue, 9 Jun 2020 10:49:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="q35TGCGg" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728484AbgFIKtg (ORCPT ); Tue, 9 Jun 2020 06:49:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60782 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728899AbgFIKru (ORCPT ); Tue, 9 Jun 2020 06:47:50 -0400 Received: from mail-ej1-x643.google.com (mail-ej1-x643.google.com [IPv6:2a00:1450:4864:20::643]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2500BC008636 for ; Tue, 9 Jun 2020 03:47:43 -0700 (PDT) Received: by mail-ej1-x643.google.com with SMTP id gl26so21803979ejb.11 for ; Tue, 09 Jun 2020 03:47:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=nJBKYN0yMS8AJgBotdxC1qOHMAr254b0bdL2BOSVBX8=; b=q35TGCGg2mkkEjc2wKlEhVaWy46yXIz+7jdW6N6OkmJb73py5fZiUzxTInYQq0bo+F D97pelWumzAAEdcO8aFTs9/xmUjvxBzF5dgRrVlNpV0QPs4BmirmqiXT60dogulqVqDk /2/8mlHTtSWjanvIyzfTh11muRWkGWkVC1kL+s9b3aXLnqcsYKp4KBrqOK4Gd54yPPet n8MSEc59ajB3s538tDFCCfQD/bylg4wisxrZJMp9ApiHtzVsi+QMSeyoo0xeNqwe8zhv TTgpCcwVcQ1EuY5KZIhARuAFN4xdFt8NdIM8OlX4WRiuMtUaKoYHy93CvXg2HxkKZOv8 12mg== 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=nJBKYN0yMS8AJgBotdxC1qOHMAr254b0bdL2BOSVBX8=; b=lKoK9KDOeAalsvw5EkhQPMRmrUgv6KPA5HG3LOQk8BGyT5npcHkMUpEuE88pbAeT+5 fK67HssFRmCmKSlndKTS0RpwViXVJLXuA6WsWplWO4N02jMq8UaWm0JiUxGcMiHfjfG9 8NQ5dBx5/wbFtbxUW76/bL6Safbk8pT0T1ZPivH767IJO4rFK/uAk0SmzALA7N6ez/5F 7HXwxWFmV5+1G4ln8eNj0CXx7s1vDkHZaOBc6bN+NnXBZI4zFcuVkblsBDccGqT2MqBo /e3pxkQDwN+c+RBbcNxRPjzxXPeAZpl5Yb87Iu7wGVpmaGIhvVTH3vMkQjo21fA9D1fW /5pw== X-Gm-Message-State: AOAM531BIN57U7qgMtmqG+0R56agKsw53ZugGMeNj5kd0t03QJUp/nR6 YbOLzxIHzjBUx5HVfv4G04PXbg== X-Google-Smtp-Source: ABdhPJwbs89Sxz204nqQDsKgXCoF+iaDYcP3btNQRBahLuS6eOL/DHBbG2RDImrJGYxnwGfYKSDVQg== X-Received: by 2002:a17:906:e247:: with SMTP id gq7mr24263420ejb.107.1591699661849; Tue, 09 Jun 2020 03:47:41 -0700 (PDT) Received: from localhost.localdomain (hst-221-69.medicom.bg. [84.238.221.69]) by smtp.gmail.com with ESMTPSA id qt19sm12267763ejb.14.2020.06.09.03.47.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jun 2020 03:47:41 -0700 (PDT) From: Stanimir Varbanov To: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-acpi@vger.kernel.org, netdev@vger.kernel.org Cc: Joe Perches , Greg Kroah-Hartman , Jason Baron , Stanimir Varbanov Subject: [PATCH v3 4/7] printk: Add pr_debug_level macro over dynamic one Date: Tue, 9 Jun 2020 13:46:01 +0300 Message-Id: <20200609104604.1594-5-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200609104604.1594-1-stanimir.varbanov@linaro.org> References: <20200609104604.1594-1-stanimir.varbanov@linaro.org> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Introduce new pr_debug_level macro over dynamic_debug level one to allow dynamic debugging to show only important messages. Signed-off-by: Stanimir Varbanov --- include/linux/printk.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/linux/printk.h b/include/linux/printk.h index ceea84aa705b..2a6eca56010f 100644 --- a/include/linux/printk.h +++ b/include/linux/printk.h @@ -416,12 +416,18 @@ extern int kptr_restrict; */ #define pr_debug(fmt, ...) \ dynamic_pr_debug(fmt, ##__VA_ARGS__) +#define pr_debug_level(lvl, fmt, ...) \ + dynamic_pr_debug_level(lvl, fmt, ##__VA_ARGS__) #elif defined(DEBUG) #define pr_debug(fmt, ...) \ printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) +#define pr_debug_level(lvl, fmt, ...) \ + printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) #else #define pr_debug(fmt, ...) \ no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) +#define pr_debug_level(lvl, fmt, ...) \ + no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) #endif /*