确定性虚拟机 Rewind 新增 rewind time 命令,旨在分析录制会话的时间去向及软件构建和测试运行中的“关键路径”1。该工具的设计受 Brendan Gregg 的性能分析方法启发,特别是离CPU分析(off-CPU analysis)和线程状态分析,从而能够精确定位导致程序变慢的非计算因素,如睡眠或等待1。
以 libuv-1.51.0 库的构建为例,数据显示该构建在单核虚拟 CPU 上耗时 78.0 秒,而在多核环境下其关键路径为 47.4 秒1。进一步分析表明,在这 47.4 秒的关键路径中,67% 的时间处于睡眠状态,主要涉及 epoll_pwait、clock_nanosleep 和 futex,仅 33% 的时间用于计算1。具体进程方面,make check 占用了 41.9 秒,其中 lt-run-tests 占据了 36.4 秒1。
为了支持深度调试,rewind time 提供了跳转到特定步骤查看源码、调用 gdb 以及生成 Perfetto 追踪文件或折叠堆栈数据等功能1。
The deterministic virtual machine Rewind has released a new command called rewind time, which is designed to analyze where time is spent within recorded sessions and identify critical paths in software builds and test runs 1. This feature is inspired by Brendan Gregg’s performance analysis methodologies, specifically leveraging off-CPU analysis and thread state examination to pinpoint non-computational delays such as sleep or wait events that slow down programs 1.
A practical demonstration using the libuv library (version 1.51.0) illustrates the tool's capabilities. While the build process consumed 78.0 seconds on a single-core virtual CPU, the critical path under multi-core conditions was measured at 47.4 seconds 1. Detailed analysis revealed that only 33% of this time was spent on computation, whereas 67% was attributed to sleeping states dominated by system calls like epoll_pwait, clock_nanosleep, and futex 1. Within this timeframe, the make check phase accounted for 41.9 seconds, with the specific test runner lt-run-tests consuming 36.4 seconds 1. To assist with deeper debugging, rewind time supports jumping to specific steps to view source code, invoking gdb, and generating Perfetto trace files or folded stack data 1.
评论
还没有评论,欢迎留下第一条。