Re: [PATCH V4 02/16] perf, core: introduce pmu context switch callback

2014-07-02 Thread Yan, Zheng
On 07/02/2014 06:12 PM, Peter Zijlstra wrote: > On Mon, Jun 30, 2014 at 04:50:39PM +0800, Yan, Zheng wrote: >> @@ -2362,6 +2363,58 @@ unlock: >> } >> } >> >> +void perf_sched_cb_disable(struct pmu *pmu) >> +{ >> +__get_cpu_var(perf_sched_cb_usages)--; >> +} >> + >> +void perf_sched_cb_e

Re: [PATCH V4 02/16] perf, core: introduce pmu context switch callback

2014-07-02 Thread Peter Zijlstra
On Mon, Jun 30, 2014 at 04:50:39PM +0800, Yan, Zheng wrote: > @@ -2362,6 +2363,58 @@ unlock: > } > } > > +void perf_sched_cb_disable(struct pmu *pmu) > +{ > + __get_cpu_var(perf_sched_cb_usages)--; > +} > + > +void perf_sched_cb_enable(struct pmu *pmu) > +{ > + __get_cpu_var(perf_s

Re: [PATCH V4 02/16] perf, core: introduce pmu context switch callback

2014-07-02 Thread Peter Zijlstra
On Mon, Jun 30, 2014 at 04:50:39PM +0800, Yan, Zheng wrote: > diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h > index 707617a..71fb77a 100644 > --- a/include/linux/perf_event.h > +++ b/include/linux/perf_event.h > @@ -262,6 +262,12 @@ struct pmu { >* flush branch stack

[PATCH V4 02/16] perf, core: introduce pmu context switch callback

2014-06-30 Thread Yan, Zheng
The callback is invoked when process is scheduled in or out. It provides mechanism for later patches to save/store the LBR stack. For the schedule in case, the callback is invoked at the same place that flush branch stack callback is invoked. So it also can replace the flush branch stack callback.

[PATCH v4 02/16] perf, core: introduce pmu context switch callback

2014-03-16 Thread Yan, Zheng
The callback is invoked when process is scheduled in or out. It provides mechanism for later patches to save/store the LBR stack. For the schedule in case, the callback is invoked at the same place that flush branch stack callback is invoked. So it also can replace the flush branch stack callback.