Difference between revisions of "FPProfiler"

From Lazarus wiki
Jump to navigationJump to search
m (typos and wording)
Line 4: Line 4:
 
itself supports. It was initially developed by Darius Blaszyk.  
 
itself supports. It was initially developed by Darius Blaszyk.  
  
Free Pascal Profiler conists of two tools (fpp and fppview) and some units
+
Free Pascal Profiler consists of two tools (fpp and fppview) and some units  
that contain the profiling code that needs to be linked in.
+
containing the profiling code that needs to be linked in.
  
 
=== FPP ===
 
=== FPP ===
You pass the same parameters to FPP as you would to FPC to compile your
+
To compile your project, you pass the same parameters to FPP as you would  
project. FPP then scans your source code, and inserts profiling code in
+
to FPC. FPP then scans your source code and inserts profiling code in
 
each begin..end block. It also ammends the uses clause to link in the
 
each begin..end block. It also ammends the uses clause to link in the
fpprof unit. Once done, it compiles your project which now includes the
+
fpprof unit. Once done, it compiles your project, which now includes the
profiling code. After that it restores your units to there original state.
+
profiling code. After that, it restores your units to there original state.
  
 
=== FPPView ===
 
=== FPPView ===
When your run your program that contains the profiling code, it generates
+
When you run your program that contains the profiling code, it generates
an xml file containing all the profiling information. FPP View reads this xml file
+
an xml file containing all the profiling information. FPPView reads this xml file
 
and generates reports from it. Call counts, timing and call graphs are
 
and generates reports from it. Call counts, timing and call graphs are
 
supported at the moment.
 
supported at the moment.
Line 30: Line 30:
  
 
== Platforms / architectures ==
 
== Platforms / architectures ==
Because it's completely FPC native it should work on all platforms and architectures that FPC supports.
+
Because it is completely FPC native, it should work on all platforms and architectures that FPC supports.

Revision as of 11:01, 14 September 2010

Introduction

The Free Pascal Profiler is an effort to create an FPC native profiler, deployable on all platforms and architectures the Free Pascal compiler itself supports. It was initially developed by Darius Blaszyk.

Free Pascal Profiler consists of two tools (fpp and fppview) and some units containing the profiling code that needs to be linked in.

FPP

To compile your project, you pass the same parameters to FPP as you would to FPC. FPP then scans your source code and inserts profiling code in each begin..end block. It also ammends the uses clause to link in the fpprof unit. Once done, it compiles your project, which now includes the profiling code. After that, it restores your units to there original state.

FPPView

When you run your program that contains the profiling code, it generates an xml file containing all the profiling information. FPPView reads this xml file and generates reports from it. Call counts, timing and call graphs are supported at the moment.

Installing

You can get the latest sources from SVN here:

 http://svn.freepascal.org/svn/fpcprojects/fpprofiler

Alternatively Graeme Geldenhuys has created a git repository:

 http://github.com/graemeg/fpprofiler

This repository is an unofficial one. The SVN repository is therefore advised.

Platforms / architectures

Because it is completely FPC native, it should work on all platforms and architectures that FPC supports.