[Sound-open-firmware] [PATCH] [RFC]platform: calculate the percentage of cpu cycle

Liam Girdwood liam.r.girdwood at linux.intel.com
Thu Jun 21 12:10:11 CEST 2018


On Thu, 2018-06-21 at 12:04 +0200, Lauda, Tomasz wrote:
> Hi Zhigang,
> 
> 
> I think, that correct value for 400MHz clock is:
> 
> *#define CPU_CYCLE_PER_MS    400000000*
> 
> *
> *
> 
> Tomek
> **
> 
> 
> On 21.06.2018 11:59, zhigangw wrote:
> > I use this way to calculate the CPU usage in our firmware.
> > 
> > I am not sure this way is correct or not.
> > 
> > from this way, I found the percentage is very high when I only do the 
> > playback alone with tdm8 mode.
> > 
> > almost 95% CPU usage.
> > 
> > that is the reason I send this RFC.
> > 
> > please give me the feedback whether this way to calculate the CPU 
> > usage is correct or not.
> > 

This is broken, you are just timing DMA interrupts. Please enable verbose trace
and you should see all the calls time stamped.

Liam



More information about the Sound-open-firmware mailing list