brendangregg / perf-tools

Performance analysis tools based on Linux perf_events (aka perf) and ftrace
GNU General Public License v2.0
9.9k stars 1.65k forks source link

iolatency tool, awk bug with tmux process #119

Open mattthhh opened 6 months ago

mattthhh commented 6 months ago

Hi, when I wanted to export your bash tool to trace I/O events into a Python program, I found a little bug.

    tmux: server-421224 [000] ..s. 828844.906117: block_rq_complete: 8,0 W () 18471784 + 8 [0] (awk variable dev = block_rq_complete:)
    tmux: server-421224 [000] ..s. 828844.906210: block_rq_complete: 8,0 W () 18471832 + 8 [0] (awk variable dev = block_rq_complete:)
    tmux: server-421224 [000] ..s. 828844.906217: block_rq_complete: 8,0 W () 18471888 + 24 [0] (awk variable dev = block_rq_complete:)
    tmux: server-421224 [000] ..s. 828844.906288: block_rq_complete: 8,0 W () 18471920 + 16 [0] (awk variable dev = block_rq_complete:)
    tmux: server-421224 [000] ..s. 828844.906489: block_rq_complete: 8,0 W () 18471968 + 8 [0] (awk variable dev = block_rq_complete:)
    ...

In this case, tmux with tmux: server-... add a new separator with space in awk, then the "dev" variable is false. Btw, the program don't crash and prints :

  >=(ms) .. <(ms)   : I/O      |Distribution                          |
       0 -> 1       : 8        |######################################|

How does the tool react ? What is the purpose of the "dev" variable ?