Hi,

In theory a call to _mcount could be replaced with a
compilerproc, which you could then override in the RTL, allowing a way to
add support for various profilers.

If it became fully overridable,  you could put a callback between any branch/line/function and create instrumentalization not just for profilers.

A single tracing system for gprof, gcov, american fuzzy lop, etc. ...


Best,
Benito



Am 19.02.2018 um 12:01 schrieb Karoly Balogh (Charlie/SGR):
Hi,

On Mon, 19 Feb 2018, Sven Barth via fpc-devel wrote:

It's not the same scenario as heaptrc is entirely working in the RTL
without any compiler extension (aside from the -gh parameter). Profiling
code however would require extensions to the compiler whereby it would
also need to handle exceptions correctly and such things.
Yes, but it's still worth thinking about how to generalize the current GNU
Profiler support we have, which is messy at places, and of course entirely
depends on GNU Profiler. But it's still mostly about generating a call to
_mcount in various ways, taking the stackframe of various platform ABI
into account. In theory a call to _mcount could be replaced with a
compilerproc, which you could then override in the RTL, allowing a way to
add support for various profilers.

I'm sure it would allow moving out some of the complexity from the
compiler to the RTL, and make things more flexible in the end.

(And GNU profiler's _mcount itself also depends on GCC/GLibc
implementation details per platform.)

Charlie
_______________________________________________
fpc-devel maillist  -fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply via email to