imx6q xenomai ipipe-3.0-imx6q
Hello Gilles ,this is my test about xenomai ,this can also effect the my program and the latency test ,thanks 。
== Sampling period: 1000 us
== Test mode: in-kernel periodic task
== All results in microseconds
warming up...
RTT| 00:00:01 (in-kernel periodic task, 1000 us period, priority 99) RTH|----lat min|----lat avg|----lat max|-overrun|---msw|---lat best|--lat worst RTD| 0.452| 17.221| 16637.492| 16| 0| 0.452| 16637.492 RTD| 0.431| 17.253| 16641.974| 32| 0| 0.431| 16641.974 RTD| 0.459| 17.233| 16639.224| 48| 0| 0.431| 16641.974 RTD| 0.439| 17.231| 16638.423| 64| 0| 0.431| 16641.974 RTD| 0.454| 17.232| 16638.489| 80| 0| 0.431| 16641.974 RTD| 0.453| 17.223| 16638.569| 96| 0| 0.431| 16641.974 RTD| 0.440| 17.227| 16638.612| 112| 0| 0.431| 16641.974 RTD| 0.458| 17.224| 16637.822| 128| 0| 0.431| 16641.974 RTD| 0.407| 17.269| 16639.417| 144| 0| 0.407| 16641.974 RTD| 0.432| 17.237| 16638.607| 160| 0| 0.407| 16641.974 RTD| 0.442| 17.278| 16638.695| 176| 0| 0.407| 16641.974 RTD| 0.437| 17.226| 16639.202| 192| 0| 0.407| 16641.974 RTD| 0.427| 17.232| 16637.467| 208| 0| 0.407| 16641.974 RTD| 0.454| 17.280| 16638.828| 224| 0| 0.407| 16641.974 RTD| 0.421| 17.241| 16637.866| 240| 0| 0.407| 16641.974 RTD| 0.398| 17.236| 16639.530| 256| 0| 0.398| 16641.974 RTD| 0.431| 17.252| 16637.032| 272| 0| 0.398| 16641.974 RTD| 0.446| 17.256| 16638.845| 288| 0| 0.398| 16641.974 RTD| 0.446| 17.253| 16638.981| 304| 0| 0.398| 16641.974 RTD| 0.433| 17.243| 16637.329| 320| 0| 0.398| 16641.974
^C---|-----------|-----------|-----------|--------|------|-------------------------
RTS| 0.398| 17.242| 16641.974| 320| 0| 00:00:21/00:00:21
-sh-2.05b#
#include <stdio.h>
#include <signal.h>
#include <unistd.h>
#include <sys/mman.h>
#include <native/task.h>
#include <native/timer.h>
RT_TASK demo_task;
/* NOTE: error handling omitted. */
void demo(void *arg)
{
RTIME now, previous;
/*
* Arguments: &task (NULL=self),
* start time,
* period (here: 1 s)
*/
rt_task_set_periodic(NULL, TM_NOW, 1000000000);
previous = rt_timer_read();
long long i,j,k;
while (1) {
rt_task_wait_period(NULL);
now = rt_timer_read();
for(i=1;i<1000;i++)
for(j=1;j<i;j++)
k=i*j;
/*
* NOTE: printf may have unexpected impact on the timing of
* your program. It is used here in the critical loop
* only for demonstration purposes.
*/
printf("Time since last turn: %ld.%06ld ms\n",
(long)(now - previous) / 1000000,
(long)(now - previous) % 1000000);
previous = now;
}
}void catch_signal(int sig)
{
}
int main(int argc, char* argv[])
{
signal(SIGTERM, catch_signal);
signal(SIGINT, catch_signal);
/* Avoids memory swapping for this program */
mlockall(MCL_CURRENT|MCL_FUTURE);
/*
* Arguments: &task,
* name,
* stack size (0=default),
* priority,
* mode (FPU, start suspended, ...)
*/
rt_task_create(&demo_task, "trivial", 0, 99, 0);
/*
* Arguments: &task,
* task function,
* function argument
*/
rt_task_start(&demo_task, &demo, NULL);
pause();
rt_task_delete(&demo_task);
}Quoted 3 lines · 嵌入式工程师
Hello Gilles ,this is my test about xenomai ,this can also effect the my program and the latency test
,thanks 。
For the third time: running the latency test while other real-time activity is running gives meaningless results. Here, the following piece of code:
Quoted 3 lines
for(i=1;i<1000;i++)
for(j=1;j<i;j++)
k=i*j;
Takes 1.6ms to execute, this is what the latency test measures.
Signature · 1 line
Gilles.
I know latency test can not run with e other real-time activity, but my program will run some real-time activties at the same time ,now it looks like because multiple cpu shared memory causes a great difference jitter .
Quoted 16 lines · 在 2014-04-01 18:49:17,"Gilles Chanteperdrix"…
Quoted 3 lines · 嵌入式工程师
Hello Gilles ,this is my test about xenomai ,this can also effect the my program and the latency test
,thanks 。For the third time: running the latency test while other real-time activity is running gives meaningless results. Here, the following piece of code:
Quoted 3 lines
for(i=1;i<1000;i++)
for(j=1;j<i;j++)
k=i*j;Takes 1.6ms to execute, this is what the latency test measures.
Signature · 1 line
Gilles.
Quoted 4 lines · 嵌入式工程师
I know latency test can not run with e other real-time activity, but my program will run some real-time activties at the same time ,now it looks like because multiple cpu shared memory causes a great difference jitter .
That is not your problem. Your problem is that if you run a task with priority 99 on the same cpu as the latency test, the time this task prevents the latency test from running is counted by the latency test as latency, which gives wrong results. This is not latency, this is simply the scheduler doing its job: letting a task running until it suspends before letting the latency task running. That is because the two tasks have the same priority.
Signature · 1 line
Gilles.
oh ,thanks
Quoted 16 lines · 在 2014-04-02 15:28:10,"Gilles Chanteperdrix"…
Quoted 4 lines · 嵌入式工程师
I know latency test can not run with e other real-time activity, but my program will run some real-time activties at the same time ,now it looks like because multiple cpu shared memory causes a great difference jitter .
That is not your problem. Your problem is that if you run a task with priority 99 on the same cpu as the latency test, the time this task prevents the latency test from running is counted by the latency test as latency, which gives wrong results. This is not latency, this is simply the scheduler doing its job: letting a task running until it suspends before letting the latency task running. That is because the two tasks have the same priority.
Signature · 1 line
Gilles.