Re: [PATCH] perf: fix topology test on systems with sparse CPUs

2017-02-02 Thread Jiri Olsa
On Thu, Feb 02, 2017 at 07:06:43AM -0500, Jan Stancek wrote: > > > > > When build_cpu_topo() encounters offline/absent CPUs, > > > it fails to find any sysfs entries and returns failure. > > > This leads to build_cpu_topology() and write_cpu_topology() > > > failing as well. > > > > > > Because H

Re: [PATCH] perf: fix topology test on systems with sparse CPUs

2017-02-02 Thread Jan Stancek
> > > When build_cpu_topo() encounters offline/absent CPUs, > > it fails to find any sysfs entries and returns failure. > > This leads to build_cpu_topology() and write_cpu_topology() > > failing as well. > > > > Because HEADER_CPU_TOPOLOGY has not been written, read leaves > > cpu_topology_map N

Re: [PATCH] perf: fix topology test on systems with sparse CPUs

2017-02-02 Thread Jiri Olsa
On Tue, Jan 31, 2017 at 05:03:51PM +0100, Jan Stancek wrote: SNIP > > There are 2 problems wrt. cpu_topology_map on systems with sparse CPUs: > > 1. offline/absent CPUs will have their socket_id and core_id set to -1 >which triggers: >"socket_id number is too big.You may need to upgrade

Re: [PATCH] perf: fix topology test on systems with sparse CPUs

2017-02-02 Thread Jiri Olsa
On Tue, Jan 31, 2017 at 05:03:51PM +0100, Jan Stancek wrote: > On 01/30/2017 07:49 PM, Jiri Olsa wrote: > > so basically we're changing from avail to online cpus > > > > have you checked all the users of this FEATURE > > if such change is ok? > > Jiri, > > It wasn't OK as there are other users w

Re: [PATCH] perf: fix topology test on systems with sparse CPUs

2017-01-31 Thread Jan Stancek
On 01/30/2017 07:49 PM, Jiri Olsa wrote: > so basically we're changing from avail to online cpus > > have you checked all the users of this FEATURE > if such change is ok? Jiri, It wasn't OK as there are other users who index cpu_topology_map by CPU id. I decided to give the alternative a try (a

Re: [PATCH] perf: fix topology test on systems with sparse CPUs

2017-01-30 Thread Jan Stancek
ng" > , suka...@linux.vnet.ibm.com > Sent: Monday, 30 January, 2017 7:49:08 PM > Subject: Re: [PATCH] perf: fix topology test on systems with sparse CPUs > > On Mon, Jan 30, 2017 at 05:53:34PM +0100, Jan Stancek wrote: > > SNIP > > > + r

Re: [PATCH] perf: fix topology test on systems with sparse CPUs

2017-01-30 Thread Jiri Olsa
On Mon, Jan 30, 2017 at 05:53:34PM +0100, Jan Stancek wrote: SNIP > + ret = build_cpu_topo(tp, cpu); > if (ret < 0) > break; > } > + > +out_free: > + cpu_map__put(map); > if (ret) { > free_cpu_topo(tp); >

Re: [PATCH] perf: fix topology test on systems with sparse CPUs

2017-01-30 Thread Jiri Olsa
On Mon, Jan 30, 2017 at 05:53:34PM +0100, Jan Stancek wrote: > Topology test fails on systems with sparse CPUs, e.g. SNIP > > - for (i = 0; i < nr; i++) { > - ret = build_cpu_topo(tp, i); > + for (i = 0; i < tp->cpu_nr; i++) { > + cpu = map->map[i]; no need for

Re: [PATCH] perf: fix topology test on systems with sparse CPUs

2017-01-30 Thread Jiri Olsa
On Mon, Jan 30, 2017 at 05:53:34PM +0100, Jan Stancek wrote: SNIP > diff --git a/tools/perf/util/env.c b/tools/perf/util/env.c > index bb964e86b09d..0c2cae807a61 100644 > --- a/tools/perf/util/env.c > +++ b/tools/perf/util/env.c > @@ -60,29 +60,45 @@ int perf_env__set_cmdline(struct perf_env *env

[PATCH] perf: fix topology test on systems with sparse CPUs

2017-01-30 Thread Jan Stancek
Topology test fails on systems with sparse CPUs, e.g. CPU not present or offline: 36: Test topology in session : --- start --- test child forked, pid 23703 templ file: /tmp/perf-test-i2rNki failed to write feature 13 perf: Segmentation fault available: 2 nodes (0-1