NXP / isochron

Tool for Time Sensitive Networking testing
GNU General Public License v2.0
42 stars 13 forks source link

PREEMPT_RT #7

Closed crow1814 closed 2 years ago

crow1814 commented 3 years ago

Hi, Vladimir, I got the accuracy of the cycle of jitter is 1ms on ubuntu 20.04 without PREEMPT_RT. I notice that you mentioned, "the worst-case interrupt wakeup latencies are low (ideally around 10 us or lower)". Does this mean the accuracy of the cycle of jitter can be 10us? I have Installed RT Linux patch for Ubuntu 20.04, but the accuracy of the cycle is still 1ms. How can I use the RT patch? How should I improve the accuracy of cycle?

vladimiroltean commented 2 years ago

Hello, You are using some terms which I do not understand. What is a "cycle of jitter"? And what is its accuracy? To help you get a better understanding of how to debug latency-related issues, I have made some changes to isochron which are now available in the master branch. You can also check the "docs" folder for full documentation. There are also some example commands posted there, please look at arguments such as "--sched-rr" and "--sched-priority" which are used to tell the kernel task scheduler that the application needs a high priority and low wake-up jitter. That is about the only thing you can do to reduce the wake-up time overhead. You can measure it using a command such as:

root@debian:~# isochron report --input-file isochron.log --summary
Summary:
Path delay: min 529 max 2804 mean 814.753 stddev 138.195, min at seqid 566192, max at seqid 556222
Wakeup to HW TX timestamp: min 296598 max 433773 mean 429379.807 stddev 1505.453, min at seqid 258170, max at seqid 866331
Packets arrived later than scheduled. TX time to HW RX timestamp: min 754 max 3039 mean 1046.891 stddev 138.338, min at seqid 566397, max at seqid 556228
MAC latency: min 217 max 253 mean 232.138 stddev 7.519, min at seqid 999995, max at seqid 950475
Sender latency: min 24201 max 183808 mean 25323.232 stddev 959.748, min at seqid 375818, max at seqid 285025
Wakeup latency: min 16464 max 153633 mean 20852.331 stddev 1505.426, min at seqid 866331, max at seqid 258170
Driver latency: min 13400 max 172608 mean 14037.817 stddev 663.155, min at seqid 996797, max at seqid 285025
Arrival latency: min 36897 max 4685558 mean 148027.880 stddev 95499.954, min at seqid 506196, max at seqid 339027
Sending one packet takes on average 5.065% of the cycle time (min 4.840% max 36.762%)
Waking up takes on average 4.170% of the cycle time (min 3.293% max 30.727%)
Driver takes on average 2.808% of the cycle time to send a packet (min 2.680% max 34.522%)

(where the isochron.log was generated by the sender) That summary clearly explains, I think, where most of the time is spent on average on your system. Hope this helps.

vladimiroltean commented 2 years ago

I am going to close this stale ticket.