📄 interrupt_latency.html
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html><head> <title></title> <link rel="stylesheet" media="screen" type="text/css" href="./style.css" /> <link rel="stylesheet" media="screen" type="text/css" href="./design.css" /> <link rel="stylesheet" media="print" type="text/css" href="./print.css" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head><body><a href=start.html>start</a></br><h1><a name="how_to_test_interrupt_latency_in_uclinux_on_blackfin" id="how_to_test_interrupt_latency_in_uclinux_on_blackfin">How to test interrupt latency in uClinux on Blackfin</a></h1><div class="level1"><p> Now we use a watchdog timer driver to test the interrupt in uClinux on Blackfin. It is in drivers/char/bfin_timer_latency.c. The process of testing is:</p><ul><li class="level1"><div class="li"> create a proc file /proc/timer_latency. Hook an ISR to watch dog timer (IVT13).</div></li><li class="level1"><div class="li"> When got a writing of “1” to this file, do following:</div><ul><li class="level2"><div class="li"> a). set a 5 seconds watch dog timer. </div></li><li class="level2"><div class="li"> b). Reset and start the CYCLES counter of Blackfin. (which increases by 1 every CCLK).</div></li><li class="level2"><div class="li"> c). After 5 seconds, watch dog generates an interrupt. In the ISR, read the CYCLES counter. The value should be a litter more than (5*CCLK). So the interrupt latency is (CYCLES value - (5*CCLK)) cycles. </div></li></ul></li><li class="level1"><div class="li"> When got a reading from this file, return the latency value (in cycles).</div></li></ul><p> Please be noted that this latency includes 3 parts:</p><ol><li class="level1"><div class="li"> Hardware latency.</div></li><li class="level1"><div class="li"> Context saving time before entering ISR. </div></li><li class="level1"><div class="li"> IRQ multimplexing time. (this part occupied more than half of the latency. It can be saved by not sharing the IRQ.)</div></li></ol><p>—-</p><p>So the simplest way to test the interrupt latency is:</p><ol><li class="level1"><div class="li"> Enable the timer_latency driver in “make menuconfig” –> “Customize kernel settings –> “char devices”.</div></li><li class="level1"><div class="li"> run " echo “1” > /proc/timer_latency " on Blackfin target.</div></li><li class="level1"><div class="li"> Wait more than 5 seconds, run " cat /proc/timer_latency " to get the latency.</div></li></ol><p>Of course you can also give the CPU any kind of load and/or use a script to test the result any times you want. </p></div></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -