All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] perf stat: Add missing newline in pr_err messages
@ 2023-06-10  9:44 Yang Jihong
  2023-06-12  8:31 ` James Clark
  2023-06-12 18:55 ` Arnaldo Carvalho de Melo
  0 siblings, 2 replies; 6+ messages in thread
From: Yang Jihong @ 2023-06-10  9:44 UTC (permalink / raw)
  To: peterz, mingo, acme, mark.rutland, alexander.shishkin, jolsa,
	namhyung, irogers, adrian.hunter, linux-perf-users, linux-kernel
  Cc: yangjihong1

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

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) {
-- 
2.30.GIT


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] perf stat: Add missing newline in pr_err messages
  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
  2023-06-12 18:55 ` Arnaldo Carvalho de Melo
  1 sibling, 0 replies; 6+ messages in thread
From: James Clark @ 2023-06-12  8:31 UTC (permalink / raw)
  To: Yang Jihong
  Cc: peterz, mingo, acme, mark.rutland, alexander.shishkin, jolsa,
	namhyung, irogers, adrian.hunter, linux-perf-users, linux-kernel



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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] perf stat: Add missing newline in pr_err messages
  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
@ 2023-06-12 18:55 ` Arnaldo Carvalho de Melo
  2023-06-13  1:32   ` Yang Jihong
  1 sibling, 1 reply; 6+ messages in thread
From: Arnaldo Carvalho de Melo @ 2023-06-12 18:55 UTC (permalink / raw)
  To: Yang Jihong
  Cc: peterz, mingo, mark.rutland, alexander.shishkin, jolsa, namhyung,
	irogers, adrian.hunter, linux-perf-users, linux-kernel

Em Sat, Jun 10, 2023 at 09:44:41AM +0000, Yang Jihong escreveu:
> 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.

Wait a bit till I push what I had to perf-tools-next, as it is not
applying right now:

⬢[acme@toolbox perf-tools-next]$ patch -p1 < ~/wb/1.patch
patching file tools/perf/builtin-stat.c
Hunk #1 succeeded at 1594 (offset 196 lines).
Hunk #2 succeeded at 1910 (offset 260 lines).
Hunk #3 FAILED at 1789.
Hunk #4 succeeded at 2066 (offset 261 lines).
Hunk #5 FAILED at 1818.
Hunk #6 succeeded at 2104 (offset 261 lines).
2 out of 6 hunks FAILED -- saving rejects to file tools/perf/builtin-stat.c.rej
⬢[acme@toolbox perf-tools-next]$
 
> Signed-off-by: Yang Jihong <yangjihong1@huawei.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) {
> -- 
> 2.30.GIT
> 

-- 

- Arnaldo

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] perf stat: Add missing newline in pr_err messages
  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
  0 siblings, 1 reply; 6+ messages in thread
From: Yang Jihong @ 2023-06-13  1:32 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: peterz, mingo, mark.rutland, alexander.shishkin, jolsa, namhyung,
	irogers, adrian.hunter, linux-perf-users, linux-kernel

Hello,

On 2023/6/13 2:55, Arnaldo Carvalho de Melo wrote:
> Em Sat, Jun 10, 2023 at 09:44:41AM +0000, Yang Jihong escreveu:
>> 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.
> 
> Wait a bit till I push what I had to perf-tools-next, as it is not
> applying right now:
OK, I'm doing the patch based on the mainline, and if I need to do it 
based on the perf-tools-next branch, I'll reissue it.

Thanks,
Yang.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] perf stat: Add missing newline in pr_err messages
  2023-06-13  1:32   ` Yang Jihong
@ 2023-06-13 19:45     ` Arnaldo Carvalho de Melo
  2023-06-14  2:12       ` Yang Jihong
  0 siblings, 1 reply; 6+ messages in thread
From: Arnaldo Carvalho de Melo @ 2023-06-13 19:45 UTC (permalink / raw)
  To: Yang Jihong
  Cc: peterz, mingo, mark.rutland, alexander.shishkin, jolsa, namhyung,
	irogers, adrian.hunter, linux-perf-users, linux-kernel

Em Tue, Jun 13, 2023 at 09:32:05AM +0800, Yang Jihong escreveu:
> On 2023/6/13 2:55, Arnaldo Carvalho de Melo wrote:
> > Em Sat, Jun 10, 2023 at 09:44:41AM +0000, Yang Jihong escreveu:
> > > 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.
> > 
> > Wait a bit till I push what I had to perf-tools-next, as it is not
> > applying right now:
> OK, I'm doing the patch based on the mainline, and if I need to do it based
> on the perf-tools-next branch, I'll reissue it.

For patches for the currente perf development cycle the perf-tools-next
branch of:

git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git

Should be used.

Hopefully soon we will transition to:

git://git.kernel.org/pub/scm/linux/kernel/git/perf-tools/perf-tools-next.git

And also:

git://git.kernel.org/pub/scm/linux/kernel/git/perf-tools/perf-tools.git

For fixes geared to the current merge window, when we are accepting just
fixes.

- Arnaldo

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] perf stat: Add missing newline in pr_err messages
  2023-06-13 19:45     ` Arnaldo Carvalho de Melo
@ 2023-06-14  2:12       ` Yang Jihong
  0 siblings, 0 replies; 6+ messages in thread
From: Yang Jihong @ 2023-06-14  2:12 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: peterz, mingo, mark.rutland, alexander.shishkin, jolsa, namhyung,
	irogers, adrian.hunter, linux-perf-users, linux-kernel

Hello,

On 2023/6/14 3:45, Arnaldo Carvalho de Melo wrote:
> Em Tue, Jun 13, 2023 at 09:32:05AM +0800, Yang Jihong escreveu:
>> On 2023/6/13 2:55, Arnaldo Carvalho de Melo wrote:
>>> Em Sat, Jun 10, 2023 at 09:44:41AM +0000, Yang Jihong escreveu:
>>>> 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.
>>>
>>> Wait a bit till I push what I had to perf-tools-next, as it is not
>>> applying right now:
>> OK, I'm doing the patch based on the mainline, and if I need to do it based
>> on the perf-tools-next branch, I'll reissue it.
> 
> For patches for the currente perf development cycle the perf-tools-next
> branch of:
> 
> git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git
> 
> Should be used.
> 
> Hopefully soon we will transition to:
> 
> git://git.kernel.org/pub/scm/linux/kernel/git/perf-tools/perf-tools-next.git
> 
> And also:
> 
> git://git.kernel.org/pub/scm/linux/kernel/git/perf-tools/perf-tools.git
> 
> For fixes geared to the current merge window, when we are accepting just
> fixes.
> 

Thanks for the guidance, I'll resend the patch based on the 
perf-tools-next branch.

Thanks,
Yang.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-06-14  2:12 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.