From f81dfdfca7af59ae9c62c86a6b35f0a5ea54f66a Mon Sep 17 00:00:00 2001
From: Thomas Frieden
To use profiling, two steps are required. First of all, your program must be compiled with +the gcc command line option -pg. This instructs the compiler to generate special +profiling code in the prologue and epilogue of each function. Additionally, the program +must be linked with libprofile.a. To do this, either manually add +-lprofile to the linker command line, or modify the specs file as follows. +Find the lines that look like this (it may actually differ silghtily from your specs file, +but the important thing is that the line before the line to be modified reads lib:): +
+lib: +--start-group -lc --end-group ++You will have to modify this to look like this: +
+lib:
+%{pg: -lprofile} --start-group -lc --end-group
+
+Normally, the specs file is located at the compilers installation directory. For cross-compilers,
+this is /usr/local/amiga/lib/gcc/ppc-amigaos/compiler-version/specs. For a native compiler,
+it's in gcc:lib/gcc/ppc-amigaos/compiler-version/specs. Most likely, your compiler will already have this added to it's specs file.
+
+Profiling makes use of a special PowerPC facility called the Performance Monitor. It +allows to "mark" tasks and count only during while a marked task is running. This allows +performance analysis to be made independant of the actual system load. The Performace Monitor +is available on all PowerPC models supported by AmigaOS 4 except for the 603e, and +embedded versions of the PowerPC like the 405 and 440 series. Consult the manual +of the appropriate chip for more information.