我正在研究Linux环境.我有两个'C'源包train和test_train.
现在我想用gprof生成一个调用图,它显示了主程序中函数的调用顺序以及libtrain.so中的函数调用顺序.
我正在使用-pg选项编译和链接两个包,调试级别为o0.在我执行./train-test之后,生成gmon.out.然后我做:
$ gprof -q ./train-test gmon.out
Run Code Online (Sandbox Code Playgroud)
这里,输出显示列车测试中的函数调用图,但不显示libtrain.so中的调用图
可能是什么问题呢 ?
I'm trying to use sprof to profile some software (ossim) where almost all the code is in a shared library. I've generated a profiling file, but when I run sprof, I get the following error:
> sprof /home/eca7215/usr/lib/libossim.so.1 libossim.so.1.profile -p > log
Inconsistency detected by ld.so: dl-open.c: 612: _dl_open: Assertion `_dl_debug_initialize (0, args.nsid)->r_state == RT_CONSISTENT' failed!
Run Code Online (Sandbox Code Playgroud)
The instructions I was following said that I needed libc version at least 2.5-34, I have libc version 2.12.2 (Gentoo, kernel 2.6.36-r5).
I can't …
我目前正在尝试使用LD_PROFILE环境变量来分析预加载的共享库.
我使用"-g"标志编译库并导出LD_PROFILE_OUTPUT以及LD_PROFILE,然后运行带有预加载库的应用程序(在我的情况下为ncat).所以,更准确地说,我做的是以下内容:
export LD_PROFILE_OUTPUT=`pwd`export LD_PROFILE=libexample.soLD_PRELOAD=`pwd`/libexample.so ncat ...预加载本身确实有效,我的库也被使用,但是没有创建libexample.so.profile文件.如果我使用export LD_PROFILE=libc.so.6,则按预期存在libc.so.6.profile文件.
这是组合LD_PRELOAD和LD_PROFILE的问题还是我可能做错了什么?
如果有任何相关性,我在CentOS 6.4上使用glibc v2.12.
非常感谢!