issue when porting a linux posix applicaiton to a xenomai application

huang.mb at softlinkcloud.cn huang.mb at softlinkcloud.cn
Sun Apr 26 13:04:35 CEST 2020


Hi all:

i have ported a c based application which is a profinet network stack  and it was running ok in common x86 linux platform as a regular process except some realtime issue.

For the realtime issue,i have to ported to a xenomai application

The profinet application using the posix interface so i use xenomai 3.1's posix skin for the porting.

But after i had ported it to the xenomai-posix one ,i found it could receive network message but it failed to send the message out. (by comparison to  the regular one using
"watch -n 0.1 ifconfig eth0"). It seemed that some thread's blocking and i did not known how to investegate the issue.

The  /proc/xenomai/sched/stat was like this:
CPU  PID    MSW        CSW        XSC        PF    STAT       %CPU  NAME
  0  0      0          0          0          0     00218000  100.0  [ROOT/0]
  1  0      0          0          0          0     00218000  100.0  [ROOT/1]
  2  0      0          119332     0          0     00218000  100.0  [ROOT/2]
  3  0      0          174171     0          0     00218000   99.8  [ROOT/3]
  3  1721   14         2749       2930       0     00248044    0.0  dksw_linux
  3  1723   2          4          7          0     00242042    0.0  Task_ASYNC_Timer
  3  1724   2          4          4          0     00242042    0.0  Task_OS_Timer
  3  1725   4          23         69         0     00242042    0.0  PrintRS232PostTask
  3  1726   2          3          3          0     00242042    0.0  Pnio_NvData
  3  1727   3          5453       5448       0     0024a044    0.0  Pnio_Idle
  3  1728   7          27         188        0     0024a0c0    0.0  MainAppl
  3  1729   2          135222     676095     0     0024a044    0.1  Pnio_CycleIO
  3  1730   3463       3463       3464       0     0024a0c0    0.0  sniff_packet
  3  1731   11         27219      27448      0     0024a044    0.0  t_IDL
  3  1732   6          84         215        0     0024a042    0.0  t_APP
  3  1733   459        4661       8961       0     0024a042    0.0  t_EDD
  3  1734   2          112        166        0     0024a042    0.0  t_ORG
  3  1735   30         1071       7346       0     0024a042    0.0  t_PNO
  3  1736   3          2465       5339       0     0024a042    0.0  t_TCP
  3  1737   2          26         42         0     0024a042    0.0  t_POF
  3  1738   2          10         10         0     00242042    0.0  t_REM
  3  1739   3          53         85         0     0024a042    0.0  t_STP
  3  1740   2          5          30         0     0024a042    0.0  Pnio_PnpbPost
  3  1741   2          25         138        0     0024a042    0.0  Pnio_Pnpb
  0  0      0          165200     0          0     00000000    0.0  [IRQ2305: [timer]]
  1  0      0          12551      0          0     00000000    0.0  [IRQ2305: [timer]]
  2  0      0          893793     0          0     00000000    0.0  [IRQ2305: [timer]]
  3  0      0          2791299    0          0     00000000    0.1  [IRQ2305: [timer]]
the /proc/xenomai/sched/thread was like this:
CPU  PID    CLASS  TYPE      PRI   TIMEOUT       STAT       NAME
  0  0      idle   core       -1   -             R          [ROOT/0]
  1  0      idle   core       -1   -             R          [ROOT/1]
  2  0      idle   core       -1   -             R          [ROOT/2]
  3  0      idle   core       -1   -             R          [ROOT/3]
  3  1721   rt     cobalt     19   698ms369us    D          dksw_linux
  3  1723   rt     cobalt     20   -             Wr         Task_ASYNC_Timer
  3  1724   rt     cobalt     20   -             Wr         Task_OS_Timer
  3  1725   rt     cobalt      6   -             Wr         PrintRS232PostTask
  3  1726   rt     cobalt      5   -             Wr         Pnio_NvData
  3  1727   rt     cobalt      1   461ms50us     Dr         Pnio_Idle
  3  1728   rt     cobalt      4   -             Xr         MainAppl
  3  1729   rt     cobalt     19   8ms828us      Dr         Pnio_CycleIO
  3  1730   rt     cobalt     19   -             Xr         sniff_packet
  3  1731   rt     cobalt     11   98ms679us     Dr         t_IDL
  3  1732   rt     cobalt     10   -             Wr         t_APP
  3  1733   rt     cobalt     18   -             Wr         t_EDD
  3  1734   rt     cobalt     17   -             Wr         t_ORG
  3  1735   rt     cobalt     16   -             Wr         t_PNO
  3  1736   rt     cobalt     15   -             Wr         t_TCP
  3  1737   rt     cobalt     14   -             Wr         t_POF
  3  1738   rt     cobalt     13   -             Wr         t_REM
  3  1739   rt     cobalt     12   -             Wr         t_STP
  3  1740   rt     cobalt     10   -             Wr         Pnio_PnpbPost
  3  1741   rt     cobalt      9   -             Wr         Pnio_Pnpb

the dmesg about xenomai:

[    0.000000] Linux version 3.18.20-xenomai-3.1-20200417-02 (root at cpac) (gcc version 5.5.0 20171010 (Ubuntu 5.5.0-12ubuntu1) ) #1 SMP Fri Apr 17 16:23:12 HKT 2020
[    0.000000] Kernel command line: BOOT_IMAGE=/vmlinuz-3.18.20-xenomai-3.1-20200417-02 root=UUID=2851ab9b-1766-41a0-b882-3caa9a975bf6 ro isolcpus=1 quiet splash text vt.handoff=7
[    1.257922] [Xenomai] scheduling class idle registered.
[    1.257926] [Xenomai] scheduling class rt registered.
[    1.257969] [Xenomai] SMI-enabled chipset found, but SMI workaround disabled
[    1.257969]           (see xenomai.smi parameter). You might encounter
[    1.258005] I-pipe: head domain Xenomai registered.
[    1.260837] [Xenomai] Cobalt v3.1 [DEBUG]
[    1.371562] usb usb1: Manufacturer: Linux 3.18.20-xenomai-3.1-20200417-02 ehci_hcd

my application cmake xenomai compiling setting:

execute_process(COMMAND xeno-config --posix --cflags OUTPUT_VARIABLE XENO_CFLAGS OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(COMMAND xeno-config --posix --ldflags OUTPUT_VARIABLE XENO_LDFLAGS OUTPUT_STRIP_TRAILING_WHITESPACE)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${XENO_CFLAGS}")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${XENO_LDFLAGS}")

my hardware platform and os is 

Intel(R) Celeron(R) CPU  J1900  @ 1.99GHz i686
Ubuntu 14.04 3.18.20 

can any one help me to find out why this posix porting application behaviour abnormaly comparing to the regular one using the above data.

what measures should i take to make sure it has same thread running behaviour after poting to the xenomai-posix one.




Best Regards
Huang Mianbo
电话:+8613682612959


More information about the Xenomai mailing list