Project

General

Profile

AnubisProfiling » History » Version 1

Anonymous, 08/29/2007 09:51 AM

1 1 Anonymous
= Anubis Profiling =
2
Profiling functionnalities have been added to Anubis 1.8.
3
4
== Documentation ==
5
To use them, you fist have to compile your ADM with the profiling instructions, using '''-profile''' option into the command line. A good idea is to use the '''-sc''' option to, as it can help you to iddentify the different functions and their location into source code.
6
7
Once compiled, you juste have to start your ADM with the VirtualMachine. At the end of the execution (youy can use CTRL + C to end your ADM), the VM will output (on stderr) plain text information about profiling. On big software, that a good idea to redirect stderr to a file (using '2> filename' on command line).
8
9
Some options are available to format the output :
10
||-profile:csv ||Use CSV (Comma Separated Values) output insteed of plain text||
11
||-csv_sep:<sep> ||Allows to define a separator for CSV output (ex: '-csv_sep:;' to have a semi-colon insteed a comma)||
12
13
== Examples ==
14
15
Plain text output for fibonnacci.anubis[[BR]]
16
Command line : ''anbexec fib 29''
17
{{{
18
*** PROFILING DATA ***
19
*** Full executing time = 10.362 s
20
Function fib() [offset = 541]:
21
   hits = 1
22
   time (excluding children) = 0.002 s (0.0%)
23
   max  (including children) = 10.361 s (100.0%)
24
Function fib() [offset = 173]:
25
   hits = 1664079
26
   time (excluding children) = 10.360 s (100.0%)
27
   max  (including children) = 10.360 s (100.0%)
28
Function +() [offset = 89]:
29
   hits = 1
30
   time (excluding children) = 0.000 s (0.0%)
31
   max  (including children) = 0.000 s (0.0%)
32
}}}
33
34
CSV output for fibonnacci.anubis[[BR]]
35
Command line : ''anbexec fib 29 --profile:csv''
36
||Function||Offset||Hits||Time (excl. children)||Time %||Max (inc. children)||Max %||
37
||fib||541||1||0.001657||0.0||10.623458||100.0||
38
||fib||173||1664079||10.621774||100.0||10.621774||100.0||
39
||+||89||1||0.000027||0.0||0.000027||0.0||
40
41
== About Terminal Calls ==
42
Terminal calls can be a problem for profiling. 
43
44
First, they can't be representated by recursive calls because we can have an infinite succession of these calls.
45
46
Other approach is to do a 'fake' return just before a TerminalCall. But resulting profiling information is not really usable because the calls arborescence is broken.
47
48
So the choosen approach was to consider that all subsequent TerminalCalls made from a function are simply like if this was the same function. Helped by some examples, I will try to show you how it works.