Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp3357262pxt; Tue, 10 Aug 2021 01:27:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzEhDTCO8pRW9PHDlLGRluiT7dBT4NAtRDSlfaQv/tMi5UDhz5hDGThA1iNmqtBSUsPrs9R X-Received: by 2002:a92:d3c7:: with SMTP id c7mr405206ilh.59.1628584075859; Tue, 10 Aug 2021 01:27:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628584075; cv=none; d=google.com; s=arc-20160816; b=XOAOqAt5VH3EW0xGvN2RftzjknF9rWs1ezOBVvxDDf9zsVWTpi0TZyRb6wR2FEIiuU H408Tp9+9fXk8FUWYTbyHLB7YMIl9q8lMZqRNIk1KGs2XBI1p+DAwWnrSvz+0wokqMi1 r5cS+zvv701zklM4pVJLstX5WNwZbjgfOYrrIH3XCg130t29FRZMvy/0d4N2FeqMy8xl lVviVtTzwUHI7gJ89c3WVIV16hIcU8XmfFHT/EITXXCJbtn0ejZTp21pNBfg7kEY5ube CFdGbuYKFd3OPltECDONM8NtfY59Uae/W4OEdkyIi2Os1RQFT2vnMmbD9pDPyfPCUPyW TnQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=BW62UdyAeP6Hxu4FI3jN0xK38DlYeFTwDBp1OLeZUcU=; b=eNO6YrciVXN0wuMe4TfPrc7kJf5rhUZpahQciGKxDsn6H65qzYvAxFE74RxX4Vzx33 Uof61BHeesYWoy1SmO9F1umr7NuIDszXnXGH8f97Ag7R0LWgA+M5dQIFXIwnOx18y51w 3D++sPHljKaxDPFgPi92WKQBaGX2jxmZSv88fTNC72Sinqp6t7Rdf3Si/FGRZVGeecac 64iWKH+pUCfZd6uDg8bTGiLiT8QC3K938V+VC1J04vh/GSleNSV9ayuCveNnjNLBh0rP yFnmbSB1vI1Jd9Qe9LWwKfprarkB2/UTve8L2gtdI44xGN1OGgHcXc7F3t2+g2o7ncGf q2kA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d134si19133307iof.45.2021.08.10.01.27.43; Tue, 10 Aug 2021 01:27:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236661AbhHJFQb (ORCPT + 99 others); Tue, 10 Aug 2021 01:16:31 -0400 Received: from mail-pl1-f179.google.com ([209.85.214.179]:37671 "EHLO mail-pl1-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237545AbhHJFQa (ORCPT ); Tue, 10 Aug 2021 01:16:30 -0400 Received: by mail-pl1-f179.google.com with SMTP id j3so19404418plx.4; Mon, 09 Aug 2021 22:16:08 -0700 (PDT) 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=BW62UdyAeP6Hxu4FI3jN0xK38DlYeFTwDBp1OLeZUcU=; b=n1bq4LB5F29B0vBq6RFLWoHxMaCh7WtpG/8dNdccqONOMXAACBf15rx1TqnYAKnVrd myTrYlaV8axEfNHhht9JIDvWdPxEQd8cDrVLgN+LvdTFNEskZcCekJ1nDry/aXZWWmx9 JRtkUIh08D84zZEdjdX02wL2aSUnYZdRYX84H7F7KTr0ZreNEoDrKhx2iYJVGwvqdXNl p/2Xm/whumi2E/y7EdD4xc8vJMLHqoOzFmL+4Ni8d1J/lDZTSJahGb1AaGb+WW7nehit L3npuiGqHhN7LpfmByhiC8yhSDnjciwNeehO997VijxiYb2Au2sIv3TAqU6efDAn0lZ6 NvbA== X-Gm-Message-State: AOAM531ZnrPppHRhldECxPw+yLuopZcoNrfy71djIAwkhYCEPG5Mk8Ca +4wGa/ru2c0RQuL4FdK+H7M= X-Received: by 2002:aa7:8503:0:b029:3bb:6253:345d with SMTP id v3-20020aa785030000b02903bb6253345dmr21079658pfn.35.1628572568306; Mon, 09 Aug 2021 22:16:08 -0700 (PDT) Received: from localhost ([191.96.121.128]) by smtp.gmail.com with ESMTPSA id b3sm22117996pfi.179.2021.08.09.22.16.06 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 09 Aug 2021 22:16:07 -0700 (PDT) From: Luis Chamberlain To: lucas.demarchi@intel.com, linux-modules@vger.kernel.org Cc: live-patching@vger.kernel.org, fstests@vger.kernel.org, linux-block@vger.kernel.org, hare@suse.de, dgilbert@interlog.com, jeyu@kernel.org, osandov@fb.com, linux-kernel@vger.kernel.org, Luis Chamberlain Subject: [PATCH v2 1/3] libkmod: add a library notice log level print Date: Mon, 9 Aug 2021 22:16:00 -0700 Message-Id: <20210810051602.3067384-2-mcgrof@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210810051602.3067384-1-mcgrof@kernel.org> References: <20210810051602.3067384-1-mcgrof@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When you use pass the -v argument to modprobe we bump the log level from the default modprobe log level of LOG_WARNING (4) to LOG_NOTICE (5), however the library only has avaiable to print: #define DBG(ctx, arg...) kmod_log_cond(ctx, LOG_DEBUG, ## arg) #define INFO(ctx, arg...) kmod_log_cond(ctx, LOG_INFO, ## arg) #define ERR(ctx, arg...) kmod_log_cond(ctx, LOG_ERR, ## arg) LOG_INFO (6) however is too high of a level for it to be effective at printing anything when modprobe -v is passed. And so the only way in which modprobe -v can trigger the library to print a verbose message is to use ERR() but that always prints something and we don't want that in some situations. We need to add a new log level macro which uses LOG_NOTICE (5) for a "normal but significant condition" which users and developers can use to look underneath the hood to confirm if a situation is happening. Signed-off-by: Luis Chamberlain --- libkmod/libkmod-internal.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libkmod/libkmod-internal.h b/libkmod/libkmod-internal.h index 398af9c..2e5e1bc 100644 --- a/libkmod/libkmod-internal.h +++ b/libkmod/libkmod-internal.h @@ -25,10 +25,12 @@ static _always_inline_ _printf_format_(2, 3) void # else # define DBG(ctx, arg...) kmod_log_null(ctx, ## arg) # endif +# define NOTICE(ctx, arg...) kmod_log_cond(ctx, LOG_NOTICE, ## arg) # define INFO(ctx, arg...) kmod_log_cond(ctx, LOG_INFO, ## arg) # define ERR(ctx, arg...) kmod_log_cond(ctx, LOG_ERR, ## arg) #else # define DBG(ctx, arg...) kmod_log_null(ctx, ## arg) +# define NOTICE(ctx, arg...) kmod_log_cond(ctx, LOG_NOTICE, ## arg) # define INFO(ctx, arg...) kmod_log_null(ctx, ## arg) # define ERR(ctx, arg...) kmod_log_null(ctx, ## arg) #endif -- 2.30.2