程序执行 = 状态机执行
Time-Travel Debugging & Record-replay
Premature optimization is the root of all evil. (D. E. Knuth)
那到底怎么样才算 mature 呢?
我们需要真实执行的
隔一段时间 “暂停” 程序、观察状态机的执行
例子:Linux Kernel perf (支持硬件 PMU)
你们遇到的大部分情况
工业界遇到的大部分情况
一些真正的 model checkers
任何 “non-deterministic” 的状态机都可以检查
u32 x = rdrand(), y = rdrand();
if (x > y)
if (x * x + y * y == 65)
bug(); // 如何有效地检验?