如何使用sprof?

7 linux sprof

请举例说明?

Sha*_*son 7

这里这里的电子邮件中,我提取了以下注释:

给定一个应用程序my_app', which links against a shared objectmy_sobj',并使用'-g'编译标志编译:

#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
Run Code Online (Sandbox Code Playgroud)

这为共享库提供了配置文件信息,而不是my_app