lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 28 Feb 2019 17:22:08 +0100
From:   Jiri Olsa <jolsa@...hat.com>
To:     Ravi Bangoria <ravi.bangoria@...ux.ibm.com>
Cc:     acme@...nel.org, alexander.shishkin@...ux.intel.com,
        namhyung@...nel.org, eranian@...gle.com,
        linux-kernel@...r.kernel.org, tonyj@...e.com, nasastry@...ibm.com
Subject: Re: [PATCH] perf c2c: Fix c2c report for empty numa node

On Thu, Feb 28, 2019 at 05:12:31PM +0100, Jiri Olsa wrote:
> On Thu, Feb 28, 2019 at 09:07:19PM +0530, Ravi Bangoria wrote:
> > perf c2c report fails if system has empty numa node(0 cpus):
> > 
> >   $ lscpu
> >   NUMA node0 CPU(s):   
> >   NUMA node1 CPU(s):   0-4
> > 
> >   $ sudo ./perf c2c report 
> >   node/cpu topology bugFailed setup nodes
> > 
> > Fix this.
> > 
> > Reported-by: Nageswara R Sastry <nasastry@...ibm.com>
> > Signed-off-by: Ravi Bangoria <ravi.bangoria@...ux.ibm.com>
> > ---
> >  tools/perf/util/cpumap.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/tools/perf/util/cpumap.c b/tools/perf/util/cpumap.c
> > index 383674f448fc..517c3f37c613 100644
> > --- a/tools/perf/util/cpumap.c
> > +++ b/tools/perf/util/cpumap.c
> > @@ -261,7 +261,7 @@ struct cpu_map *cpu_map__dummy_new(void)
> >  	struct cpu_map *cpus = malloc(sizeof(*cpus) + sizeof(int));
> >  
> >  	if (cpus != NULL) {
> > -		cpus->nr = 1;
> > +		cpus->nr = 0;
> 
> you can't do this, there's one item in the map, nr needs to
> reflect that.. it breaks 'perf test' badly
> 
> so the node is empty.. we need to teach c2c to work with that
> I'll check


how about attached change (untested)?

but I wonder there are some other hidden
bugs wrt empty node

jirka


---
diff --git a/tools/perf/builtin-c2c.c b/tools/perf/builtin-c2c.c
index 4272763a5e96..9e6cc868bdb4 100644
--- a/tools/perf/builtin-c2c.c
+++ b/tools/perf/builtin-c2c.c
@@ -2056,6 +2056,12 @@ static int setup_nodes(struct perf_session *session)
 		if (!set)
 			return -ENOMEM;
 
+		nodes[node] = set;
+
+		/* empty node, skip */
+		if (cpu_map__empty(map))
+			continue;
+
 		for (cpu = 0; cpu < map->nr; cpu++) {
 			set_bit(map->map[cpu], set);
 
@@ -2064,8 +2070,6 @@ static int setup_nodes(struct perf_session *session)
 
 			cpu2node[map->map[cpu]] = node;
 		}
-
-		nodes[node] = set;
 	}
 
 	setup_nodes_header();

Powered by blists - more mailing lists