I've tried LazProfiler and it couldn't instrument my code correctly (actually destroyed it, but luckily I had a backup) :)That is worrying - don't you use SubVersion or Git to version control your software?? I highly suggest you start.
yes, now it depends on CGE and my external units, e.g. for timer implementation,So the point is moot - both have dependencies.
The largest problem is parser for such profilers, e.g. even JEDI and CodeTools fail at some valid FPC syntaxYou don't need a parser for that. Granted I don't know LazProfiler (is that a renamed FPProfiler?). Also I haven't followed FPProfiler in recent years. The last time I worked on FPProfile was some 7 years ago - my code is still available [https://github.com/graemeg/fpprofiler (https://github.com/graemeg/fpprofiler)].
both have dependenciesThat code depends only on timer and output (log) implementation. That's easily removable, just copy-paste a procedure.
a tokenizer to find begin..end pairs of functions or proceduresYes, that seems exactly what I've meant by parsing the code.
I've tried LazProfiler and it couldn't instrument my code correctly (actually destroyed it, but luckily I had a backup) :)