RE: [PATCH V2 04/13] perf/core: output multiplexing overhead

2016-12-06 Thread Liang, Kan


> On Fri, Dec 02, 2016 at 04:19:12PM -0500, kan.li...@intel.com wrote:
> > From: Kan Liang 
> >
> > Multiplexing overhead is one of the key overhead when the number of
> > events is more than available counters.
> >
> > The multiplexing overhead PERF_CORE_MUX_OVERHEAD is a common
> overhead
> > type.
> >
> 
> > diff --git a/include/uapi/linux/perf_event.h
> > b/include/uapi/linux/perf_event.h index fe7b1fb..355086f 100644
> > --- a/include/uapi/linux/perf_event.h
> > +++ b/include/uapi/linux/perf_event.h
> > @@ -999,6 +999,7 @@ struct perf_branch_entry {
> >   */
> >  enum perf_record_overhead_type {
> > PERF_CORE_OVERHEAD   = 0,
> > +   PERF_CORE_MUX_OVERHEAD   = 0,
> 
> '0' already had a name ?!

PERF_CORE_OVERHEAD is only used to indicate the start of core
overhead type.
I will use comment line to replace PERF_CORE_OVERHEAD. 

Thanks,
Kan


RE: [PATCH V2 04/13] perf/core: output multiplexing overhead

2016-12-06 Thread Liang, Kan


> On Fri, Dec 02, 2016 at 04:19:12PM -0500, kan.li...@intel.com wrote:
> > From: Kan Liang 
> >
> > Multiplexing overhead is one of the key overhead when the number of
> > events is more than available counters.
> >
> > The multiplexing overhead PERF_CORE_MUX_OVERHEAD is a common
> overhead
> > type.
> >
> 
> > diff --git a/include/uapi/linux/perf_event.h
> > b/include/uapi/linux/perf_event.h index fe7b1fb..355086f 100644
> > --- a/include/uapi/linux/perf_event.h
> > +++ b/include/uapi/linux/perf_event.h
> > @@ -999,6 +999,7 @@ struct perf_branch_entry {
> >   */
> >  enum perf_record_overhead_type {
> > PERF_CORE_OVERHEAD   = 0,
> > +   PERF_CORE_MUX_OVERHEAD   = 0,
> 
> '0' already had a name ?!

PERF_CORE_OVERHEAD is only used to indicate the start of core
overhead type.
I will use comment line to replace PERF_CORE_OVERHEAD. 

Thanks,
Kan


Re: [PATCH V2 04/13] perf/core: output multiplexing overhead

2016-12-06 Thread Peter Zijlstra
On Fri, Dec 02, 2016 at 04:19:12PM -0500, kan.li...@intel.com wrote:
> From: Kan Liang 
> 
> Multiplexing overhead is one of the key overhead when the number of
> events is more than available counters.
> 
> The multiplexing overhead PERF_CORE_MUX_OVERHEAD is a common overhead
> type.
> 

> diff --git a/include/uapi/linux/perf_event.h b/include/uapi/linux/perf_event.h
> index fe7b1fb..355086f 100644
> --- a/include/uapi/linux/perf_event.h
> +++ b/include/uapi/linux/perf_event.h
> @@ -999,6 +999,7 @@ struct perf_branch_entry {
>   */
>  enum perf_record_overhead_type {
>   PERF_CORE_OVERHEAD   = 0,
> + PERF_CORE_MUX_OVERHEAD   = 0,

'0' already had a name ?!

>  
>   PERF_PMU_OVERHEAD= 20,
>   PERF_PMU_SAMPLE_OVERHEAD = 20,

Same here I suppose, why are there two with the same name?

> diff --git a/kernel/events/core.c b/kernel/events/core.c
> index 306bc92..025a19d 100644
> --- a/kernel/events/core.c
> +++ b/kernel/events/core.c
> @@ -1830,6 +1830,9 @@ event_sched_out(struct perf_event *event,
>   if (event->attr.exclusive || !cpuctx->active_oncpu)
>   cpuctx->exclusive = 0;
>  
> + if (log_overhead && cpuctx->mux_overhead.nr)
> + perf_log_overhead(event, PERF_CORE_MUX_OVERHEAD, 
> >mux_overhead);
> +

This isn't mentioned in the Changelog. Why is it here?

>   perf_pmu_enable(event->pmu);
>  }
>  


Re: [PATCH V2 04/13] perf/core: output multiplexing overhead

2016-12-06 Thread Peter Zijlstra
On Fri, Dec 02, 2016 at 04:19:12PM -0500, kan.li...@intel.com wrote:
> From: Kan Liang 
> 
> Multiplexing overhead is one of the key overhead when the number of
> events is more than available counters.
> 
> The multiplexing overhead PERF_CORE_MUX_OVERHEAD is a common overhead
> type.
> 

> diff --git a/include/uapi/linux/perf_event.h b/include/uapi/linux/perf_event.h
> index fe7b1fb..355086f 100644
> --- a/include/uapi/linux/perf_event.h
> +++ b/include/uapi/linux/perf_event.h
> @@ -999,6 +999,7 @@ struct perf_branch_entry {
>   */
>  enum perf_record_overhead_type {
>   PERF_CORE_OVERHEAD   = 0,
> + PERF_CORE_MUX_OVERHEAD   = 0,

'0' already had a name ?!

>  
>   PERF_PMU_OVERHEAD= 20,
>   PERF_PMU_SAMPLE_OVERHEAD = 20,

Same here I suppose, why are there two with the same name?

> diff --git a/kernel/events/core.c b/kernel/events/core.c
> index 306bc92..025a19d 100644
> --- a/kernel/events/core.c
> +++ b/kernel/events/core.c
> @@ -1830,6 +1830,9 @@ event_sched_out(struct perf_event *event,
>   if (event->attr.exclusive || !cpuctx->active_oncpu)
>   cpuctx->exclusive = 0;
>  
> + if (log_overhead && cpuctx->mux_overhead.nr)
> + perf_log_overhead(event, PERF_CORE_MUX_OVERHEAD, 
> >mux_overhead);
> +

This isn't mentioned in the Changelog. Why is it here?

>   perf_pmu_enable(event->pmu);
>  }
>