diff options
author | Nick Mathewson <nickm@torproject.org> | 2010-09-12 19:36:57 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2010-09-12 19:37:04 -0400 |
commit | 2be5effe9a3b3832f92b52c21bfee6e491bc25fc (patch) | |
tree | 33aa0261304153885c93b08412e67f0211f7f5ce /doc/HACKING | |
parent | b4942e34352dbe5dc3f3b4e0da22f402a4452ca9 (diff) | |
download | tor-2be5effe9a3b3832f92b52c21bfee6e491bc25fc.tar.gz tor-2be5effe9a3b3832f92b52c21bfee6e491bc25fc.zip |
Initial oprofile instructions based on original by weasel.
Diffstat (limited to 'doc/HACKING')
-rw-r--r-- | doc/HACKING | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/doc/HACKING b/doc/HACKING index d8538b1f2c..486fe6d10a 100644 --- a/doc/HACKING +++ b/doc/HACKING @@ -130,6 +130,33 @@ compiler generated no code for that line. '######' means that the line was never reached. Lines with numbers were called that number of times. +Profiling Tor with oprofile +~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The oprofile tool runs (on Linux only!) to tell you what functions Tor is +spending its CPU time in, so we can identify berformance pottlenecks. + +Here are some basic instructions + + - Build tor with debugging symbols (you probably already have, unless + you messed with CFLAGS during the build process). + - Build all the libraries you care about with debugging symbols + (probably you only care about libssl, maybe zlib and Libevent). + - Copy this tor to a new directory + - Copy all the libraries it uses to that dir too (ldd ./tor will + tell you) + - Set LD_LIBRARY_PATH to include that dir. ldd ./tor should now + show you it's using the libs in that dir + - Run that tor + - Reset oprofiles counters/start it + * "opcontrol --reset; opcontrol --start", if Nick remembers right. + - After a while, have it dump the stats on tor and all the libs + in that dir you created. + * "opcontrol --dump;" + * "opreport -l that_dir/*" + - Profit + + Coding conventions ------------------ |