[Xenomai] realtime only with chrt command

Шевченко Тарас Григорьевич shevchenko.taras at triolcorp.com.ua
Sat May 5 10:02:01 CEST 2018


Good day! 

In attach my first code to test real-time Xenomai user space and kernel space 
Module toogle gpio pin by command from app 

the question is if i run my app with chrt -f 70 - i get hard real-time about -30 .. +30 mks , 
without command - there isnot predictable realtime reaction -500 ... + 500 mks 
maybe i use some not real-time code ? 



Below log from strace command 


root at yeti-UDOO-x86:~/develop/Xeno/userspace/posix_timer# strace ./posix_timer 300 
execve("./posix_timer", ["./posix_timer", "300"], [/* 33 vars */]) = 0 
brk(NULL) = 0x23e7000 
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) 
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory) 
open("tls/x86_64/libcobalt.so.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) 
open("tls/libcobalt.so.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) 
open("x86_64/libcobalt.so.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) 
open("libcobalt.so.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) 
open("/usr/xenomai/lib/tls/x86_64/libcobalt.so.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) 
stat("/usr/xenomai/lib/tls/x86_64", 0x7fffd9016610) = -1 ENOENT (No such file or directory) 
open("/usr/xenomai/lib/tls/libcobalt.so.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) 
stat("/usr/xenomai/lib/tls", 0x7fffd9016610) = -1 ENOENT (No such file or directory) 
open("/usr/xenomai/lib/x86_64/libcobalt.so.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) 
stat("/usr/xenomai/lib/x86_64", 0x7fffd9016610) = -1 ENOENT (No such file or directory) 
open("/usr/xenomai/lib/libcobalt.so.2", O_RDONLY|O_CLOEXEC) = 3 
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\200\300\0\0\0\0\0\0"..., 832) = 832 
fstat(3, {st_mode=S_IFREG|0755, st_size=176336, ...}) = 0 
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f06782f2000 
mmap(NULL, 2233832, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f0677eac000 
mprotect(0x7f0677ecc000, 2093056, PROT_NONE) = 0 
mmap(0x7f06780cb000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1f000) = 0x7f06780cb000 
mmap(0x7f06780cd000, 1512, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f06780cd000 
close(3) = 0 
open("tls/x86_64/libmodechk.so.0", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) 
open("tls/libmodechk.so.0", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) 
open("x86_64/libmodechk.so.0", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) 
open("libmodechk.so.0", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) 
open("/usr/xenomai/lib/libmodechk.so.0", O_RDONLY|O_CLOEXEC) = 3 
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0p\7\0\0\0\0\0\0"..., 832) = 832 
fstat(3, {st_mode=S_IFREG|0755, st_size=8376, ...}) = 0 
mmap(NULL, 2101328, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f0677caa000 
mprotect(0x7f0677cab000, 2093056, PROT_NONE) = 0 
mmap(0x7f0677eaa000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0) = 0x7f0677eaa000 
close(3) = 0 
open("tls/x86_64/libpthread.so.0", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) 
open("tls/libpthread.so.0", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) 
open("x86_64/libpthread.so.0", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) 
open("libpthread.so.0", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) 
open("/usr/xenomai/lib/libpthread.so.0", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) 
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3 
fstat(3, {st_mode=S_IFREG|0644, st_size=101024, ...}) = 0 
mmap(NULL, 101024, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f06782d9000 
close(3) = 0 
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) 
open("/lib/x86_64-linux-gnu/libpthread.so.0", O_RDONLY|O_CLOEXEC) = 3 
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\260`\0\0\0\0\0\0"..., 832) = 832 
fstat(3, {st_mode=S_IFREG|0755, st_size=138696, ...}) = 0 
mmap(NULL, 2212904, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f0677a8d000 
mprotect(0x7f0677aa5000, 2093056, PROT_NONE) = 0 
mmap(0x7f0677ca4000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x17000) = 0x7f0677ca4000 
mmap(0x7f0677ca6000, 13352, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f0677ca6000 
close(3) = 0 
open("tls/x86_64/librt.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) 
open("tls/librt.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) 
open("x86_64/librt.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) 
open("librt.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) 
open("/usr/xenomai/lib/librt.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) 
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) 
open("/lib/x86_64-linux-gnu/librt.so.1", O_RDONLY|O_CLOEXEC) = 3 
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\0!\0\0\0\0\0\0"..., 832) = 832 
fstat(3, {st_mode=S_IFREG|0644, st_size=31712, ...}) = 0 
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f06782d8000 
mmap(NULL, 2128832, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f0677885000 
mprotect(0x7f067788c000, 2093056, PROT_NONE) = 0 
mmap(0x7f0677a8b000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x6000) = 0x7f0677a8b000 
close(3) = 0 
open("tls/x86_64/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) 
open("tls/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) 
open("x86_64/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) 
open("libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) 
open("/usr/xenomai/lib/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) 
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) 
open("/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3 
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0P\t\2\0\0\0\0\0"..., 832) = 832 
fstat(3, {st_mode=S_IFREG|0755, st_size=1868984, ...}) = 0 
mmap(NULL, 3971488, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f06774bb000 
mprotect(0x7f067767b000, 2097152, PROT_NONE) = 0 
mmap(0x7f067787b000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1c0000) = 0x7f067787b000 
mmap(0x7f0677881000, 14752, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f0677881000 
close(3) = 0 
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f06782d7000 
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f06782d6000 
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f06782d5000 
arch_prctl(ARCH_SET_FS, 0x7f06782d6700) = 0 
mprotect(0x7f067787b000, 16384, PROT_READ) = 0 
mprotect(0x7f0677ca4000, 4096, PROT_READ) = 0 
mprotect(0x7f0677a8b000, 4096, PROT_READ) = 0 
mprotect(0x7f0677eaa000, 4096, PROT_READ) = 0 
mprotect(0x7f06780cb000, 4096, PROT_READ) = 0 
mprotect(0x601000, 4096, PROT_READ) = 0 
mprotect(0x7f06782f3000, 4096, PROT_READ) = 0 
munmap(0x7f06782d9000, 101024) = 0 
set_tid_address(0x7f06782d69d0) = 5459 
set_robust_list(0x7f06782d69e0, 24) = 0 
rt_sigaction(SIGRTMIN, {0x7f0677a92b50, [], SA_RESTORER|SA_SIGINFO, 0x7f0677a9e390}, NULL, 8) = 0 
rt_sigaction(SIGRT_1, {0x7f0677a92be0, [], SA_RESTORER|SA_RESTART|SA_SIGINFO, 0x7f0677a9e390}, NULL, 8) = 0 
rt_sigprocmask(SIG_UNBLOCK, [RTMIN RT_1], NULL, 8) = 0 
getrlimit(RLIMIT_STACK, {rlim_cur=8192*1024, rlim_max=RLIM64_INFINITY}) = 0 
open("/proc/self/cmdline", O_RDONLY) = 3 
brk(NULL) = 0x23e7000 
brk(0x2408000) = 0x2408000 
read(3, "./posix_timer\000300\0", 1024) = 18 
close(3) = 0 
gettid() = 5459 
rt_sigaction(SIGILL, {0x7f0677eb9630, [ILL], SA_RESTORER|SA_RESTART, 0x7f06774f04b0}, {SIG_DFL, [], 0}, 8) = 0 
rt_sigaction(SIGILL, {SIG_DFL, [ILL], SA_RESTORER|SA_RESTART, 0x7f06774f04b0}, {0x7f0677eb9630, [ILL], SA_RESTORER|SA_RESTART, 0x7f06774f04b0}, 8) = 0 
mlockall(MCL_CURRENT|MCL_FUTURE) = 0 
futex(0x7f06780cd09c, FUTEX_WAKE_PRIVATE, 2147483647) = 0 
futex(0x7f06780ccd88, FUTEX_WAKE_PRIVATE, 2147483647) = 0 
rt_sigaction(SIGXCPU, {0x7f0677eba220, [], SA_RESTORER|SA_SIGINFO, 0x7f0677a9e390}, {SIG_DFL, [], 0}, 8) = 0 
mmap(NULL, 8392704, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_STACK, -1, 0) = 0x7f0676cba000 
mprotect(0x7f0676cba000, 4096, PROT_NONE) = 0 
clone(child_stack=0x7f06774b9ff0, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tidptr=0x7f06774ba9d0, tls=0x7f06774ba700, child_tidptr=0x7f06774ba9d0) = 5460 
sched_getparam(5459, [0]) = 0 
sched_getscheduler(5459) = 0 (SCHED_OTHER) 
sched_get_priority_max(SCHED_FIFO) = 99 
sched_setscheduler(5459, SCHED_OTHER, [0]) = 0 
rt_sigprocmask(SIG_BLOCK, [WINCH], [], 8) = 0 
rt_sigaction(SIGWINCH, {0x7f0677ebe930, [], SA_RESTORER|SA_RESTART|SA_SIGINFO, 0x7f0677a9e390}, {SIG_DFL, [], 0}, 8) = 0 
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 
futex(0x7f06780ccf00, FUTEX_WAKE_PRIVATE, 2147483647) = 0 
mmap(NULL, 69632, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_STACK, -1, 0) = 0x7f06782e0000 
mprotect(0x7f06782e0000, 4096, PROT_NONE) = 0 
clone(child_stack=0x7f06782efff0, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tidptr=0x7f06782f09d0, tls=0x7f06782f0700, child_tidptr=0x7f06782f09d0) = 5461 
futex(0x7fffd9016d58, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 0, {1525506423, 0}, ffffffff) = -1 EAGAIN (Resource temporarily unavailable) 
mlockall(MCL_CURRENT|MCL_FUTURE) = 0 
futex(0x7f06782f09d0, FUTEX_WAIT, 5461, NULL^Cstrace: Process 5459 detached 
<detached ...> 




yeti at yeti-UDOO-x86:/usr/xenomai/sbin$ ./version 
Xenomai/cobalt v3.0.6 -- #6362141 (2018-04-19 19:18:33 +0200) 

yeti at yeti-UDOO-x86:/usr/xenomai/sbin$ uname -a 
Linux yeti-UDOO-x86 4.9.90-xenomai-ssd #1 SMP Mon Apr 23 15:10:51 EEST 2018 x86_64 x86_64 x86_64 GNU/Linux 

yeti at yeti-UDOO-x86:/usr/xenomai/bin$ sudo ./latency 
[sudo] password for yeti: 
== Sampling period: 100 us 
== Test mode: periodic user-mode task 
== All results in microseconds 
warming up... 
RTT| 00:00:01 (periodic user-mode task, 100 us period, priority 99) 
RTH|----lat min|----lat avg|----lat max|-overrun|---msw|---lat best|--lat worst 
RTD| 1.012| 2.888| 25.362| 0| 0| 1.012| 25.362 
RTD| 0.725| 3.068| 18.487| 0| 0| 0.725| 25.362 
RTD| 0.887| 2.992| 25.437| 0| 0| 0.725| 25.437 
RTD| 1.262| 2.989| 21.050| 0| 0| 0.725| 25.437 
RTD| 0.875| 2.792| 26.850| 0| 0| 0.725| 26.850 
RTD| 1.062| 2.956| 17.475| 0| 0| 0.725| 26.850 
RTD| 0.825| 2.754| 24.500| 0| 0| 0.725| 26.850 



-------------- next part --------------
A non-text attachment was scrubbed...
Name: udoo_gpio.c
Type: text/x-c++src
Size: 4166 bytes
Desc: not available
URL: <http://xenomai.org/pipermail/xenomai/attachments/20180505/2875422a/attachment.c>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Makefile
Type: text/x-makefile
Size: 369 bytes
Desc: not available
URL: <http://xenomai.org/pipermail/xenomai/attachments/20180505/2875422a/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Makefile
Type: text/x-makefile
Size: 426 bytes
Desc: not available
URL: <http://xenomai.org/pipermail/xenomai/attachments/20180505/2875422a/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: posix_timer.c
Type: text/x-c++src
Size: 3070 bytes
Desc: not available
URL: <http://xenomai.org/pipermail/xenomai/attachments/20180505/2875422a/attachment-0001.c>


More information about the Xenomai mailing list