Note: You may also compile with the -p flag, but this will produce a bcode file that will run somewhat more slowly than usual. Do this only if you also want to carry out profiling.
bci_profile_onRun your program as normal. When it has finished, or it has run for long enough, execute the command
bci_profile_offThis will write the profile.out file in the current directory.
Alternatively you can use an li command line such as
li prog.bcode profrunThe profrun module simply enables profiling, runs the program, and then disables it.
The information is displayed in the following sections:
In each case, the filename, line number and identifier is given. For identifiers declared at the top level in any file it is not possible to report the filename and line number; instead these identifiers are listed as "global".
Enabling optimisation will cause some library routines to be bypassed, so they appear to be unreached. Either ignore these entries or disable optimasation.