如何使用sprof?

请用例子来解释一下?

Solutions Collecting From Web of "如何使用sprof?"

从这里和这里找到的电子邮件中,我已经提取了以下说明:

给定一个my_app', which links against a shared object应用程序my_app', which links against a shared object应用程序my_app', which links against a shared object my_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 

这给出了共享库的配置文件信息,而不是my_app