4

iPhone Simulator 需要几分钟才能启动,因此我正在跟踪系统调用的经过时间以加快启动时间:

sudo dtruss -a -f "sudo -u flopez \"/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone\ Simulator.app/Contents/MacOS/iPhone\ Simulator\"" 3>&1 1>trace.txt 2>trace.txt

我发现了两个特别慢的系统调用:

awk '{ if ($2 >= 50000000 ) print  }' trace.txt 
    PID/THRD   ELAPSD SYSCALL(args)          = return
 1614/0x4dfd:  156374511 select(0x4, 0x7FFCE8404C90, 0x7FFCE84071E0, 0x0, 0x0)       = -1 Err#4
 1645/0x4fbf:  104751284 kevent64(0x3, 0x0, 0x0)         = -1 Err#4

请注意,select()系统调用占用了 104 段并最终失败,因此发现与此调用关联的文件路径会很有帮助。

我怎样才能找到这个文件?

4

0 回答 0