[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [V5] x86/cpuidle: get accurate C0 value with xenpm tool



On Wed, 2015-05-20 at 02:42 +0000, Han, Huaitong wrote:
> On Tue, 2015-05-19 at 10:01 +0100, Jan Beulich wrote:
> > >>> On 14.05.15 at 07:23, <huaitong.han@xxxxxxxxx> wrote:
> > > @@ -1172,7 +1196,10 @@ int pmstat_get_cx_stat(uint32_t cpuid, struct 
> > > pm_cx_stat *stat)
> > >  {
> > >      struct acpi_processor_power *power = processor_powers[cpuid];
> > >      uint64_t idle_usage = 0, idle_res = 0;
> > > -    uint64_t usage[ACPI_PROCESSOR_MAX_POWER], 
> > > res[ACPI_PROCESSOR_MAX_POWER];
> > > +    uint64_t last_state_update_tick, current_stime, current_tick;
> > > +    uint64_t usage[ACPI_PROCESSOR_MAX_POWER] = { 0 };
> > > +    uint64_t res_ticks[ACPI_PROCESSOR_MAX_POWER] = { 0 };
> > > +    uint64_t res[ACPI_PROCESSOR_MAX_POWER] = { 0 };
> > 
> > Not yet another array on the stack please - I can't see why you
> > can't get away with just res[].
> res_ticks just is a temp array. I can use a temp variable for
> ticks_to_ns  transform, like "tmp=res[i];res[i]=ticks_to_ns(tmp);", and
> the array named res[] is better in terms of origin source code.
use "res[i]=ticks_to_ns((uint64_t)res[i])" without tmp varialbe.
> > Jan
> > 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxx
> http://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.