#set the environment variable LD_PROFILE to the name of the shared obj
export LD_PROFILE=my_obj
#run your application
my_app
#this should create a file /var/tmp/my_sobj.profile
#now run sprof
sprof my_sobj my_sobj.profile
这提供了共享库的配置文件信息,而不是 my_app
From the emails found here and here, I've extracted the following notes:
Given an application my_app', which links against a shared objectmy_sobj', and has been compiled with the '-g' compile flag:
#set the environment variable LD_PROFILE to the name of the shared obj
export LD_PROFILE=my_obj
#run your application
my_app
#this should create a file /var/tmp/my_sobj.profile
#now run sprof
sprof my_sobj my_sobj.profile
This gives profile information for the shared library, not for my_app
发布评论
评论(1)
从此处和此处,我提取了以下注释:
给定一个应用程序
my_app',其中链接到共享对象
my_sobj',并且已使用“-g”编译标志进行编译:这提供了共享库的配置文件信息,而不是 my_app
From the emails found here and here, I've extracted the following notes:
Given an application
my_app', which links against a shared object
my_sobj', and has been compiled with the '-g' compile flag:This gives profile information for the shared library, not for my_app