profiler code syntax update authored by Sébastien Timmermans's avatar Sébastien Timmermans
## installer libprofiler.so ## installer libprofiler.so
apt install libgoogle-perftools-dev ```apt install libgoogle-perftools-dev ```
## installer un meilleurs pprof (grace a golang) ## installer un meilleurs pprof (grace a golang)
apt install golang ```apt install golang```
GOPATH=$HOME/go go get github.com/google/pprof ``` GOPATH=$HOME/go go get github.com/google/pprof```
## Profile the ./myexe ## Profile the ./myexe
LD_PRELOAD=/usr/lib/libprofiler.so CPUPROFILE=prof ./myexe ```LD_PRELOAD=/usr/lib/libprofiler.so CPUPROFILE=prof ./myexe```
Attention, le chemin d'accès jusqu'à libprofiler peut varier ! Attention, le chemin d'accès jusqu'à libprofiler peut varier !
## show online the results ## show online the results
~/go/bin/pprof -http localhost:8000 prof ```~/go/bin/pprof -http localhost:8000 prof```
## The package graphViz is needed. ## The package graphViz is needed.
sudo apt install graphviz ``` sudo apt install graphviz```
## use this line create a pdf : ## use this line create a pdf :
~/go/bin/pprof -pdf prof > my_pdf_prof.pdf ```~/go/bin/pprof -pdf prof > my_pdf_prof.pdf```
and open it : and open it :
evince my_pdf_prof.pdf ```evince my_pdf_prof.pdf```