Skip to content
  • chensong's avatar
    testsuite: App of gpio loopback/react benchmark · 0bcfce8f
    chensong authored and Jan Kiszka's avatar Jan Kiszka committed
    
    
    This a tool to benchmark the latency of GPIO driver,
    it's able to run 2 kinds of benchmark test:
    
    1, loopback mode
    1) apply 2 gpio pins by calling service in gpio RTDM driver
       like gpio-bcm2835 and gpio-core.c, one is as output,
       the other is as interrupt
    2) call write_rt to send a pulse from output
    3) call read_rt to get timestamps recorded in driver (inner loop)
    4) also record timespace in user space(outer_loop)
       outer_loop is inner_loop plus overhead of event wakeup
    5) ftrace enable/disable
    
    2, react mode
    1) apply 2 gpio pins by calling service in gpio RTDM driver
       like gpio-bcm2835 and gpio-core.c, one is as ourput,
       the other is as interrupt
    2) call read_rt to wait for a pulse from latency box
    3) call write_rt to send a signal back to latency box
       as a reaction
    4) latency box calculates the diff and makes the histogram
    
    e.g.:
    1) react mode:
       gpiobench -o 20 -i 21 -c pinctrl-bcm2835 -m 1 -l 1000
    2) loopback mode:
       gpiobench -o 20 -i 21 -c pinctrl-bcm2835 -m 0 -l 1000 -h 100 -b 50
    
    CC: Jan Kiszka <jan.kiszka@siemens.com>
    CC: Greg Gallagher <greg@embeddedgreg.com>
    
    Signed-off-by: default avatarchensong <chensong@tj.kylinos.cn>
    [Jan: fixed time delta calculation and output for 32-bit targets]
    Signed-off-by: default avatarJan Kiszka <jan.kiszka@siemens.com>
    0bcfce8f