Re: [PATCH 04/13] perf env: Introduce read_cpu_topology_map() method

2015-09-11 Thread Arnaldo Carvalho de Melo
Em Sat, Sep 12, 2015 at 01:14:02AM +0900, Namhyung Kim escreveu: > > You inverted it, no? > > So, could you please check if the below patch can have your Acked-by? > > Namhyung? > Looks good to me. > Acked-by: Namhyung Kim Thanks, added it to the patch, after lunch I should have another

Re: [PATCH 04/13] perf env: Introduce read_cpu_topology_map() method

2015-09-11 Thread Namhyung Kim
Hi Arnaldo, On Fri, Sep 11, 2015 at 12:33:23PM -0300, Arnaldo Carvalho de Melo wrote: > Em Fri, Sep 11, 2015 at 11:40:28AM -0300, Arnaldo Carvalho de Melo escreveu: > > So this is a problem before and after my patches, i.e. If I go on and > > do, with what we have in acme/perf/core, i.e. none of

Re: [PATCH 04/13] perf env: Introduce read_cpu_topology_map() method

2015-09-11 Thread Arnaldo Carvalho de Melo
Em Fri, Sep 11, 2015 at 11:40:28AM -0300, Arnaldo Carvalho de Melo escreveu: > So this is a problem before and after my patches, i.e. If I go on and > do, with what we have in acme/perf/core, i.e. none of the changes I'm > playing with in perf/env: > > $ git remote update acme > Fetching acme

Re: [PATCH 04/13] perf env: Introduce read_cpu_topology_map() method

2015-09-11 Thread Arnaldo Carvalho de Melo
Em Fri, Sep 11, 2015 at 06:20:03PM +0800, Wangnan (F) escreveu: > > > On 2015/9/10 21:12, Arnaldo Carvalho de Melo wrote: > > [SNIP] > > >+ > >+int perf_env__read_cpu_topology_map(struct perf_env *env) > >+{ > >+int cpu, nr_cpus; > >+ > >+if (env->cpu != NULL) > >+return 0;

Re: [PATCH 04/13] perf env: Introduce read_cpu_topology_map() method

2015-09-11 Thread Wangnan (F)
On 2015/9/10 21:12, Arnaldo Carvalho de Melo wrote: [SNIP] + +int perf_env__read_cpu_topology_map(struct perf_env *env) +{ + int cpu, nr_cpus; + + if (env->cpu != NULL) + return 0; + + if (env->nr_cpus_avail == 0) + env->nr_cpus_avail =

Re: [PATCH 04/13] perf env: Introduce read_cpu_topology_map() method

2015-09-11 Thread Arnaldo Carvalho de Melo
Em Sat, Sep 12, 2015 at 01:14:02AM +0900, Namhyung Kim escreveu: > > You inverted it, no? > > So, could you please check if the below patch can have your Acked-by? > > Namhyung? > Looks good to me. > Acked-by: Namhyung Kim Thanks, added it to the patch, after lunch I

Re: [PATCH 04/13] perf env: Introduce read_cpu_topology_map() method

2015-09-11 Thread Namhyung Kim
Hi Arnaldo, On Fri, Sep 11, 2015 at 12:33:23PM -0300, Arnaldo Carvalho de Melo wrote: > Em Fri, Sep 11, 2015 at 11:40:28AM -0300, Arnaldo Carvalho de Melo escreveu: > > So this is a problem before and after my patches, i.e. If I go on and > > do, with what we have in acme/perf/core, i.e. none of

Re: [PATCH 04/13] perf env: Introduce read_cpu_topology_map() method

2015-09-11 Thread Wangnan (F)
On 2015/9/10 21:12, Arnaldo Carvalho de Melo wrote: [SNIP] + +int perf_env__read_cpu_topology_map(struct perf_env *env) +{ + int cpu, nr_cpus; + + if (env->cpu != NULL) + return 0; + + if (env->nr_cpus_avail == 0) + env->nr_cpus_avail =

Re: [PATCH 04/13] perf env: Introduce read_cpu_topology_map() method

2015-09-11 Thread Arnaldo Carvalho de Melo
Em Fri, Sep 11, 2015 at 06:20:03PM +0800, Wangnan (F) escreveu: > > > On 2015/9/10 21:12, Arnaldo Carvalho de Melo wrote: > > [SNIP] > > >+ > >+int perf_env__read_cpu_topology_map(struct perf_env *env) > >+{ > >+int cpu, nr_cpus; > >+ > >+if (env->cpu != NULL) > >+return 0;

Re: [PATCH 04/13] perf env: Introduce read_cpu_topology_map() method

2015-09-11 Thread Arnaldo Carvalho de Melo
Em Fri, Sep 11, 2015 at 11:40:28AM -0300, Arnaldo Carvalho de Melo escreveu: > So this is a problem before and after my patches, i.e. If I go on and > do, with what we have in acme/perf/core, i.e. none of the changes I'm > playing with in perf/env: > > $ git remote update acme > Fetching acme

RE: [PATCH 04/13] perf env: Introduce read_cpu_topology_map() method

2015-09-10 Thread Liang, Kan
> Em Thu, Sep 10, 2015 at 08:00:54PM +, Liang, Kan escreveu: > > > Em Wed, Sep 09, 2015 at 09:41:18PM +, Liang, Kan escreveu: > > > > > - for (i = 0; i < tp->cpu_nr; i++) { > > > > > - ret = do_write(fd, >core_id[i], sizeof(int)); > > > > > +

Re: [PATCH 04/13] perf env: Introduce read_cpu_topology_map() method

2015-09-10 Thread Arnaldo Carvalho de Melo
Em Thu, Sep 10, 2015 at 08:00:54PM +, Liang, Kan escreveu: > > Em Wed, Sep 09, 2015 at 09:41:18PM +, Liang, Kan escreveu: > > > > - for (i = 0; i < tp->cpu_nr; i++) { > > > > - ret = do_write(fd, >core_id[i], sizeof(int)); > > > > +

RE: [PATCH 04/13] perf env: Introduce read_cpu_topology_map() method

2015-09-10 Thread Liang, Kan
> > Em Wed, Sep 09, 2015 at 09:41:18PM +, Liang, Kan escreveu: > > > - for (i = 0; i < tp->cpu_nr; i++) { > > > - ret = do_write(fd, >core_id[i], sizeof(int)); > > > + perf_env__read_cpu_topology_map(_env); > > > + > > > > I think we need to handle error here. > > Ok, adding a

Re: [PATCH 04/13] perf env: Introduce read_cpu_topology_map() method

2015-09-10 Thread Arnaldo Carvalho de Melo
Em Wed, Sep 09, 2015 at 09:41:18PM +, Liang, Kan escreveu: > > - for (i = 0; i < tp->cpu_nr; i++) { > > - ret = do_write(fd, >core_id[i], sizeof(int)); > > + perf_env__read_cpu_topology_map(_env); > > + > > I think we need to handle error here. Ok, adding a test, updated patch

Re: [PATCH 04/13] perf env: Introduce read_cpu_topology_map() method

2015-09-10 Thread Arnaldo Carvalho de Melo
Em Wed, Sep 09, 2015 at 09:41:18PM +, Liang, Kan escreveu: > > - for (i = 0; i < tp->cpu_nr; i++) { > > - ret = do_write(fd, >core_id[i], sizeof(int)); > > + perf_env__read_cpu_topology_map(_env); > > + > > I think we need to handle error here. Ok, adding a test, updated patch

RE: [PATCH 04/13] perf env: Introduce read_cpu_topology_map() method

2015-09-10 Thread Liang, Kan
> Em Thu, Sep 10, 2015 at 08:00:54PM +, Liang, Kan escreveu: > > > Em Wed, Sep 09, 2015 at 09:41:18PM +, Liang, Kan escreveu: > > > > > - for (i = 0; i < tp->cpu_nr; i++) { > > > > > - ret = do_write(fd, >core_id[i], sizeof(int)); > > > > > +

RE: [PATCH 04/13] perf env: Introduce read_cpu_topology_map() method

2015-09-10 Thread Liang, Kan
> > Em Wed, Sep 09, 2015 at 09:41:18PM +, Liang, Kan escreveu: > > > - for (i = 0; i < tp->cpu_nr; i++) { > > > - ret = do_write(fd, >core_id[i], sizeof(int)); > > > + perf_env__read_cpu_topology_map(_env); > > > + > > > > I think we need to handle error here. > > Ok, adding a

Re: [PATCH 04/13] perf env: Introduce read_cpu_topology_map() method

2015-09-10 Thread Arnaldo Carvalho de Melo
Em Thu, Sep 10, 2015 at 08:00:54PM +, Liang, Kan escreveu: > > Em Wed, Sep 09, 2015 at 09:41:18PM +, Liang, Kan escreveu: > > > > - for (i = 0; i < tp->cpu_nr; i++) { > > > > - ret = do_write(fd, >core_id[i], sizeof(int)); > > > > +

RE: [PATCH 04/13] perf env: Introduce read_cpu_topology_map() method

2015-09-09 Thread Liang, Kan
> diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c index > 151b8310ac70..d4c8aa2f4db7 100644 > --- a/tools/perf/util/header.c > +++ b/tools/perf/util/header.c > @@ -415,8 +415,6 @@ struct cpu_topo { > u32 thread_sib; > char **core_siblings; > char

[PATCH 04/13] perf env: Introduce read_cpu_topology_map() method

2015-09-09 Thread Arnaldo Carvalho de Melo
From: Arnaldo Carvalho de Melo Out of the code to write the cpu topology map in the perf.data file header. Now if one needs the CPU topology map for the running machine, one needs to call perf_env__read_cpu_topology_map(perf_env) and the info will be stored in perf_env.cpu. For now we're using

[PATCH 04/13] perf env: Introduce read_cpu_topology_map() method

2015-09-09 Thread Arnaldo Carvalho de Melo
From: Arnaldo Carvalho de Melo Out of the code to write the cpu topology map in the perf.data file header. Now if one needs the CPU topology map for the running machine, one needs to call perf_env__read_cpu_topology_map(perf_env) and the info will be stored in perf_env.cpu.

RE: [PATCH 04/13] perf env: Introduce read_cpu_topology_map() method

2015-09-09 Thread Liang, Kan
> diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c index > 151b8310ac70..d4c8aa2f4db7 100644 > --- a/tools/perf/util/header.c > +++ b/tools/perf/util/header.c > @@ -415,8 +415,6 @@ struct cpu_topo { > u32 thread_sib; > char **core_siblings; > char