lkml.org 
[lkml]   [2017]   [Jan]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] perf: fix topology test on systems with sparse CPUs
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, int argc, const char *argv[])
>
> int perf_env__read_cpu_topology_map(struct perf_env *env)
> {
> - int cpu, nr_cpus;
> + int cpu, nr_cpus, i, err = 0;
> + struct cpu_map *map;
>
> if (env->cpu != NULL)
> return 0;
>
> - if (env->nr_cpus_avail == 0)
> - env->nr_cpus_avail = sysconf(_SC_NPROCESSORS_CONF);
> + map = cpu_map__new(NULL);

could you please put comment in here, explaining that
cpu_map__new(NULL) makes map with current online cpus

thanks,
jirka

\
 
 \ /
  Last update: 2017-01-30 19:49    [W:0.696 / U:0.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site