c prof tools - Serbipunk/notes GitHub Wiki

gprof

https://www.thegeekstuff.com/2012/08/gprof-tutorial/

概况汇总,对于软件执行上,是重要的一个方面。通过概况汇总,可以决定重写的耗时部分。 对于软件决定哪里执行效率不高,并且在发现潜在的bug上,概况汇总工具将会节省大量时间。

https://www.jianshu.com/p/9257a5ae3672 https://sourceware.org/binutils/docs/gprof/Introduction.html

./src/Collocation/ColloWorker
gprof -b ./src/Collocation/ColloWorker

gprof doesn't work for static library

https://stackoverflow.com/a/4959168

In some versions, such as BSD, profiling of shared libraries can be limited 
because of restrictions of the profil function, which may be implemented 
as library function or as system call. There were analogous utility in glibc 
called 'sprof' to profile dynamic libraries

https://en.wikipedia.org/wiki/Gprof

sprof

https://stackoverflow.com/questions/881074/how-to-use-sprof

https://man7.org/linux/man-pages/man1/sprof.1.html