Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1215342 > unrolled thread

RE: [PATCH V2 1/3] perf,tools: get correct cpu id for print_aggr

Started by"Liang, Kan" <kan.liang@intel.com>
First post2015-08-28 15:40 +0200
Last post2015-08-28 16:50 +0200
Articles 6 — 4 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  RE: [PATCH V2 1/3] perf,tools: get correct cpu id for print_aggr "Liang, Kan" <kan.liang@intel.com> - 2015-08-28 15:40 +0200
    Re: [PATCH V2 1/3] perf,tools: get correct cpu id for print_aggr "acme@kernel.org" <acme@kernel.org> - 2015-08-28 16:30 +0200
      RE: [PATCH V2 1/3] perf,tools: get correct cpu id for print_aggr "Liang, Kan" <kan.liang@intel.com> - 2015-08-28 16:40 +0200
        Re: [PATCH V2 1/3] perf,tools: get correct cpu id for print_aggr Arnaldo Carvalho de Melo <acme@kernel.org> - 2015-08-28 16:50 +0200
          RE: [PATCH V2 1/3] perf,tools: get correct cpu id for print_aggr "Liang, Kan" <kan.liang@intel.com> - 2015-08-28 17:00 +0200
        Re: [PATCH V2 1/3] perf,tools: get correct cpu id for print_aggr Stephane Eranian <eranian@google.com> - 2015-08-28 16:50 +0200

#1215342 — RE: [PATCH V2 1/3] perf,tools: get correct cpu id for print_aggr

From"Liang, Kan" <kan.liang@intel.com>
Date2015-08-28 15:40 +0200
SubjectRE: [PATCH V2 1/3] perf,tools: get correct cpu id for print_aggr
Message-ID<q2s2U-4H9-49@gated-at.bofh.it>

> On Thu, Jul 02, 2015 at 03:08:43AM -0400, kan.liang@intel.com wrote:
> > From: Kan Liang <kan.liang@intel.com>
> >
> > print_aggr fails to print per-core/per-socket statistics after commit
> > 582ec0829b3d ("perf stat: Fix per-socket output bug for uncore
> > events") if events have differnt cpus. Because in print_aggr,
> > aggr_get_id needs index (not cpu id) to find core/pkg id. Also, evsel
> > cpu maps should be used to get aggregated id.
> >
> > Here is an example.
> > Counting events cycles,uncore_imc_0/cas_count_read/. (Uncore event
> has
> > cpumask 0,18)
> >
> > "perf stat -e cycles,uncore_imc_0/cas_count_read/ -C0,18 --per-core
> > sleep 2"
> >
> > Without this patch, it failes to get CPU 18 result.
> >  Performance counter stats for 'CPU(s) 0,18':
> >
> > S0-C0           1            7526851      cycles
> > S0-C0           1               1.05 MiB  uncore_imc_0/cas_count_read/
> > S1-C0           0      <not counted>      cycles
> > S1-C0           0      <not counted> MiB  uncore_imc_0/cas_count_read/
> >
> > With this patch, it can get both CPU0 and CPU18 result.
> >  Performance counter stats for 'CPU(s) 0,18':
> >
> > S0-C0           1            6327768      cycles
> > S0-C0           1               0.47 MiB  uncore_imc_0/cas_count_read/
> > S1-C0           1             330228      cycles
> > S1-C0           1               0.29 MiB  uncore_imc_0/cas_count_read/
> >
> > Signed-off-by: Kan Liang <kan.liang@intel.com>
> 
> Acked-by: Jiri Olsa <jolsa@kernel.org>
> 

Hi Arnaldo,

Could you please merge this patch?
This patch is to fix a bug of perf stat. It doesn't depend on
other patches of the patchset, and can be merged by itself.

Thanks,
Kan

> thanks,
> jirka
> 
> > ---
> >
> > Changes since V1
> >  - Modify changelog
> >  - Remove perf_evsel__get_cpumap_index
> >
> >  tools/perf/builtin-stat.c | 5 ++---
> >  1 file changed, 2 insertions(+), 3 deletions(-)
> >
> > diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
> > index 37e301a..47c3c1f 100644
> > --- a/tools/perf/builtin-stat.c
> > +++ b/tools/perf/builtin-stat.c
> > @@ -694,7 +694,7 @@ static void abs_printout(int id, int nr, struct
> > perf_evsel *evsel, double avg)  static void print_aggr(char *prefix)
> > {
> >  	struct perf_evsel *counter;
> > -	int cpu, cpu2, s, s2, id, nr;
> > +	int cpu, s, s2, id, nr;
> >  	double uval;
> >  	u64 ena, run, val;
> >
> > @@ -707,8 +707,7 @@ static void print_aggr(char *prefix)
> >  			val = ena = run = 0;
> >  			nr = 0;
> >  			for (cpu = 0; cpu < perf_evsel__nr_cpus(counter);
> cpu++) {
> > -				cpu2 = perf_evsel__cpus(counter)-
> >map[cpu];
> > -				s2 = aggr_get_id(evsel_list->cpus, cpu2);
> > +				s2 =
> aggr_get_id(perf_evsel__cpus(counter), cpu);
> >  				if (s2 != id)
> >  					continue;
> >  				val += perf_counts(counter->counts, cpu,
> 0)->val;
> > --
> > 1.8.3.1
> >
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1215367

From"acme@kernel.org" <acme@kernel.org>
Date2015-08-28 16:30 +0200
Message-ID<q2sPg-5Rp-15@gated-at.bofh.it>
In reply to#1215342
Em Fri, Aug 28, 2015 at 01:33:22PM +0000, Liang, Kan escreveu:
> > On Thu, Jul 02, 2015 at 03:08:43AM -0400, kan.liang@intel.com wrote:
> > > From: Kan Liang <kan.liang@intel.com>
> > > print_aggr fails to print per-core/per-socket statistics after commit
> > > 582ec0829b3d ("perf stat: Fix per-socket output bug for uncore
> > > events") if events have differnt cpus. Because in print_aggr,
> > > aggr_get_id needs index (not cpu id) to find core/pkg id. Also, evsel
> > > cpu maps should be used to get aggregated id.
> > > Signed-off-by: Kan Liang <kan.liang@intel.com>

> > Acked-by: Jiri Olsa <jolsa@kernel.org>
 
> Hi Arnaldo,
 
> Could you please merge this patch?
> This patch is to fix a bug of perf stat. It doesn't depend on
> other patches of the patchset, and can be merged by itself.

Right, in such cases, please, make it clear against which branch this
should be applied, i.e. if this is a longstanding bug that needs to go
to perf/urgent, i.e. to the current merge window, ASAP, or if this
is for something that was introduced in the current development branch,
perf/core.

In this case it needs to go to perf/urgent, where it applies cleanly,
perf/core has extra stuff there that fuzzes a bit.

Also, since you know the cset where this bug was introduced, please
consider adding a "Fixes:" tag, commom everywhere in the kernel:

  [acme@zoo linux]$ git log | grep '^[ \t]\+Fixes:'  | wc -l
  3805

And we use it in tools/, sometime I add it while editing changelogs,
like in this patch:

  [acme@zoo linux]$ git log tools/ | grep '^[ \t]\+Fixes:' | head -5
    Fixes: 582ec0829b3d ("perf stat: Fix per-socket output bug for uncore events")
    Fixes: b685ac22b436 ("perf symbols: Add front end cache for DSO symbol lookup")
    Fixes: 06b234ec26fd ("perf script: Don't assume evsel position of tracking events")
    Fixes: d4957633bf9d ("perf report: Add infrastructure for a cycles histogram")
    Fixes: 75186a9b09e4 ("perf probe: Fix to show lines of sys_ functions correctly")
  [acme@zoo linux]$

- Arnaldo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1215373

From"Liang, Kan" <kan.liang@intel.com>
Date2015-08-28 16:40 +0200
Message-ID<q2sYX-62C-33@gated-at.bofh.it>
In reply to#1215367
> 
> Em Fri, Aug 28, 2015 at 01:33:22PM +0000, Liang, Kan escreveu:
> > > On Thu, Jul 02, 2015 at 03:08:43AM -0400, kan.liang@intel.com wrote:
> > > > From: Kan Liang <kan.liang@intel.com> print_aggr fails to print
> > > > per-core/per-socket statistics after commit 582ec0829b3d ("perf
> > > > stat: Fix per-socket output bug for uncore
> > > > events") if events have differnt cpus. Because in print_aggr,
> > > > aggr_get_id needs index (not cpu id) to find core/pkg id. Also,
> > > > evsel cpu maps should be used to get aggregated id.
> > > > Signed-off-by: Kan Liang <kan.liang@intel.com>
> 
> > > Acked-by: Jiri Olsa <jolsa@kernel.org>
> 
> > Hi Arnaldo,
> 
> > Could you please merge this patch?
> > This patch is to fix a bug of perf stat. It doesn't depend on other
> > patches of the patchset, and can be merged by itself.
> 
> Right, in such cases, please, make it clear against which branch this should
> be applied, i.e. if this is a longstanding bug that needs to go to perf/urgent,
> i.e. to the current merge window, ASAP, or if this is for something that was
> introduced in the current development branch, perf/core.
> 
> In this case it needs to go to perf/urgent, where it applies cleanly,
> perf/core has extra stuff there that fuzzes a bit.
> 
> Also, since you know the cset where this bug was introduced, please
> consider adding a "Fixes:" tag, commom everywhere in the kernel:

OK. I think this patch needs to go to perf/urgent.
Should I re-send this patch with "Fixes:" tag and comments? 

Thanks,
Kan
> 
>   [acme@zoo linux]$ git log | grep '^[ \t]\+Fixes:'  | wc -l
>   3805
> 
> And we use it in tools/, sometime I add it while editing changelogs, like in
> this patch:
> 
>   [acme@zoo linux]$ git log tools/ | grep '^[ \t]\+Fixes:' | head -5
>     Fixes: 582ec0829b3d ("perf stat: Fix per-socket output bug for uncore
> events")
>     Fixes: b685ac22b436 ("perf symbols: Add front end cache for DSO symbol
> lookup")
>     Fixes: 06b234ec26fd ("perf script: Don't assume evsel position of tracking
> events")
>     Fixes: d4957633bf9d ("perf report: Add infrastructure for a cycles
> histogram")
>     Fixes: 75186a9b09e4 ("perf probe: Fix to show lines of sys_ functions
> correctly")
>   [acme@zoo linux]$
> 
> - Arnaldo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1215378

FromArnaldo Carvalho de Melo <acme@kernel.org>
Date2015-08-28 16:50 +0200
Message-ID<q2t8C-6dU-19@gated-at.bofh.it>
In reply to#1215373
Em Fri, Aug 28, 2015 at 02:39:21PM +0000, Liang, Kan escreveu:
> > In this case it needs to go to perf/urgent, where it applies
> > cleanly, perf/core has extra stuff there that fuzzes a bit.

> > Also, since you know the cset where this bug was introduced, please
> > consider adding a "Fixes:" tag, commom everywhere in the kernel:

> OK. I think this patch needs to go to perf/urgent.
> Should I re-send this patch with "Fixes:" tag and comments? 

No need, I did this already, its sitting in my perf/urgent branch now,
will go to Ingo today.

- Arnaldo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1215381

From"Liang, Kan" <kan.liang@intel.com>
Date2015-08-28 17:00 +0200
Message-ID<q2tih-6pk-13@gated-at.bofh.it>
In reply to#1215378

> -----Original Message-----
> From: Arnaldo Carvalho de Melo [mailto:acme@kernel.org]
> Sent: Friday, August 28, 2015 10:47 AM
> To: Liang, Kan
> Cc: Jiri Olsa; jolsa@kernel.org; ak@linux.intel.com; namhyung@kernel.org;
> eranian@google.com; Hunter, Adrian; dsahern@gmail.com;
> a.p.zijlstra@chello.nl; Ingo Molnar; linux-kernel@vger.kernel.org
> Subject: Re: [PATCH V2 1/3] perf,tools: get correct cpu id for print_aggr
> 
> Em Fri, Aug 28, 2015 at 02:39:21PM +0000, Liang, Kan escreveu:
> > > In this case it needs to go to perf/urgent, where it applies
> > > cleanly, perf/core has extra stuff there that fuzzes a bit.
> 
> > > Also, since you know the cset where this bug was introduced, please
> > > consider adding a "Fixes:" tag, commom everywhere in the kernel:
> 
> > OK. I think this patch needs to go to perf/urgent.
> > Should I re-send this patch with "Fixes:" tag and comments?
> 
> No need, I did this already, its sitting in my perf/urgent branch now, will go
> to Ingo today.
> 

Thanks.

Kan
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1215379

FromStephane Eranian <eranian@google.com>
Date2015-08-28 16:50 +0200
Message-ID<q2t8C-6dU-23@gated-at.bofh.it>
In reply to#1215373
On Fri, Aug 28, 2015 at 7:39 AM, Liang, Kan <kan.liang@intel.com> wrote:
>
> >
> > Em Fri, Aug 28, 2015 at 01:33:22PM +0000, Liang, Kan escreveu:
> > > > On Thu, Jul 02, 2015 at 03:08:43AM -0400, kan.liang@intel.com wrote:
> > > > > From: Kan Liang <kan.liang@intel.com> print_aggr fails to print
> > > > > per-core/per-socket statistics after commit 582ec0829b3d ("perf
> > > > > stat: Fix per-socket output bug for uncore
> > > > > events") if events have differnt cpus. Because in print_aggr,
> > > > > aggr_get_id needs index (not cpu id) to find core/pkg id. Also,
> > > > > evsel cpu maps should be used to get aggregated id.
> > > > > Signed-off-by: Kan Liang <kan.liang@intel.com>
> >
> > > > Acked-by: Jiri Olsa <jolsa@kernel.org>
> >
> > > Hi Arnaldo,
> >
> > > Could you please merge this patch?
> > > This patch is to fix a bug of perf stat. It doesn't depend on other
> > > patches of the patchset, and can be merged by itself.
> >
> > Right, in such cases, please, make it clear against which branch this should
> > be applied, i.e. if this is a longstanding bug that needs to go to perf/urgent,
> > i.e. to the current merge window, ASAP, or if this is for something that was
> > introduced in the current development branch, perf/core.
> >
> > In this case it needs to go to perf/urgent, where it applies cleanly,
> > perf/core has extra stuff there that fuzzes a bit.
> >
> > Also, since you know the cset where this bug was introduced, please
> > consider adding a "Fixes:" tag, commom everywhere in the kernel:
>
> OK. I think this patch needs to go to perf/urgent.
> Should I re-send this patch with "Fixes:" tag and comments?
>
Acked-by: Stephane Eranian <eranian@google.com>

>
> Thanks,
> Kan
> >
> >   [acme@zoo linux]$ git log | grep '^[ \t]\+Fixes:'  | wc -l
> >   3805
> >
> > And we use it in tools/, sometime I add it while editing changelogs, like in
> > this patch:
> >
> >   [acme@zoo linux]$ git log tools/ | grep '^[ \t]\+Fixes:' | head -5
> >     Fixes: 582ec0829b3d ("perf stat: Fix per-socket output bug for uncore
> > events")
> >     Fixes: b685ac22b436 ("perf symbols: Add front end cache for DSO symbol
> > lookup")
> >     Fixes: 06b234ec26fd ("perf script: Don't assume evsel position of tracking
> > events")
> >     Fixes: d4957633bf9d ("perf report: Add infrastructure for a cycles
> > histogram")
> >     Fixes: 75186a9b09e4 ("perf probe: Fix to show lines of sys_ functions
> > correctly")
> >   [acme@zoo linux]$
> >
> > - Arnaldo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web