From patchwork Fri Feb 10 21:15:50 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: 55587 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1181451wrn; Fri, 10 Feb 2023 13:19:17 -0800 (PST) X-Google-Smtp-Source: AK7set8It4yrzJqjqq1Ycw0Ve7LHyF/kdzje4+NTbvlRC/CD+01sHPmGTmoRDvphoMvYYzOjoZ9M X-Received: by 2002:a50:9e0f:0:b0:4a2:1263:bbab with SMTP id z15-20020a509e0f000000b004a21263bbabmr18755611ede.17.1676063957441; Fri, 10 Feb 2023 13:19:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676063957; cv=none; d=google.com; s=arc-20160816; b=oLbOruu8BjI3p2oe46yrK0la6zILZl6mCJnnqJ10510uQDWMX5zxLEisNjChArng+2 HRWS/Gmv7hFdoGhQAyyE4+N403jwJNo8+ErPs6Zd2YStffm5FRK8j0wwRtGBDzyr330Q UzjDmiZhzNz+G6NOgF5ALKCYVqWTHCyOJONKmWm9wiqloj2wDrk8VHD9e0P8uazX9er8 BBuCPH1893WlqDmtwbTaQy1tG/EhlpNXPVKwy+HONl1E7RQ3lwRAT+lkjaKJzoIjky6B PuvGTtWQhfDk59JJByYCG2U8+l96t2Yk8PEIoxaF7OuUZvSZnfNI6AIK6zLXmkkUseEH aT6Q== 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=z1gm2uHZDO3x8BSiOJ0jeaJz4iOmzsaE5lyAkDJqHg0=; b=HNkUGRXs2n0S0UyQEBom7iHoxcusnCtLhaJlJBSiAEUik+0oCwQOaWNsIMy6NlwOn7 BywgQ6C0u3Hsno7tZSyDjkqcz9WwKxaHYVBlf2Uc1OucPjyB0P60dGlGrp4Pw2EGdG2G DgqD0CKf9T1CPiB2I95sEsvj9cFrJ6RcM/7RDgx/0ObKZap1i6wDIkjWbISzH71MoWaX 1rEyLpT6eToDSAqbKKRYiN0DUN2OIMirH6fxg9D4Xi7aabgx/Nvvu5QOiIlT5/Yu4O+8 XbAmevhUo8tRsAx3ORKFhJ70LzJjFxTRgAdxLITG02K2mrm6uBF8owHJ/GMqQ1R9Fq7N /3PQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=Lpp+lB8h; 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 b3-20020a05640202c300b0049e385155f3si5284313edx.100.2023.02.10.13.18.53; Fri, 10 Feb 2023 13:19:17 -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=Lpp+lB8h; 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 S233179AbjBJVQS (ORCPT + 99 others); Fri, 10 Feb 2023 16:16:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36370 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233454AbjBJVQO (ORCPT ); Fri, 10 Feb 2023 16:16:14 -0500 Received: from out-233.mta0.migadu.com (out-233.mta0.migadu.com [IPv6:2001:41d0:1004:224b::e9]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8AEF175373 for ; Fri, 10 Feb 2023 13:16:12 -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=1676063770; 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=z1gm2uHZDO3x8BSiOJ0jeaJz4iOmzsaE5lyAkDJqHg0=; b=Lpp+lB8htFhm3jM77dYrWl3dcQNjGvQPekyllxMw/5S9HTXcy8zozqt61j4IoOjzYexjNX /RA+b/g0ZhTr1fEhl1rwKYR5Zx1bPii9TPaSk7EW/Ugs3bN1GKdaZhurVbCpfZUbM7A36L V0utwNuGGe4199Y176cZaBlvcdKvq/Y= 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 v2 02/18] lib/stackdepot: use pr_fmt to define message format Date: Fri, 10 Feb 2023 22:15:50 +0100 Message-Id: <3d09db0171a0e92ff3eb0ee74de74558bc9b56c4.1676063693.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?1757480440132150910?= X-GMAIL-MSGID: =?utf-8?q?1757480440132150910?= 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. Reviewed-by: Alexander Potapenko Signed-off-by: Andrey Konovalov --- lib/stackdepot.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/stackdepot.c b/lib/stackdepot.c index 4bfaf3bce619..83787e46a3ab 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; }