Re: [Intel-gfx] [RFC v2 2/3] drm/i915/pmu: serve global events and support perf stat

2017-08-31 Thread Peter Zijlstra
On Wed, Aug 30, 2017 at 05:24:30PM +, Rogozhkin, Dmitry V wrote: > Ok... but they could register for just cpu0. Besides, it looks like on > Linux cpu0 can't go offline at all at least of x86 architecture. Peter, > could you, please, clarify the reasoning to register designated readers > of unco

Re: [Intel-gfx] [RFC v2 2/3] drm/i915/pmu: serve global events and support perf stat

2017-08-31 Thread Peter Zijlstra
On Wed, Aug 30, 2017 at 05:24:30PM +, Rogozhkin, Dmitry V wrote: > I figured out how to track cpus online/offline status in PMU. Here is a > question however. What is the reason for uncore PMUs (cstate.c for > example) to register for cpus other than cpu0? I see it registers for > first thread

Re: [Intel-gfx] [RFC v2 2/3] drm/i915/pmu: serve global events and support perf stat

2017-08-30 Thread Rogozhkin, Dmitry V
On Tue, 2017-08-29 at 11:28 +0200, Peter Zijlstra wrote: > On Wed, Aug 23, 2017 at 11:38:43PM +, Rogozhkin, Dmitry V wrote: > > On Wed, 2017-08-23 at 08:26 -0700, Dmitry Rogozhkin wrote: > > > +static cpumask_t i915_pmu_cpumask = CPU_MASK_CPU0; > > > > Peter, this hardcoding of cpumask to use

Re: [Intel-gfx] [RFC v2 2/3] drm/i915/pmu: serve global events and support perf stat

2017-08-29 Thread Peter Zijlstra
On Wed, Aug 23, 2017 at 11:38:43PM +, Rogozhkin, Dmitry V wrote: > On Wed, 2017-08-23 at 08:26 -0700, Dmitry Rogozhkin wrote: > > +static cpumask_t i915_pmu_cpumask = CPU_MASK_CPU0; > > Peter, this hardcoding of cpumask to use CPU0 works, but should I > implement something smarter or this will

Re: [Intel-gfx] [RFC v2 2/3] drm/i915/pmu: serve global events and support perf stat

2017-08-28 Thread Rogozhkin, Dmitry V
Peter, any comments? On Wed, 2017-08-23 at 23:38 +, Rogozhkin, Dmitry V wrote: > On Wed, 2017-08-23 at 08:26 -0700, Dmitry Rogozhkin wrote: > > +static cpumask_t i915_pmu_cpumask = CPU_MASK_CPU0; > > > Peter, this hardcoding of cpumask to use CPU0 works, but should I > implement something sm

Re: [Intel-gfx] [RFC v2 2/3] drm/i915/pmu: serve global events and support perf stat

2017-08-23 Thread Rogozhkin, Dmitry V
On Wed, 2017-08-23 at 08:26 -0700, Dmitry Rogozhkin wrote: > +static cpumask_t i915_pmu_cpumask = CPU_MASK_CPU0; Peter, this hardcoding of cpumask to use CPU0 works, but should I implement something smarter or this will be sufficient? I see that cstate.c you have pointed me to tries to track CPUs

[Intel-gfx] [RFC v2 2/3] drm/i915/pmu: serve global events and support perf stat

2017-08-23 Thread Dmitry Rogozhkin
This patch should probably be squashed with Tvrtko's PMU enabling patch... Making perf-stat workable with i915 PMU. The major point is that current implementation of i915 PMU exposes global counter rather thatn per-task counters. Thus, required changes are: * Register PMU with .task_ctx_nr=perf_in