【问题标题】:Timing shared library load times on linux在 Linux 上计时共享库加载时间
【发布时间】:2017-11-10 18:21:50
【问题描述】:

我想弄清楚我在 linux 系统(具体来说是 RHEL 6)上加载共享库需要多少时间,我想知道有哪些工具可以计算共享库的时间加载需要。我还没有真正找到任何关于如何做到这一点的好信息,我希望存在某种工具。

【问题讨论】:

标签: c++ linux redhat dynamic-linking


【解决方案1】:

你应该在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%)

【讨论】:

    猜你喜欢
    • 2011-07-05
    • 1970-01-01
    • 1970-01-01
    • 2014-06-17
    • 2013-02-15
    • 2011-05-29
    相关资源
    最近更新 更多