Execution profile

next up previous contents index
Next: Others Up: Predefined functions Previous: Function

Execution profile


Profiling helps you to approximately know the run time ratio taken by your functions. Built-in functions are not taken into account and their run time are included in their caller's one. To achieve this you must call start\_profile(), execute your program, and last call stop\_profile(). After that function\_percent() may return run time percentages.

When profile is running, a timer is used to watch periodically which function is the current function, and to increase its counter. If Smac is used from Xcoral, this timer is disarmed when you are under the Xcoral toplevel, but it remains active when you call an Xcoral interface function from Smac.

To see the ten most greedy functions (the top\_ten function is defined in the top\_ten.sc file), you can run:


   int start_profile()

Resets counters, starts the profiling and returns the number of not built-in functions.


   int stop_profile()

Stops profiling and returns the amount of time the timer has run.


   int function_percent(void *)

Takes a function as argument and returns its execution profile associated counter, and 0 if the timer has never run (run time was too small) or if the function is built-in.

Lionel Fournigault
Mon Mar 6 13:33:34 MET 1995