From nobody Sun Feb 8 13:17:20 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 43FF4C77B7A for ; Sat, 10 Jun 2023 09:42:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232004AbjFJJmP (ORCPT ); Sat, 10 Jun 2023 05:42:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39680 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229649AbjFJJmN (ORCPT ); Sat, 10 Jun 2023 05:42:13 -0400 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1D6F32D41; Sat, 10 Jun 2023 02:42:10 -0700 (PDT) Received: from kwepemm600003.china.huawei.com (unknown [172.30.72.55]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4QdXxH0TdVzLmjK; Sat, 10 Jun 2023 17:40:19 +0800 (CST) Received: from localhost.localdomain (10.67.174.95) by kwepemm600003.china.huawei.com (7.193.23.202) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Sat, 10 Jun 2023 17:42:04 +0800 From: Yang Jihong To: , , , , , , , , , , CC: Subject: [PATCH] perf stat: Add missing newline in pr_error messages Date: Sat, 10 Jun 2023 09:40:26 +0000 Message-ID: <20230610094026.220687-1-yangjihong1@huawei.com> X-Mailer: git-send-email 2.30.GIT MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.67.174.95] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To kwepemm600003.china.huawei.com (7.193.23.202) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" The newline is missing for error messages in add_default_attributes() Before: # perf stat --topdown Topdown requested but the topdown metric groups aren't present. (See perf list the metric groups have names like TopdownL1)# After: # perf stat --topdown Topdown requested but the topdown metric groups aren't present. (See perf list the metric groups have names like TopdownL1) # In addition, perf_stat_init_aggr_mode() and perf_stat_init_aggr_mode_file() have the same problem, fixed by the way. Signed-off-by: Yang Jihong --- tools/perf/builtin-stat.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c index b9ad32f21e57..78644ae538c4 100644 --- a/tools/perf/builtin-stat.c +++ b/tools/perf/builtin-stat.c @@ -1398,7 +1398,7 @@ static int perf_stat_init_aggr_mode(void) stat_config.aggr_map =3D cpu_aggr_map__new(evsel_list->core.user_request= ed_cpus, get_id, /*data=3D*/NULL, needs_sort); if (!stat_config.aggr_map) { - pr_err("cannot build %s map", aggr_mode__string[stat_config.aggr_mode]); + pr_err("cannot build %s map\n", aggr_mode__string[stat_config.aggr_mode= ]); return -1; } stat_config.aggr_get_id =3D aggr_mode__get_id(stat_config.aggr_mode); @@ -1650,7 +1650,7 @@ static int perf_stat_init_aggr_mode_file(struct perf_= stat *st) stat_config.aggr_map =3D cpu_aggr_map__new(evsel_list->core.user_requeste= d_cpus, get_id, env, needs_sort); if (!stat_config.aggr_map) { - pr_err("cannot build %s map", aggr_mode__string[stat_config.aggr_mode]); + pr_err("cannot build %s map\n", aggr_mode__string[stat_config.aggr_mode]= ); return -1; } stat_config.aggr_get_id =3D aggr_mode__get_id_file(stat_config.aggr_mode); @@ -1789,7 +1789,7 @@ static int add_default_attributes(void) * on an architecture test for such a metric name. */ if (!metricgroup__has_metric("transaction")) { - pr_err("Missing transaction metrics"); + pr_err("Missing transaction metrics\n"); return -1; } return metricgroup__parse_groups(evsel_list, "transaction", @@ -1805,7 +1805,7 @@ static int add_default_attributes(void) int smi; =20 if (sysfs__read_int(FREEZE_ON_SMI_PATH, &smi) < 0) { - pr_err("freeze_on_smi is not supported."); + pr_err("freeze_on_smi is not supported.\n"); return -1; } =20 @@ -1818,7 +1818,7 @@ static int add_default_attributes(void) } =20 if (!metricgroup__has_metric("smi")) { - pr_err("Missing smi metrics"); + pr_err("Missing smi metrics\n"); return -1; } =20 @@ -1843,7 +1843,7 @@ static int add_default_attributes(void) =20 if (!max_level) { pr_err("Topdown requested but the topdown metric groups aren't present.= \n" - "(See perf list the metric groups have names like TopdownL1)"); + "(See perf list the metric groups have names like TopdownL1)\n"); return -1; } if (stat_config.topdown_level > max_level) { --=20 2.30.GIT