linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] perf c2c: Display proper cpu count in nodes column
@ 2019-08-20 14:02 Jiri Olsa
  2019-08-20 14:16 ` Arnaldo Carvalho de Melo
  2019-09-02  8:16 ` [tip: perf/core] " tip-bot2 for Jiri Olsa
  0 siblings, 2 replies; 4+ messages in thread
From: Jiri Olsa @ 2019-08-20 14:02 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Joe Mario, lkml, Ingo Molnar, Namhyung Kim, Alexander Shishkin,
	Peter Zijlstra, Michael Petlan

There's wrong bitmap considered when checking
for cpu count of specific node.

We do the needed computation for 'set' variable,
but at the end we use the 'c2c_he->cpuset' weight,
which shows misleading numbers.

Reported-by: Joe Mario <jmario@redhat.com>
Link: https://lkml.kernel.org/n/tip-9wvrv74n7d4nbgztr74isv5j@git.kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
 tools/perf/builtin-c2c.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/builtin-c2c.c b/tools/perf/builtin-c2c.c
index f0aae6e13a33..9240c6bf70f5 100644
--- a/tools/perf/builtin-c2c.c
+++ b/tools/perf/builtin-c2c.c
@@ -1106,7 +1106,7 @@ node_entry(struct perf_hpp_fmt *fmt __maybe_unused, struct perf_hpp *hpp,
 			break;
 		case 1:
 		{
-			int num = bitmap_weight(c2c_he->cpuset, c2c.cpus_cnt);
+			int num = bitmap_weight(set, c2c.cpus_cnt);
 			struct c2c_stats *stats = &c2c_he->node_stats[node];
 
 			ret = scnprintf(hpp->buf, hpp->size, "%2d{%2d ", node, num);
-- 
2.21.0


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

* Re: [PATCH] perf c2c: Display proper cpu count in nodes column
  2019-08-20 14:02 [PATCH] perf c2c: Display proper cpu count in nodes column Jiri Olsa
@ 2019-08-20 14:16 ` Arnaldo Carvalho de Melo
  2019-08-20 14:21   ` Jiri Olsa
  2019-09-02  8:16 ` [tip: perf/core] " tip-bot2 for Jiri Olsa
  1 sibling, 1 reply; 4+ messages in thread
From: Arnaldo Carvalho de Melo @ 2019-08-20 14:16 UTC (permalink / raw)
  To: Jiri Olsa
  Cc: Joe Mario, lkml, Ingo Molnar, Namhyung Kim, Alexander Shishkin,
	Peter Zijlstra, Michael Petlan

Em Tue, Aug 20, 2019 at 04:02:19PM +0200, Jiri Olsa escreveu:
> There's wrong bitmap considered when checking
> for cpu count of specific node.
> 
> We do the needed computation for 'set' variable,
> but at the end we use the 'c2c_he->cpuset' weight,
> which shows misleading numbers.
> 
> Reported-by: Joe Mario <jmario@redhat.com>

You forgot to add this:

Fixes: 1e181b92a2da ("perf c2c report: Add 'node' sort key")

Can you please confirm that that is the cset being fixed? This helps
with backporters, stable@, etc.

- Arnaldo


> Link: https://lkml.kernel.org/n/tip-9wvrv74n7d4nbgztr74isv5j@git.kernel.org
> Signed-off-by: Jiri Olsa <jolsa@kernel.org>
> ---
>  tools/perf/builtin-c2c.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/perf/builtin-c2c.c b/tools/perf/builtin-c2c.c
> index f0aae6e13a33..9240c6bf70f5 100644
> --- a/tools/perf/builtin-c2c.c
> +++ b/tools/perf/builtin-c2c.c
> @@ -1106,7 +1106,7 @@ node_entry(struct perf_hpp_fmt *fmt __maybe_unused, struct perf_hpp *hpp,
>  			break;
>  		case 1:
>  		{
> -			int num = bitmap_weight(c2c_he->cpuset, c2c.cpus_cnt);
> +			int num = bitmap_weight(set, c2c.cpus_cnt);
>  			struct c2c_stats *stats = &c2c_he->node_stats[node];
>  
>  			ret = scnprintf(hpp->buf, hpp->size, "%2d{%2d ", node, num);
> -- 
> 2.21.0

-- 

- Arnaldo

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

* Re: [PATCH] perf c2c: Display proper cpu count in nodes column
  2019-08-20 14:16 ` Arnaldo Carvalho de Melo
@ 2019-08-20 14:21   ` Jiri Olsa
  0 siblings, 0 replies; 4+ messages in thread
From: Jiri Olsa @ 2019-08-20 14:21 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Jiri Olsa, Joe Mario, lkml, Ingo Molnar, Namhyung Kim,
	Alexander Shishkin, Peter Zijlstra, Michael Petlan

On Tue, Aug 20, 2019 at 11:16:52AM -0300, Arnaldo Carvalho de Melo wrote:
> Em Tue, Aug 20, 2019 at 04:02:19PM +0200, Jiri Olsa escreveu:
> > There's wrong bitmap considered when checking
> > for cpu count of specific node.
> > 
> > We do the needed computation for 'set' variable,
> > but at the end we use the 'c2c_he->cpuset' weight,
> > which shows misleading numbers.
> > 
> > Reported-by: Joe Mario <jmario@redhat.com>
> 
> You forgot to add this:
> 
> Fixes: 1e181b92a2da ("perf c2c report: Add 'node' sort key")
> 
> Can you please confirm that that is the cset being fixed? This helps
> with backporters, stable@, etc.

oops sry, yes, that's correct commit

thanks,
jirka

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

* [tip: perf/core] perf c2c: Display proper cpu count in nodes column
  2019-08-20 14:02 [PATCH] perf c2c: Display proper cpu count in nodes column Jiri Olsa
  2019-08-20 14:16 ` Arnaldo Carvalho de Melo
@ 2019-09-02  8:16 ` tip-bot2 for Jiri Olsa
  1 sibling, 0 replies; 4+ messages in thread
From: tip-bot2 for Jiri Olsa @ 2019-09-02  8:16 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: Joe Mario, Jiri Olsa, Alexander Shishkin, Michael Petlan,
	Namhyung Kim, Peter Zijlstra, Arnaldo Carvalho de Melo,
	Ingo Molnar, Borislav Petkov, linux-kernel

The following commit has been merged into the perf/core branch of tip:

Commit-ID:     67260e8c0e681a9bb9ed861514b4c80c2d0eb2e5
Gitweb:        https://git.kernel.org/tip/67260e8c0e681a9bb9ed861514b4c80c2d0eb2e5
Author:        Jiri Olsa <jolsa@kernel.org>
AuthorDate:    Tue, 20 Aug 2019 16:02:19 +02:00
Committer:     Arnaldo Carvalho de Melo <acme@redhat.com>
CommitterDate: Thu, 29 Aug 2019 17:38:31 -03:00

perf c2c: Display proper cpu count in nodes column

There's wrong bitmap considered when checking for cpu count of specific
node.

We do the needed computation for 'set' variable, but at the end we use
the 'c2c_he->cpuset' weight, which shows misleading numbers.

Fixes: 1e181b92a2da ("perf c2c report: Add 'node' sort key")
Reported-by: Joe Mario <jmario@redhat.com>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Michael Petlan <mpetlan@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lore.kernel.org/lkml/20190820140219.28338-1-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/builtin-c2c.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/builtin-c2c.c b/tools/perf/builtin-c2c.c
index 73782d9..8335a40 100644
--- a/tools/perf/builtin-c2c.c
+++ b/tools/perf/builtin-c2c.c
@@ -1107,7 +1107,7 @@ node_entry(struct perf_hpp_fmt *fmt __maybe_unused, struct perf_hpp *hpp,
 			break;
 		case 1:
 		{
-			int num = bitmap_weight(c2c_he->cpuset, c2c.cpus_cnt);
+			int num = bitmap_weight(set, c2c.cpus_cnt);
 			struct c2c_stats *stats = &c2c_he->node_stats[node];
 
 			ret = scnprintf(hpp->buf, hpp->size, "%2d{%2d ", node, num);

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

end of thread, other threads:[~2019-09-02  8:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-20 14:02 [PATCH] perf c2c: Display proper cpu count in nodes column Jiri Olsa
2019-08-20 14:16 ` Arnaldo Carvalho de Melo
2019-08-20 14:21   ` Jiri Olsa
2019-09-02  8:16 ` [tip: perf/core] " tip-bot2 for Jiri Olsa

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