Re: [PATCH 1/4 v2] perf: Allow ability to map cpus to nodes easily

2014-04-10 Thread Don Zickus
On Thu, Apr 10, 2014 at 03:24:58PM +0200, Jiri Olsa wrote: > On Thu, Apr 10, 2014 at 09:15:15AM -0400, Don Zickus wrote: > > On Thu, Apr 10, 2014 at 11:31:46AM +0200, Jiri Olsa wrote: > > > On Mon, Apr 07, 2014 at 02:55:21PM -0400, Don Zickus wrote: > > > > > > SNIP > > > > > > > +static int

Re: [PATCH 1/4 v2] perf: Allow ability to map cpus to nodes easily

2014-04-10 Thread Jiri Olsa
On Thu, Apr 10, 2014 at 09:15:15AM -0400, Don Zickus wrote: > On Thu, Apr 10, 2014 at 11:31:46AM +0200, Jiri Olsa wrote: > > On Mon, Apr 07, 2014 at 02:55:21PM -0400, Don Zickus wrote: > > > > SNIP > > > > > +static int init_cpunode_map(void) > > > +{ > > > + int i; > > > + > > > +

Re: [PATCH 1/4 v2] perf: Allow ability to map cpus to nodes easily

2014-04-10 Thread Don Zickus
On Thu, Apr 10, 2014 at 11:31:46AM +0200, Jiri Olsa wrote: > On Mon, Apr 07, 2014 at 02:55:21PM -0400, Don Zickus wrote: > > SNIP > > > +static int init_cpunode_map(void) > > +{ > > + int i; > > + > > + set_max_cpu_num(); > > + set_max_node_num(); > > + > > + cpunode_map =

Re: [PATCH 1/4 v2] perf: Allow ability to map cpus to nodes easily

2014-04-10 Thread Jiri Olsa
On Mon, Apr 07, 2014 at 02:55:21PM -0400, Don Zickus wrote: SNIP > +static int init_cpunode_map(void) > +{ > + int i; > + > + set_max_cpu_num(); > + set_max_node_num(); > + > + cpunode_map = calloc(max_cpu_num, sizeof(int)); > + if (!cpunode_map) { > + pr_err("%s:

Re: [PATCH 1/4 v2] perf: Allow ability to map cpus to nodes easily

2014-04-10 Thread Jiri Olsa
On Mon, Apr 07, 2014 at 02:55:21PM -0400, Don Zickus wrote: SNIP +static int init_cpunode_map(void) +{ + int i; + + set_max_cpu_num(); + set_max_node_num(); + + cpunode_map = calloc(max_cpu_num, sizeof(int)); + if (!cpunode_map) { + pr_err(%s: calloc

Re: [PATCH 1/4 v2] perf: Allow ability to map cpus to nodes easily

2014-04-10 Thread Don Zickus
On Thu, Apr 10, 2014 at 11:31:46AM +0200, Jiri Olsa wrote: On Mon, Apr 07, 2014 at 02:55:21PM -0400, Don Zickus wrote: SNIP +static int init_cpunode_map(void) +{ + int i; + + set_max_cpu_num(); + set_max_node_num(); + + cpunode_map = calloc(max_cpu_num, sizeof(int));

Re: [PATCH 1/4 v2] perf: Allow ability to map cpus to nodes easily

2014-04-10 Thread Jiri Olsa
On Thu, Apr 10, 2014 at 09:15:15AM -0400, Don Zickus wrote: On Thu, Apr 10, 2014 at 11:31:46AM +0200, Jiri Olsa wrote: On Mon, Apr 07, 2014 at 02:55:21PM -0400, Don Zickus wrote: SNIP +static int init_cpunode_map(void) +{ + int i; + + set_max_cpu_num(); +

Re: [PATCH 1/4 v2] perf: Allow ability to map cpus to nodes easily

2014-04-10 Thread Don Zickus
On Thu, Apr 10, 2014 at 03:24:58PM +0200, Jiri Olsa wrote: On Thu, Apr 10, 2014 at 09:15:15AM -0400, Don Zickus wrote: On Thu, Apr 10, 2014 at 11:31:46AM +0200, Jiri Olsa wrote: On Mon, Apr 07, 2014 at 02:55:21PM -0400, Don Zickus wrote: SNIP +static int init_cpunode_map(void)

[PATCH 1/4 v2] perf: Allow ability to map cpus to nodes easily

2014-04-07 Thread Don Zickus
This patch figures out the max number of cpus and nodes that are on the system and creates a map of cpu to node. This allows us to provide a cpu and quickly get the node associated with it. It was mostly copied from builtin-kmem.c and tweaked slightly to use less memory (use possible cpus

[PATCH 1/4 v2] perf: Allow ability to map cpus to nodes easily

2014-04-07 Thread Don Zickus
This patch figures out the max number of cpus and nodes that are on the system and creates a map of cpu to node. This allows us to provide a cpu and quickly get the node associated with it. It was mostly copied from builtin-kmem.c and tweaked slightly to use less memory (use possible cpus