On Mon, Feb 13, 2017 at 04:34:34PM +0100, Jan Stancek wrote:
> Similar to cpu__max_cpu() (which returns max possible CPU),
> returns max present CPU.
> 
> Signed-off-by: Jan Stancek <[email protected]>
> ---
>  tools/perf/util/cpumap.c | 22 ++++++++++++++++++++++
>  tools/perf/util/cpumap.h |  1 +
>  2 files changed, 23 insertions(+)
> 
> diff --git a/tools/perf/util/cpumap.c b/tools/perf/util/cpumap.c
> index 2c0b52264a46..8c7504939113 100644
> --- a/tools/perf/util/cpumap.c
> +++ b/tools/perf/util/cpumap.c
> @@ -9,6 +9,7 @@
>  #include "asm/bug.h"
>  
>  static int max_cpu_num;
> +static int max_present_cpu_num;

I think it'd be less confusing for me if we follow the kernel names here

 static int max_cpu_possible;
 static int max_cpu_present;

also I wonder we should use 

 static int max_cpu_online;

instead of:

 sysconf(_SC_NPROCESSORS_ONLN)

but we can do it all later on as follow up

jirka

Reply via email to