Weird Linux Performance Counter Behaviour

Ask questions about Arch Linux ARM. Please search before making a new topic.

Weird Linux Performance Counter Behaviour

Postby np88 » Thu Jun 06, 2013 4:48 pm

Hi,
I am running Linux on a zc702 board with arm cortex a9 on it. I want to do some time measuring and am accessing the performance counter to get the cycles measured.

The experiment is like this: I am triggering an interrupt every 5 ms. The ISR sends a signal to a user application which reads the cycles from the register and also reads the current time via clock_gettime(). I also read the cycles in the ISR. The frequency of the CPU is 666MHz. The problem is, that the cycle values seem to be wrong. If I compare two subsequent values from the ISR, I get for example: 2956835712 and 2955811130. The difference between them ist 1024582. In ms it is about 1,5 instead of the expected 5 ms. I am sure that the interrupt is occurring in the right frequency.

I have already used the cycle counter with FreeRTOS on the same platform and it worked very well.

Does anybody have an idea what is wrong here? I have tried to turn of all profiling and power management options in the kernel, but still the same problem! Any ideas are appreciated!
np88
 
Posts: 3
Joined: Thu Jun 06, 2013 3:51 pm

Re: Weird Linux Performance Counter Behaviour

Postby np88 » Fri Jun 07, 2013 8:07 am

I have tracked down the problem:
In my program which is waiting for the signal I have started an extra task which is simply counting up an variable. This makes sure, the CPU is never idle and the performance counter keeps increasing permanently. So the problem in Linux seems to be that the CPU is powered of in idle mode so that the counter is not increasing. Anybody knows how to solve that?
np88
 
Posts: 3
Joined: Thu Jun 06, 2013 3:51 pm

Re: Weird Linux Performance Counter Behaviour

Postby np88 » Mon Jun 10, 2013 12:36 pm

nobody???
np88
 
Posts: 3
Joined: Thu Jun 06, 2013 3:51 pm


Return to User Questions

Who is online

Users browsing this forum: No registered users and 6 guests