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

zhigangw zhigang.wu at linux.intel.com
Mon Jun 25 11:16:42 CEST 2018



On 2018年06月25日 14:28, Liam Girdwood wrote:
> On Mon, 2018-06-25 at 11:20 +0800, zhigangw wrote:
>> On 2018年06月22日 18:13, Liam Girdwood wrote:
>>> On Fri, 2018-06-22 at 16:46 +0800, zhigangw wrote:
>>>>> Liam
>>>> I want to estimate the CPU usage.
>>>> How to estimate this with the verbose trace.
>>>> Do you have any idea?
>>> The pipeline work can be timed by looking at the pipeline schedule start and
>>> finish trace messages and the time delta between them.
>>>
>>> e.g. consider a pipeline with a 1ms scheduling tick that takes 200uS to run
>>> from
>>> start to finish. The pipeline CPU utilisation is 20%
>>>
>>> Liam
>> Hmm, this way would not take the scheduler period into account.
>> And using the timestamp, I am not sure  whether it is accurate than
>> using the CCOUNT register.
>> I will give another RFC later. please check it.
>> Thanks
>> ~Zhigang
>>
> Trace takes all parts of the scheduler/pipeline into account. You can
> enable/disable any trace message you like in order to time events. Please use
> trace and move on.
>
> Liam
Hello Liam:
Maybe my question is stupid,
I think the pipeline's start point is over here in dai_dma_cb() function:

     if (dev->state == COMP_STATE_ACTIVE) {
         /* I will add the trace code here to print as pipeline start 
point */
         pipeline_schedule_copy(dev->pipeline, 0);
     }

Where is the finish point of the pipeline? :-

Thanks
~zhigang





More information about the Sound-open-firmware mailing list