linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: James Clark <james.clark@arm.com>
To: Yang Jihong <yangjihong1@huawei.com>
Cc: peterz@infradead.org, mingo@redhat.com, acme@kernel.org,
	mark.rutland@arm.com, alexander.shishkin@linux.intel.com,
	jolsa@kernel.org, namhyung@kernel.org, irogers@google.com,
	adrian.hunter@intel.com, linux-perf-users@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] perf stat: Add missing newline in pr_err messages
Date: Mon, 12 Jun 2023 09:31:10 +0100	[thread overview]
Message-ID: <441ba0b3-c942-5fa9-f6e6-bd3da559c65b@arm.com> (raw)
In-Reply-To: <20230610094441.221525-1-yangjihong1@huawei.com>



On 10/06/2023 10:44, Yang Jihong wrote:
> 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 <yangjihong1@huawei.com>

Reviewed-by: James Clark <james.clark@arm.com>

> ---
> 
> 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 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) {

  reply	other threads:[~2023-06-12  8:32 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-10  9:44 [PATCH v2] perf stat: Add missing newline in pr_err messages Yang Jihong
2023-06-12  8:31 ` James Clark [this message]
2023-06-12 18:55 ` Arnaldo Carvalho de Melo
2023-06-13  1:32   ` Yang Jihong
2023-06-13 19:45     ` Arnaldo Carvalho de Melo
2023-06-14  2:12       ` Yang Jihong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=441ba0b3-c942-5fa9-f6e6-bd3da559c65b@arm.com \
    --to=james.clark@arm.com \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=irogers@google.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=yangjihong1@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).