2017-08-03 145 views
0

我正在嘗試收集基於kernel documentation的事件快照。Linux事件存儲快照在哪裏?

- snapshot 

    This command causes a snapshot to be triggered whenever the 
    triggering event occurs. 

    The following command creates a snapshot every time a block request 
    queue is unplugged with a depth > 1. If you were tracing a set of 
    events or functions at the time, the snapshot trace buffer would 
    capture those events when the trigger event occurred: 

    # echo 'snapshot if nr_rq > 1' > \ 
     /sys/kernel/debug/tracing/events/block/block_unplug/trigger 

    To only snapshot once: 

    # echo 'snapshot:1 if nr_rq > 1' > \ 
     /sys/kernel/debug/tracing/events/block/block_unplug/trigger 

    To remove the above commands: 

    # echo '!snapshot if nr_rq > 1' > \ 
     /sys/kernel/debug/tracing/events/block/block_unplug/trigger 

    # echo '!snapshot:1 if nr_rq > 1' > \ 
     /sys/kernel/debug/tracing/events/block/block_unplug/trigger 

    Note that there can be only one snapshot trigger per triggering 
    event. 

不幸的是,該文檔沒有提供關於快照保存位置的信息。

快照文件存儲在哪裏?

回答

0

我對Linux跟蹤一無所知,但我對你的問題感到好奇,並閱讀了文檔。

ftrace.txt,它表示它使用tracefs曝光,但爲了與舊系統兼容,它也在debugfs

所以如果你有debugfs安裝在/sys/kernel/debug,你可以在/sys/kernel/debug/tracing/snapshot找到快照。

如果您有tracefs安裝在/sys/kernel/tracing然後也在/sys/kernel/tracing/snapshot

請注意,有全球snapshotper_cpu/cpu*/snapshot