From patchwork Sat Jun 10 09:40:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Jihong X-Patchwork-Id: 105924 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp1452181vqr; Sat, 10 Jun 2023 03:05:40 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6df+di2i+WLGWbMIUcRSoYBSxhWag1MDSp41PfIRQ6OAvvcI0XM1SwNAEpakn3k8W2NsLX X-Received: by 2002:a05:6a00:134f:b0:651:3e9d:2a05 with SMTP id k15-20020a056a00134f00b006513e9d2a05mr4399568pfu.19.1686391540374; Sat, 10 Jun 2023 03:05:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686391540; cv=none; d=google.com; s=arc-20160816; b=dQv0hCdup4UYChXXZq6s1+nAPNADRby0ygHkcM5a3TZaCaZ3YwjrUz197frRMCvgMj rzKiXaS65SEINH+ILdBCRs54U/vaUv7TmBK22UHiNdwh6bjohn8z931N0sCl+1J9T3w8 XXcgEcYa566LKYmw/XKEJBtZiTcP/7GnHQ7tlvB46eUgTfUQ1WKWRO/Hcxzdnh/G/n8o t7WsBBQsrqO12UldqX4lUEEqNeMDn+RcsfYye7EW+sKvssgDg/OP/SZ+kO9JG7aprBR3 4hP3oTuBmrsea+9k93IFwpLEnDc1RNjDOSPFwA1AQXvq7H+SP4p8CcCKwhccSjp761M1 jmug== 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=riSs0kS/h+xs9+6whyQptoeL1que3+gTwoHPPRMtKww=; b=yjsJBz7iugFlILHXVgxgif/wzYHTc7HqKHdfXjEkSMEFVNBPJPvzcP8Kdfb0kBdxiN llN4oU0h7sx8zVW+5yF02uZ6t8o5I8FnWU2YHIZCOX2is7n4PNukdBkWZSXozDrsPTmX 3Bgiil2Rl7oE9DHxTfUgRgpP1bkJHRGkUuTiXA14x6E9jqq7dBy4wtghmS1IgjXg7+QU z7wIwEVQm8HG53JW7i13ihkP4J8JF6WE7xYEFF28E8g3EKq0sGoaiQogTy+wL+oBL4nN nkswiqGF1yrL7W4ypE0smwzq4S6JSegU2RyFdUCgK/LY9pm9PcbnlZRcpZOur2Ng56eO Lz9Q== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q188-20020a632ac5000000b0053fc9f253basi3872712pgq.403.2023.06.10.03.05.28; Sat, 10 Jun 2023 03:05:40 -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 S231965AbjFJJmP (ORCPT + 99 others); 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 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 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768309696130502379?= X-GMAIL-MSGID: =?utf-8?q?1768309696130502379?= 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 = 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); @@ -1650,7 +1650,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); @@ -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; 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; } @@ -1818,7 +1818,7 @@ static int add_default_attributes(void) } if (!metricgroup__has_metric("smi")) { - pr_err("Missing smi metrics"); + pr_err("Missing smi metrics\n"); return -1; } @@ -1843,7 +1843,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) {