我想弄清楚我在 Linux 系统(具体是 RHEL 6)上加载共享库需要多少时间,我想知道有哪些工具可以计算共享库的时间加载需要。我还没有真正找到任何关于如何执行此操作的有用信息,我希望存在某种工具。
最佳答案
你应该在 LD_DEBUG=statistics
下运行:
$ LD_DEBUG=statistics ls > /dev/null
9897:
9897: runtime linker statistics:
9897: total startup time in dynamic loader: 1557664 clock cycles
9897: time needed for relocation: 322049 clock cycles (20.6%)
9897: number of relocations: 156
9897: number of relocations from cache: 8
9897: number of relative relocations: 1257
9897: time needed to load objects: 1037549 clock cycles (66.6%)
关于c++ - 在 Linux 上计时共享库加载时间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47188306/