From patchwork Mon Jan 30 20:49:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: andrey.konovalov@linux.dev X-Patchwork-Id: 50484 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2395555wrn; Mon, 30 Jan 2023 13:04:13 -0800 (PST) X-Google-Smtp-Source: AK7set/VBElZz79iTIOmdKWEvWxNvcmkV2+GfHM97Ir0D0W3xElVhp68F9UmQwq4H+eZm66Phx1Q X-Received: by 2002:a05:6a21:3286:b0:be:afe7:cde with SMTP id yt6-20020a056a21328600b000beafe70cdemr2523344pzb.12.1675112652753; Mon, 30 Jan 2023 13:04:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675112652; cv=none; d=google.com; s=arc-20160816; b=UK7gCjdYeHrjKDGaDG6fWG2XR3+tk5nNvDOaCTiHg2cDnliIpzcreJHjvsARLMDE43 egBeHWeycnBkdqJyHCXbgoV1MjTo2ykZTyg18m1ExFpwBfc75JsgUj5yogqNjHKHaYM4 bPIfGxnysW172Qn6nNfi/kHbGNoL7oSGWFDSs2VQiFsxr2ffvqLBYOmTXFw6DZYD59cG wmWwNgi0Lz2zmcgau0vBhDidQLjpf2afepqBJvdlFG1vvCbt0EH7WLtZKL9p8N7e7w5u n/mLky2OEzzHVqWzTy37sxY/U/E8+4rP35elgFZjbTQ3G56ahEJPD3FVmuqV7wDmF849 Cwfw== 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 :dkim-signature; bh=l0DgDHv6v1bes9QPJYpLqp7kkvT0kapBOv6TW2IBB/k=; b=Z/cOJaZmNprNHWK9//KruV+tGyjsM0URK9Ll4+RNlnbC5Fa2n7V59MwuAxj6EFr9fp QMyf2Af6hKj+xnJCY+hWNULj12j57nozUSKKtE5NhZfWQHhjyIKfk9+032ccHl/FaT/N gkhugbEpu9jlI21ot5aS/FEbNA5P815kMFQsZYNbAOOlpitCSsYKhqfgrFj+pnL1jmmK QX4nuXpFJ5XNRpxRA8GumrPVygo9nzGQ3z1PuwqrA/R6psLu+w/hY1azfy0FQ0qs7e34 /YEVt/Hb6dtK4SSKAZexpsvM9vUCqzp47sQUf6Wf6KHhRdON83IWVqN8Oz//xnTVG6X7 lL/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=SpOJ60TV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l185-20020a633ec2000000b004ced8a013dbsi16068141pga.127.2023.01.30.13.03.58; Mon, 30 Jan 2023 13:04:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=SpOJ60TV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230250AbjA3U4X (ORCPT + 99 others); Mon, 30 Jan 2023 15:56:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51326 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230185AbjA3U4O (ORCPT ); Mon, 30 Jan 2023 15:56:14 -0500 X-Greylist: delayed 382 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Mon, 30 Jan 2023 12:56:11 PST Received: from out-151.mta1.migadu.com (out-151.mta1.migadu.com [IPv6:2001:41d0:203:375::97]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 46D1842DFD for ; Mon, 30 Jan 2023 12:56:11 -0800 (PST) X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1675111788; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=l0DgDHv6v1bes9QPJYpLqp7kkvT0kapBOv6TW2IBB/k=; b=SpOJ60TVzVtNFGeOaSWoGCVnRntGXp1f0lNFPUS22mPwdXy3FThUKBl7SnU05auY2/luej U9SfMepHYn2N9o3X7GDdHcULipCyR7H9ZY2KmHg7SPMUng4KqZBLC+Iovl8L0HP2Tv7Ojv sy1806UWb20v/N9S8fxWCNto4gVc1H8= From: andrey.konovalov@linux.dev To: Marco Elver , Alexander Potapenko Cc: Andrey Konovalov , Vlastimil Babka , kasan-dev@googlegroups.com, Evgenii Stepanov , Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrey Konovalov Subject: [PATCH 03/18] lib/stackdepot: use pr_fmt to define message format Date: Mon, 30 Jan 2023 21:49:27 +0100 Message-Id: <3600069e0b0b3df602999ec8a2d4fc14fcc56a01.1675111415.git.andreyknvl@google.com> In-Reply-To: References: MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756482924581209723?= X-GMAIL-MSGID: =?utf-8?q?1756482924581209723?= From: Andrey Konovalov Use pr_fmt to define the format for printing stack depot messages instead of duplicating the "Stack Depot" prefix in each message. Signed-off-by: Andrey Konovalov Reviewed-by: Alexander Potapenko --- lib/stackdepot.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/stackdepot.c b/lib/stackdepot.c index 23d2a68a587b..90c4dd48d75e 100644 --- a/lib/stackdepot.c +++ b/lib/stackdepot.c @@ -19,6 +19,8 @@ * Based on code by Dmitry Chernenkov. */ +#define pr_fmt(fmt) "stackdepot: " fmt + #include #include #include @@ -98,7 +100,7 @@ static int __init is_stack_depot_disabled(char *str) ret = kstrtobool(str, &stack_depot_disable); if (!ret && stack_depot_disable) { - pr_info("Stack Depot is disabled\n"); + pr_info("disabled\n"); stack_table = NULL; } return 0; @@ -142,7 +144,7 @@ int __init stack_depot_early_init(void) 1UL << STACK_HASH_ORDER_MAX); if (!stack_table) { - pr_err("Stack Depot hash table allocation failed, disabling\n"); + pr_err("hash table allocation failed, disabling\n"); stack_depot_disable = true; return -ENOMEM; } @@ -177,11 +179,11 @@ int stack_depot_init(void) if (entries > 1UL << STACK_HASH_ORDER_MAX) entries = 1UL << STACK_HASH_ORDER_MAX; - pr_info("Stack Depot allocating hash table of %lu entries with kvcalloc\n", + pr_info("allocating hash table of %lu entries with kvcalloc\n", entries); stack_table = kvcalloc(entries, sizeof(struct stack_record *), GFP_KERNEL); if (!stack_table) { - pr_err("Stack Depot hash table allocation failed, disabling\n"); + pr_err("hash table allocation failed, disabling\n"); stack_depot_disable = true; ret = -ENOMEM; }