Skip to contentSkip to conversation

perf c2c: Fix report with offline cpus

PATCH Applied Ravi Bangoria 4 participants 4 messages Aug 22, 2019 – Aug 23, 2019 perf events

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 perf c2c: Fix report with offline cpus

If c2c is recorded on a machine where any cpus are offline, 'perf c2c report' throws an error "node/cpu topology bugFailed setup nodes". It fails because while preparing node-cpu mapping we don't consider offline cpus.

Fixes 1e181b92a2da ("perf c2c report: Add 'node' sort key")
---
 tools/perf/builtin-c2c.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/builtin-c2c.c +1 -1
index 9e6cc86..fc68a94 100644
@@ -2027,7 +2027,7 @@ static int setup_nodes(struct perf_session *session)
 		c2c.node_info = 2;
 
 	c2c.nodes_cnt = session->header.env.nr_numa_nodes;
-	c2c.cpus_cnt  = session->header.env.nr_cpus_online;
+	c2c.cpus_cnt  = session->header.env.nr_cpus_avail;
 
 	n = session->header.env.numa_nodes;
 	if (!n)
Signature · 1 line
1.8.3.1
Acked-by on v1 1/1
#1 lore raw
Quoted 8 lines · Ravi Bangoria

If c2c is recorded on a machine where any cpus are offline, 'perf c2c report' throws an error "node/cpu topology bugFailed setup nodes". It fails because while preparing node-cpu mapping we don't consider offline cpus.

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

thanks,
jirka

Quoted 20 lines
---
 tools/perf/builtin-c2c.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/builtin-c2c.c +1 -1
index 9e6cc86..fc68a94 100644
@@ -2027,7 +2027,7 @@ static int setup_nodes(struct perf_session *session)
 		c2c.node_info = 2;
 
 	c2c.nodes_cnt = session->header.env.nr_numa_nodes;
-	c2c.cpus_cnt  = session->header.env.nr_cpus_online;
+	c2c.cpus_cnt  = session->header.env.nr_cpus_avail;
 
 	n = session->header.env.numa_nodes;
 	if (!n)
Signature · 1 line
1.8.3.1
#2 lore raw

Em Thu, Aug 22, 2019 at 12:10:26PM +0200, Jiri Olsa escreveu:

Quoted 11 lines · Ravi Bangoria
Quoted 8 lines

If c2c is recorded on a machine where any cpus are offline, 'perf c2c report' throws an error "node/cpu topology bugFailed setup nodes". It fails because while preparing node-cpu mapping we don't consider offline cpus.

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

Thanks, applied.

- Arnaldo

Quoted 23 lines

thanks,
jirka

Quoted 20 lines
---
 tools/perf/builtin-c2c.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/builtin-c2c.c +1 -1
index 9e6cc86..fc68a94 100644
@@ -2027,7 +2027,7 @@ static int setup_nodes(struct perf_session *session)
 		c2c.node_info = 2;
 
 	c2c.nodes_cnt = session->header.env.nr_numa_nodes;
-	c2c.cpus_cnt  = session->header.env.nr_cpus_online;
+	c2c.cpus_cnt  = session->header.env.nr_cpus_avail;
 
 	n = session->header.env.numa_nodes;
 	if (!n)
Signature · 1 line
1.8.3.1
Signature · 1 line
- Arnaldo
merge bot Applied
#3 lore raw
In reply to Ravi Bangoria
The following commit has been merged into the perf/core branch of tip:

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

Commit-ID:     1ea770f6c1971bc101b3741f4d88b0b4ea5c4181
Gitweb:        https://git.kernel.org/tip/1ea770f6c1971bc101b3741f4d88b0b4ea5c4181
Author:        Ravi Bangoria <[email protected]>
AuthorDate:    Thu, 22 Aug 2019 14:20:45 +05:30
Committer:     Arnaldo Carvalho de Melo <[email protected]>
CommitterDate: Thu, 22 Aug 2019 17:16:57 -03:00

perf c2c: Fix report with offline cpus

If c2c is recorded on a machine where any cpus are offline, 'perf c2c report' throws an error "node/cpu topology bugFailed setup nodes".

It fails because while preparing node-cpu mapping we don't consider offline cpus.

---
 tools/perf/builtin-c2c.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/builtin-c2c.c +1 -1
index 01629f5..2111437 100644
@@ -2027,7 +2027,7 @@ static int setup_nodes(struct perf_session *session)
 		c2c.node_info = 2;
 
 	c2c.nodes_cnt = session->header.env.nr_numa_nodes;
-	c2c.cpus_cnt  = session->header.env.nr_cpus_online;
+	c2c.cpus_cnt  = session->header.env.nr_cpus_avail;
 
 	n = session->header.env.numa_nodes;
 	if (!n)