我想跟踪find命令发出的系统调用来调试一些性能问题但是我无法弄清楚如何在Mac OS X Yosemite上执行此操作.我如何跟踪任意程序的系统调用,类似于FreeBSD上的strace?我对跟踪文件系统相关的调用特别感兴趣.
我需要通过 python 跟踪任何命令的输出。但我只需要将以下 amd linux 命令转换为 mac m1/arm 命令(因此 python 可能不相关):
\nstrace -e trace=execve -v -s 100000000 -xx -ttt -ff -o output.txt sh -c \'echo hi\'\nRun Code Online (Sandbox Code Playgroud)\n我怎么做?
\n这对我来说失败了:
\n \xe2\x9d\xaf sudo dtruss -t execve -f sh -c \'echo hi\'\ndtrace: system integrity protection is on, some features will not be available\n\ndtrace: failed to execute sh: Operation not permitted\nRun Code Online (Sandbox Code Playgroud)\n笔记:
\n我似乎无法从brew …