From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Han, Huaitong" Subject: Re: [V5] x86/cpuidle: get accurate C0 value with xenpm tool Date: Wed, 20 May 2015 08:36:40 +0000 Message-ID: <1432110996.3436.12.camel@huaitong-MOBL.ccr.corp.intel.com> References: <1431580999-7886-1-git-send-email-huaitong.han@intel.com> <555B1802020000780007B7FC@mail.emea.novell.com> <1432089747.3436.9.camel@huaitong-MOBL.ccr.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1432089747.3436.9.camel@huaitong-MOBL.ccr.corp.intel.com> Content-Language: en-US Content-ID: <956BDAFF0790AA42B58DF9D9445428F0@intel.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: "JBeulich@suse.com" Cc: "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org 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, 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@lists.xen.org > http://lists.xen.org/xen-devel