c++ - 在 Linux 上计时共享库加载时间

标签 c++ linux redhat dynamic-linking

我想弄清楚我在 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/

相关文章:

c++ - OpenMP 超额订阅会导致内存错误吗?

C++指针处理

c - malloc 之后的 memset

compiler-errors - 64位libuuid不兼容,编译时找不到32位libuuid

c++ - CLion 无法从源代码中检测到类,并且没有智能感知/代码完成

c++ - DataCacheSize 的正常值可以是多少?

linux - 通过 inode 获取文件详细信息

linux - 可以从内部暂停无特权的Docker容器吗?

mysql - 在 Red Hat 上安装 Maria DB (mysql)。安装后如何启动服务

installation - 如何在 Redhat Enterprise Linux 6.0 上安装 pysvn?