Download Latest Version pre-alpha 0.10 version (557.1 kB)
Email in envelope

Get an email when there's a new version of cAtomProfiler

Home
Name Modified Size InfoDownloads / Week
cAtomProfiler_SRC_0.10.zip 2010-01-06 557.1 kB
readme.txt 2009-12-01 5.2 kB
Totals: 2 Items   562.3 kB 0
Version 0.00 - 20091130

At the current stage, cAtomProfiler is a small research project, covering the basics of an instrumental profiler. Its final purpose is to provide developers with a native tool for profiling windows applications compiled under the Freepascal/Lazarus environment. A few initial goals have been set and will be followed throughout the development of cAtomProfiler:

------------------------------------------------------------------------------------------------
* very small insertions and similar in the code to be profiled                                 *
------------------------------------------------------------------------------------------------

The developer should not spend much time making insertions in the code to be profiled only to later remove all the insertions. Very simple and unique forms must be used. For example, to fully profile a procedure in a program, the insertions will look like this:

procedure DoSomething(params);
var ...
begin
{$ASMMODE intel}asm call cAtom_EnterProc end; //  insertion at the beginning of procedure

//  Do something usefull and necessary to be profiled
//  time consuming, unoptimized code

{$ASMMODE intel}asm call cAtom_ExitProc end; //  insertion at the end of procedure
end;


------------------------------------------------------------------------------------------------
* The injected code must not contain procedure names, specific information other than the call *
* itself. All the names of the callers and callees should be automatically extracted from the  *
* binary file                                                                                  *
------------------------------------------------------------------------------------------------

The injection must not be of the form "cAtom_EnterProc('name of the procedure to be profiled --- very boring process')". "cAtom_EnterProc" will suffice or even shorter calls.

The binary file compiled for debuging purposes usually contains symbol tables at least and/or other debug information in specific sections. The profiler must be able of automatic extraction of symbol references.

------------------------------------------------------------------------------------------------
* The profiler must be able not only to count the executions themselves of the profiled pieces *
* of code, but also to make discrimination between different callers                           *
------------------------------------------------------------------------------------------------

Example:

procedure VeryComplicatedProcess();
begin

 while true do
  begin

   arg:= random(2);

   case arg of
    0: for i do DoSomething(i div 2);
    1: for i do DoSomething(i div 2 + 1);
   end;
  
  end;

end;

This procedure makes calls to 'DoSomething' from two points, according to value stored. This is called branching, where different calls to the same procedure doesn't necessarly mean the callee will behave in the same time fashion. The profiler must be capable of determining the different types of calls without any extra injected code other the one already depicted in the first paragraph. This will enable the capability of constructing analyzing graphs.

------------------------------------------------------------------------------------------------
* Analyzer graphs containing not just data comparision, but representations of the actual      *
* execution flow of the code being profiled.                                                   *
------------------------------------------------------------------------------------------------

Through the use of an external tool, one should be capable of analyzing visually the procedures of the application, with graphs such as:

                              
                                                                     +---------------------------------------------------+
                                +-----------------> loop ----------> |DoSomething: x calls, avg time, max call, min call | -----+
                                |                     ^              +---------------------------------------------------+      |
/-----\                         |                     |                                                                         |
|START|-------------------> decision                  +-------------------------------------------------------------------------+
\-----/                         |
                                |                                    +---------------------------------------------------+
                                +-----------------> loop ----------> |DoSomething: x calls, avg time, max call, min call | -----+
                                                      ^              +---------------------------------------------------+      |
                                                      |                                                                         |
                                                      +-------------------------------------------------------------------------+


 
Source: readme.txt, updated 2009-12-01