Messages in this thread | | | Date | Fri, 17 Feb 2017 16:05:52 +0100 | From | Jiri Olsa <> | Subject | Re: [PATCH v3 3/3] perf: replace _SC_NPROCESSORS_CONF with max_present_cpu in cpu_topology_map |
| |
On Fri, Feb 17, 2017 at 12:10:26PM +0100, Jan Stancek wrote:
SNIP
> - int cpu_nr = ph->env.nr_cpus_online; > + int cpu_nr = ph->env.nr_cpus_avail; > > nr = ph->env.nr_sibling_cores; > str = ph->env.sibling_cores; > @@ -1792,7 +1786,7 @@ static int process_cpu_topology(struct perf_file_section *section, > u32 nr, i; > char *str; > struct strbuf sb; > - int cpu_nr = ph->env.nr_cpus_online; > + int cpu_nr = ph->env.nr_cpus_avail; > u64 size = 0; > > ph->env.cpu = calloc(cpu_nr, sizeof(*ph->env.cpu)); > @@ -1873,7 +1867,7 @@ static int process_cpu_topology(struct perf_file_section *section, > if (ph->needs_swap) > nr = bswap_32(nr); > > - if (nr > (u32)cpu_nr) { > + if (nr != (u32)-1 && nr > (u32)cpu_nr) {
could you please add a comment here exaplaining the reason for possible -1 in here.. other than that it's ok,
for the series:
Acked-by: Jiri Olsa <jolsa@kernel.org>
thanks, jirka
| |