C++ linux上共享库加载时间的计时
我试图弄清楚在linux系统上加载共享库需要多少时间(具体来说是RHEL 6),我想知道有什么样的工具来计算加载共享库需要多长时间。我还没有找到任何关于如何做的好信息,我希望有某种工具存在。您应该在C++ linux上共享库加载时间的计时,c++,linux,redhat,dynamic-linking,C++,Linux,Redhat,Dynamic Linking,我试图弄清楚在linux系统上加载共享库需要多少时间(具体来说是RHEL 6),我想知道有什么样的工具来计算加载共享库需要多长时间。我还没有找到任何关于如何做的好信息,我希望有某种工具存在。您应该在LD\u DEBUG=statistics下运行: $ LD_DEBUG=statistics ls > /dev/null 9897: 9897: runtime linker statistics: 9897: total startu
LD\u 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%)
动态链接器可以提供一些信息。请参阅LD_DEBUG:启动程序时,对于显式dlopen()或加载程序完成的加载,您想知道这一点吗?