gpt4 book ai didi

linux - Linux 事件在哪里存储快照?

转载 作者:太空宇宙 更新时间:2023-11-04 12:23:07 25 4
gpt4 key购买 nike

我正在尝试根据 kernel documentation 收集事件快照.

- 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.

不幸的是,文档没有说明快照的保存位置。

快照文件存储在哪里?

最佳答案

我对 Linux 跟踪一无所知,但我对您的问题感到好奇并通读了文档。

ftrace.txt ,它说它是使用tracefs公开的,但是为了与旧系统兼容,它也在debugfs中。

因此,如果您在 /sys/kernel/debug 安装了 debugfs,您可以在 /sys/kernel/debug/tracing/snapshot 找到快照

如果您在 /sys/kernel/tracing 上安装了 tracefs,那么也可以在 /sys/kernel/tracing/snapshot 上安装。

注意有全局snapshotper_cpu/cpu*/snapshot

关于linux - Linux 事件在哪里存储快照?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45496028/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com