linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] perf stat: Display iostat headers correctly
@ 2024-08-02  6:58 Yicong Yang
  2024-08-14  9:31 ` Yicong Yang
  2024-08-16 17:34 ` Namhyung Kim
  0 siblings, 2 replies; 4+ messages in thread
From: Yicong Yang @ 2024-08-02  6:58 UTC (permalink / raw)
  To: acme, namhyung, mark.rutland, mingo, peterz, irogers,
	linux-perf-users
  Cc: linuxarm, yangyicong, jonathan.cameron, shameerali.kolothum.thodi,
	hejunhao3, prime.zeng

From: Yicong Yang <yangyicong@hisilicon.com>

Currently we'll only print metric headers for metric leader in
aggregration mode. This will make `perf iostat` header not shown
since it'll aggregrated globally but don't have metric events:
root@ubuntu204:/home/yang/linux/tools/perf# ./perf stat --iostat --timeout 1000
 Performance counter stats for 'system wide':
    port
0000:00                    0                    0                    0                    0
0000:80                    0                    0                    0                    0
[...]

Fix this by excluding the iostat in the check of printing metric
headers. Then we can see the headers:
root@ubuntu204:/home/yang/linux/tools/perf# ./perf stat --iostat --timeout 1000
 Performance counter stats for 'system wide':
    port             Inbound Read(MB)    Inbound Write(MB)    Outbound Read(MB)   Outbound Write(MB)
0000:00                    0                    0                    0                    0
0000:80                    0                    0                    0                    0
[...]

Fixes: 193a9e30207f ("perf stat: Don't display metric header for non-leader uncore events")
Signed-off-by: Yicong Yang <yangyicong@hisilicon.com>
---
 tools/perf/util/stat-display.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/perf/util/stat-display.c b/tools/perf/util/stat-display.c
index c38bcb6f4c78..ea96e4ebad8c 100644
--- a/tools/perf/util/stat-display.c
+++ b/tools/perf/util/stat-display.c
@@ -1237,7 +1237,8 @@ static void print_metric_headers(struct perf_stat_config *config,
 
 	/* Print metrics headers only */
 	evlist__for_each_entry(evlist, counter) {
-		if (config->aggr_mode != AGGR_NONE && counter->metric_leader != counter)
+		if (!config->iostat_run &&
+		    config->aggr_mode != AGGR_NONE && counter->metric_leader != counter)
 			continue;
 
 		os.evsel = counter;
-- 
2.24.0


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

* Re: [PATCH] perf stat: Display iostat headers correctly
  2024-08-02  6:58 [PATCH] perf stat: Display iostat headers correctly Yicong Yang
@ 2024-08-14  9:31 ` Yicong Yang
  2024-08-16 17:34 ` Namhyung Kim
  1 sibling, 0 replies; 4+ messages in thread
From: Yicong Yang @ 2024-08-14  9:31 UTC (permalink / raw)
  To: acme, namhyung, mark.rutland, mingo, peterz, irogers,
	linux-perf-users
  Cc: yangyicong, linuxarm, jonathan.cameron, shameerali.kolothum.thodi,
	hejunhao3, prime.zeng

A gentle ping...

On 2024/8/2 14:58, Yicong Yang wrote:
> From: Yicong Yang <yangyicong@hisilicon.com>
> 
> Currently we'll only print metric headers for metric leader in
> aggregration mode. This will make `perf iostat` header not shown
> since it'll aggregrated globally but don't have metric events:
> root@ubuntu204:/home/yang/linux/tools/perf# ./perf stat --iostat --timeout 1000
>  Performance counter stats for 'system wide':
>     port
> 0000:00                    0                    0                    0                    0
> 0000:80                    0                    0                    0                    0
> [...]
> 
> Fix this by excluding the iostat in the check of printing metric
> headers. Then we can see the headers:
> root@ubuntu204:/home/yang/linux/tools/perf# ./perf stat --iostat --timeout 1000
>  Performance counter stats for 'system wide':
>     port             Inbound Read(MB)    Inbound Write(MB)    Outbound Read(MB)   Outbound Write(MB)
> 0000:00                    0                    0                    0                    0
> 0000:80                    0                    0                    0                    0
> [...]
> 
> Fixes: 193a9e30207f ("perf stat: Don't display metric header for non-leader uncore events")
> Signed-off-by: Yicong Yang <yangyicong@hisilicon.com>
> ---
>  tools/perf/util/stat-display.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/perf/util/stat-display.c b/tools/perf/util/stat-display.c
> index c38bcb6f4c78..ea96e4ebad8c 100644
> --- a/tools/perf/util/stat-display.c
> +++ b/tools/perf/util/stat-display.c
> @@ -1237,7 +1237,8 @@ static void print_metric_headers(struct perf_stat_config *config,
>  
>  	/* Print metrics headers only */
>  	evlist__for_each_entry(evlist, counter) {
> -		if (config->aggr_mode != AGGR_NONE && counter->metric_leader != counter)
> +		if (!config->iostat_run &&
> +		    config->aggr_mode != AGGR_NONE && counter->metric_leader != counter)
>  			continue;
>  
>  		os.evsel = counter;
> 

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

* Re: [PATCH] perf stat: Display iostat headers correctly
  2024-08-02  6:58 [PATCH] perf stat: Display iostat headers correctly Yicong Yang
  2024-08-14  9:31 ` Yicong Yang
@ 2024-08-16 17:34 ` Namhyung Kim
  2024-08-16 22:34   ` Arnaldo Carvalho de Melo
  1 sibling, 1 reply; 4+ messages in thread
From: Namhyung Kim @ 2024-08-16 17:34 UTC (permalink / raw)
  To: Yicong Yang
  Cc: acme, mark.rutland, mingo, peterz, irogers, linux-perf-users,
	linuxarm, yangyicong, jonathan.cameron, shameerali.kolothum.thodi,
	hejunhao3, prime.zeng

On Fri, Aug 02, 2024 at 02:58:00PM +0800, Yicong Yang wrote:
> From: Yicong Yang <yangyicong@hisilicon.com>
> 
> Currently we'll only print metric headers for metric leader in
> aggregration mode. This will make `perf iostat` header not shown
> since it'll aggregrated globally but don't have metric events:
> root@ubuntu204:/home/yang/linux/tools/perf# ./perf stat --iostat --timeout 1000
>  Performance counter stats for 'system wide':
>     port
> 0000:00                    0                    0                    0                    0
> 0000:80                    0                    0                    0                    0
> [...]
> 
> Fix this by excluding the iostat in the check of printing metric
> headers. Then we can see the headers:
> root@ubuntu204:/home/yang/linux/tools/perf# ./perf stat --iostat --timeout 1000
>  Performance counter stats for 'system wide':
>     port             Inbound Read(MB)    Inbound Write(MB)    Outbound Read(MB)   Outbound Write(MB)
> 0000:00                    0                    0                    0                    0
> 0000:80                    0                    0                    0                    0
> [...]
> 
> Fixes: 193a9e30207f ("perf stat: Don't display metric header for non-leader uncore events")
> Signed-off-by: Yicong Yang <yangyicong@hisilicon.com>

Acked-by: Namhyung Kim <namhyung@kernel.org>

Thanks,
Namhyung


> ---
>  tools/perf/util/stat-display.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/perf/util/stat-display.c b/tools/perf/util/stat-display.c
> index c38bcb6f4c78..ea96e4ebad8c 100644
> --- a/tools/perf/util/stat-display.c
> +++ b/tools/perf/util/stat-display.c
> @@ -1237,7 +1237,8 @@ static void print_metric_headers(struct perf_stat_config *config,
>  
>  	/* Print metrics headers only */
>  	evlist__for_each_entry(evlist, counter) {
> -		if (config->aggr_mode != AGGR_NONE && counter->metric_leader != counter)
> +		if (!config->iostat_run &&
> +		    config->aggr_mode != AGGR_NONE && counter->metric_leader != counter)
>  			continue;
>  
>  		os.evsel = counter;
> -- 
> 2.24.0
> 

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

* Re: [PATCH] perf stat: Display iostat headers correctly
  2024-08-16 17:34 ` Namhyung Kim
@ 2024-08-16 22:34   ` Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 4+ messages in thread
From: Arnaldo Carvalho de Melo @ 2024-08-16 22:34 UTC (permalink / raw)
  To: Namhyung Kim
  Cc: Yicong Yang, mark.rutland, mingo, peterz, irogers,
	linux-perf-users, linuxarm, yangyicong, jonathan.cameron,
	shameerali.kolothum.thodi, hejunhao3, prime.zeng

On Fri, Aug 16, 2024 at 10:34:29AM -0700, Namhyung Kim wrote:
> On Fri, Aug 02, 2024 at 02:58:00PM +0800, Yicong Yang wrote:
> > From: Yicong Yang <yangyicong@hisilicon.com>
> > 
> > Currently we'll only print metric headers for metric leader in
> > aggregration mode. This will make `perf iostat` header not shown
> > since it'll aggregrated globally but don't have metric events:
> > root@ubuntu204:/home/yang/linux/tools/perf# ./perf stat --iostat --timeout 1000
> >  Performance counter stats for 'system wide':
> >     port
> > 0000:00                    0                    0                    0                    0
> > 0000:80                    0                    0                    0                    0
> > [...]
> > 
> > Fix this by excluding the iostat in the check of printing metric
> > headers. Then we can see the headers:
> > root@ubuntu204:/home/yang/linux/tools/perf# ./perf stat --iostat --timeout 1000
> >  Performance counter stats for 'system wide':
> >     port             Inbound Read(MB)    Inbound Write(MB)    Outbound Read(MB)   Outbound Write(MB)
> > 0000:00                    0                    0                    0                    0
> > 0000:80                    0                    0                    0                    0
> > [...]
> > 
> > Fixes: 193a9e30207f ("perf stat: Don't display metric header for non-leader uncore events")
> > Signed-off-by: Yicong Yang <yangyicong@hisilicon.com>
> 
> Acked-by: Namhyung Kim <namhyung@kernel.org>

Thanks, applied to perf-tools-next,

- Arnaldo

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

end of thread, other threads:[~2024-08-16 22:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-02  6:58 [PATCH] perf stat: Display iostat headers correctly Yicong Yang
2024-08-14  9:31 ` Yicong Yang
2024-08-16 17:34 ` Namhyung Kim
2024-08-16 22:34   ` Arnaldo Carvalho de Melo

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