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


Groups > linux.kernel > #1537059

RE: [PATCH V2 03/13] perf/x86: output sampling overhead

From "Liang, Kan" <kan.liang@intel.com>
Newsgroups linux.kernel
Subject RE: [PATCH V2 03/13] perf/x86: output sampling overhead
Date 2016-12-06 16:50 +0100
Message-ID <sLqaf-3UD-103@gated-at.bofh.it> (permalink)
References <sK3z3-Gp-3@gated-at.bofh.it> <sK3z3-Gp-1@gated-at.bofh.it> <sLm6B-1mB-19@gated-at.bofh.it> <sLpxw-3FC-19@gated-at.bofh.it> <sLq0y-3PO-51@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw



> On Tue, Dec 06, 2016 at 03:02:20PM +0000, Liang, Kan wrote:
> >
> >
> > > On Fri, Dec 02, 2016 at 04:19:11PM -0500, kan.liang@intel.com wrote:
> > > > From: Kan Liang <kan.liang@intel.com>
> > > >
> > > > On x86, NMI handler is the most important part which brings
> > > > overhead for sampling. Adding a pmu specific overhead type
> > > > PERF_PMU_SAMPLE_OVERHEAD for it.
> > > >
> > > > For other architectures which may don't have NMI, the overhead
> > > > type can be reused.
> > > >
> > > > Signed-off-by: Kan Liang <kan.liang@intel.com>
> > > > ---
> > > >  arch/x86/events/core.c          | 17 ++++++++++++++++-
> > > >  arch/x86/events/perf_event.h    |  2 ++
> > > >  include/uapi/linux/perf_event.h |  1 +
> > > >  3 files changed, 19 insertions(+), 1 deletion(-)
> > > >
> > > > diff --git a/arch/x86/events/core.c b/arch/x86/events/core.c index
> > > > 9d4bf3a..de40f96 100644
> > > > --- a/arch/x86/events/core.c
> > > > +++ b/arch/x86/events/core.c
> > > > @@ -1397,6 +1397,9 @@ static void x86_pmu_del(struct perf_event
> > > > *event, int flags)
> > > >
> > > >  	perf_event_update_userpage(event);
> > > >
> > > > +	if ((flags & PERF_EF_LOG) && cpuc->nmi_overhead.nr)
> > > > +		perf_log_overhead(event, PERF_PMU_SAMPLE_OVERHEAD,
> > > > +&cpuc->nmi_overhead);
> > > > +
> > > >  do_del:
> > > >  	if (x86_pmu.del) {
> > > >  		/*
> > >
> > > That's not at all mentioned in the changelog, and it clearly isn't
> > > nmi_overhead.
> >
> > Here it only records the overhead, not calculate.
> 
> It doesn't record anything, it generates the output. And it doesn't explain
> why that needs to be in pmu::del(), in general that's a horrible thing to do.

Yes, it only generate/log the output. Sorry for the confused wording.

The NMI overhead is pmu specific overhead. So the NMI overhead output
should be generated in pmu code.  
I assume that the pmu:del is the last called pmu function when perf finish.
Is it a good place for logging?

Thanks,
Kan

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH V2 03/13] perf/x86: output sampling overhead kan.liang@intel.com - 2016-12-02 22:30 +0100
  Re: [PATCH V2 03/13] perf/x86: output sampling overhead Peter Zijlstra <peterz@infradead.org> - 2016-12-06 12:30 +0100
    RE: [PATCH V2 03/13] perf/x86: output sampling overhead "Liang, Kan" <kan.liang@intel.com> - 2016-12-06 16:10 +0100
      Re: [PATCH V2 03/13] perf/x86: output sampling overhead Peter Zijlstra <peterz@infradead.org> - 2016-12-06 16:40 +0100
        RE: [PATCH V2 03/13] perf/x86: output sampling overhead "Liang, Kan" <kan.liang@intel.com> - 2016-12-06 16:50 +0100
          Re: [PATCH V2 03/13] perf/x86: output sampling overhead Peter Zijlstra <peterz@infradead.org> - 2016-12-06 19:30 +0100
            RE: [PATCH V2 03/13] perf/x86: output sampling overhead "Liang, Kan" <kan.liang@intel.com> - 2016-12-07 20:10 +0100
  Re: [PATCH V2 03/13] perf/x86: output sampling overhead Peter Zijlstra <peterz@infradead.org> - 2016-12-06 13:10 +0100

csiph-web