Demonstrations of alijbd2stat.
Alijbd2stat can trace every jbd2 handle and every transaction commit
info. If one jbd2 handle's running time is greater than user specified
threshold time, alijbd2stat will catch this handle's context.

Usage:
alijbd2stat [-h] [-d DEVICE] [-t [THRESH_TIME]]

Summarize filesystem jbd2 stat

optional arguments:
  -h, --help            show this help message and exit
  -d DEVICE, --device DEVICE
                        inspect specified device
  -t [THRESH_TIME], --thresh_time [THRESH_TIME]
                        show jbd2 handle's context when its run time is
                        greater than this value

examples:
    ./alijbd2stat          # show jbd2 transaction commit info.
    ./alijbd2stat -d sda3  # inspect specified device /dev/sda3.
    ./alijbd2stat -t 10    # show jbd2 handle's context when it runs more than 10ms.


Output example:

Example 1:
# Show jbd2 transaction commit info.
python alijbd2stat.py

dev      tid          wait request_delay running locked flushing logging handle_count blocks blocks_logged
sda5     11122351     0    0             5052    0      0        0       61           34     13
sda3     13641140     0    0             5280    0      0        0       138          19     20
sda5     11122352     0    0             5041    0      0        0       59           35     14
sda3     13641141     0    0             5000    0      0        0       113          9      10
sda5     11122353     0    0             5069    0      0        0       91           47     18

Example 2:
# inspect specified device /dev/sda5
python alijbd2stat.py  -d sda5

dev      tid          wait request_delay running locked flushing logging handle_count blocks blocks_logged
sda5     11122461     0    0             5029    0      0        0       75           38     15
sda5     11122462     0    0             5107    0      0        0       74           42     17
sda5     11122463     0    0             5028    0      0        1       88           50     17
sda5     11122464     0    0             5128    0      0        0       71           40     19
sda5     11122465     0    0             5243    0      0        0       83           44     13
sda5     11122466     0    0             5176    0      0        0       90           63     20
sda5     11122467     0    0             5029    0      0        0       60           34     13
sda5     11122468     0    0             5028    0      0        1       79           38     19
sda5     11122469     0    0             5030    0      0        0       44           27     12
sda5     11122470     0    0             5614    0      0        0       106          62     25

Example 3:
# inspect specified device /dev/sda5, and show jbd2 handle's context when one
# jbd2 handle runs more than 1ms.
python alijbd2stat.py  -d sda5 -t 1

comm: dd pid: 106212 tid: 11151230 pre_start_time: 0 run_time: 585432 sched_delay: 0
    jbd2_journal_stop_[k]
    jbd2_journal_stop_[k]
    ext4_dirty_inode_[k]
    __mark_inode_dirty_[k]
    generic_write_end_[k]
    ext4_da_write_end_[k]
    generic_perform_write_[k]
    __generic_file_write_iter_[k]
    ext4_file_write_iter_[k]
    __vfs_write_[k]
    vfs_write_[k]
    sys_write_[k]
    do_syscall_64_[k]
    entry_SYSCALL_64_after_swapgs_[k]
comm: kworker/u128:3 pid: 83229 tid: 0 pre_start_time: 0 run_time: 589686 sched_delay: 0
    jbd2_journal_stop_[k]
    jbd2_journal_stop_[k]
    ext4_convert_unwritten_extents_[k]
    ext4_end_io_rsv_work_[k]
    process_one_work_[k]
    worker_thread_[k]
    kthread_[k]
    ret_from_fork_[k]
sda5     11151229     0    0             5000    0      0        595     401233       255    36
