Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2066683rwd; Tue, 13 Jun 2023 19:37:25 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ51yt4Yx78+sNlM2flioDm1lmQ8UFYRFgMNoRibnbpAL81zWxdZQ3W/tMFqUnPZPzZzYlyX X-Received: by 2002:a17:90a:9106:b0:25c:1cf4:2be6 with SMTP id k6-20020a17090a910600b0025c1cf42be6mr325330pjo.35.1686710244948; Tue, 13 Jun 2023 19:37:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686710244; cv=none; d=google.com; s=arc-20160816; b=TBWhc1Hak4dt9P7M6OUmCyqSIBLlS+gZ2VuQ+AADPS8p9s0oxnprSvMzC6xFi1faD4 TlJ2LmAafhFeCBAF7tWl1V50g4+v1YhEbN46jQVZj5OtTnFvA3IWu5Jbk1haldO4q4nW ZjazmyOONxkfV6irfMTP5J2TgZnvdUrx627EDahfEg7wSNB7deBKPy+tFysNQ52TSC7g et+PA958EHM/8B3w19MZyi+d0LveM73JJctpcENsJWlZkH4paoOMp+OFFMiwhAw1iFnZ v4ARBid/bkD59DgMuIdYp7Vml/F5bWMN+BtVJox4JiKCV5Mf4mMYNxU+MQMxGcUJWta/ h31A== 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 :message-id:date:subject:cc:to:from; bh=4H6TgzoxRXLSvVIL/bWCsBE8M5hIl/lFFa3ihcwuqqc=; b=WF5ZfvEO/90evOx4wFmiNZZjL1UswHOdFtIRo1zoqIu6KdKj1KkyFb3Zf8f7RxCkeU JrgPHjVUXREOwiHd2tUht/7wc5kVChm93Rs83rgccdGVUpEL/RIHDtvNeLFRCor7zaQS 7eYWcNCFOh8VXvB46bS/L1aEiE85gRQnXYrb1yZxuH4337r/yYSRX2eP0D9MHNFzDtg3 s2WKUf041wp47g9Gh5x3PD5JR0j3mrJp/eXLcxZvSOna3UbPMaSa7lW7EC3pBrTq9BFZ YZHU2oC09bI6LbjPszGGGOQgoel4BSmvz1yaNctjxAUb5O1B49uhEMpXLtkzKOqUPwbm 8Sbw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lb3-20020a17090b4a4300b002586dbee167si10311647pjb.170.2023.06.13.19.37.12; Tue, 13 Jun 2023 19:37:24 -0700 (PDT) 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; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242131AbjFNCQy (ORCPT + 99 others); Tue, 13 Jun 2023 22:16:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57852 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237417AbjFNCQx (ORCPT ); Tue, 13 Jun 2023 22:16:53 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 23E6E19B6; Tue, 13 Jun 2023 19:16:51 -0700 (PDT) Received: from kwepemm600003.china.huawei.com (unknown [172.30.72.55]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4Qgpv5727NzTl1c; Wed, 14 Jun 2023 10:16:17 +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; Wed, 14 Jun 2023 10:16:48 +0800 From: Yang Jihong To: , , , , , , , , , , , CC: Subject: [PATCH v3] perf stat: Add missing newline in pr_err messages Date: Wed, 14 Jun 2023 02:15:05 +0000 Message-ID: <20230614021505.59856-1-yangjihong1@huawei.com> X-Mailer: git-send-email 2.30.GIT MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.67.174.95] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To kwepemm600003.china.huawei.com (7.193.23.202) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 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 Acked-by: Ian Rogers Reviewed-by: James Clark --- Changes since v2: - Add Acked-by Ian Rogers - Add Reviewed-by James Clark - Format patch based on the perf-tools-next Changes since v1: - Correct commit title to `pr_err` 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 fc615bdeed4f..692de772f8ae 100644 --- a/tools/perf/builtin-stat.c +++ b/tools/perf/builtin-stat.c @@ -1594,7 +1594,7 @@ static int perf_stat_init_aggr_mode(void) stat_config.aggr_map = cpu_aggr_map__new(evsel_list->core.user_requested_cpus, get_id, /*data=*/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 = aggr_mode__get_id(stat_config.aggr_mode); @@ -1910,7 +1910,7 @@ static int perf_stat_init_aggr_mode_file(struct perf_stat *st) stat_config.aggr_map = cpu_aggr_map__new(evsel_list->core.user_requested_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 = aggr_mode__get_id_file(stat_config.aggr_mode); @@ -2050,7 +2050,7 @@ static int add_default_attributes(void) * on an architecture test for such a metric name. */ if (!metricgroup__has_metric(pmu, "transaction")) { - pr_err("Missing transaction metrics"); + pr_err("Missing transaction metrics\n"); return -1; } return metricgroup__parse_groups(evsel_list, pmu, "transaction", @@ -2066,7 +2066,7 @@ static int add_default_attributes(void) int smi; 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; } @@ -2079,7 +2079,7 @@ static int add_default_attributes(void) } if (!metricgroup__has_metric(pmu, "smi")) { - pr_err("Missing smi metrics"); + pr_err("Missing smi metrics\n"); return -1; } @@ -2104,7 +2104,7 @@ static int add_default_attributes(void) 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) { -- 2.30.GIT