Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/147.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ linux上共享库加载时间的计时_C++_Linux_Redhat_Dynamic Linking - Fatal编程技术网

C++ linux上共享库加载时间的计时

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

我试图弄清楚在linux系统上加载共享库需要多少时间(具体来说是RHEL 6),我想知道有什么样的工具来计算加载共享库需要多长时间。我还没有找到任何关于如何做的好信息,我希望有某种工具存在。

您应该在
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()或加载程序完成的加载,您想知道这一点吗?