Previous: Using The Step Debugger, Up: Command Line Use


5.6 Using The Profiler

To use the Source Level Profiler, add the --profile command line option to your build:

     $ pcc --profile myapp.php

When you run the resulting binary file (myapp on Unix, myapp.exe on Windows), a human readable text file named myapp.profile will be generated.

     $ ./myapp
     $ cat myapp.profile
     Time            Calls           Time/call               Sig
     30.157857       30              1.0052619               sleep
     8.87            30              2.9566666               foo
     3.21            1               3.21                    myapp.php
     2.63            10              2.63                    bar
     
     
     Edge                    Calls
     foo  ->  php-sleep      (30)
     bar  ->  foo            (20)
     myapp.php  ->  bar      (10)
     myapp.php  ->  foo      (10)

The first section describes which functions were called, how many times, the total time spent in that function and the average time per call.

The second section describes which functions called which other functions, and how many times.