Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Run configure with the option to add profiling support. It will check to see if the header and lilibrary is installed. You will have to recompile traffic server to add calling the profiler's start and stop functions.

Panel

bcall@snowball trafficserver$ ./configure --with-profiler
bcall@snowball trafficserver$ gmake -j >& /dev/null && echo good
good

You can either install the package with "sudo gmake install" or run the program for the current directory if you already have an installation with all the logs and configuration directories setup.

Panel

bcall@snowball trafficserver$ sudo proxy/traffic_server
// or
bcall@snowball trafficserver$ sudo gmake install
bcall@snowball trafficserver$ sudo /usr/local/bin/trafficserver start
Starting Apache Traffic Server: [ OK ]

Next you will need to run your benchmark. After the benchmark is complete, kill the traffic_server process or stop traffic server with the startup script. The traffic server process will need to be shutdown before a proper profile file is written.

Panel

bcall@snowball trafficserver$ sudo killall traffic_server
// or
bcall@snowball trafficserver$ sudo /usr/local/bin/trafficserver stop
Stopping traffic_cop: [ OK ]
Stopping traffic_manager: [ OK ]
Stopping traffic_server: [ OK ]

Now we can look at the profiling information.

Panel

bcall@snowball trafficserver$ pprof --text proxy/traffic_server /tmp/ts.prof | head
Total: 14 samples
5 35.7% 35.7% 5 35.7% memset
3 21.4% 57.1% 3 21.4% __strncpy_ssse3
1 7.1% 64.3% 1 7.1% __pread_nocancel
1 7.1% 71.4% 1 7.1% build_part_hash_table
1 7.1% 78.6% 1 7.1% initialize_all_global_stats
1 7.1% 85.7% 1 7.1% ink_freelist_new
1 7.1% 92.9% 1 7.1% pthread_sigmask
1 7.1% 100.0% 1 7.1% time
0 0.0% 100.0% 2 14.3% AIOCallbackInternal::io_complet

To make a callgraph of program in PDF form.

Panel

bcall@snowball trafficserver$ pprof --pdf proxy/traffic_server /tmp/ts.prof > ts.pdf

If you want to investigate a certain function you can the focus option.

Panel

bcall@snowball trafficserver$ pprof --pdf --focus=HttpSM::main_handler proxy/traffic_server /tmp/ts.prof > ts-main_handler.pdf

Callgrind

...