alliedmodders/sourcemod — pull request #54 by dvander (2014-06-24 08:24:26+00:00)
Title: Add a general profiling abstraction layer.

This patch defines a new profiling API within SourcePawn. A profile has to expose roughly the following methods:
* Start and stop profiling.
* Enter and leave performance scopes, for profilers that can attribute to high-level call stacks.
* Register JIT addresses to a source line/number.

Not all profilers will support both of the first two functions. For example, VTune supports registering JIT code, but VProf does not. This patch contains support for VProf. I will probably do VTune later on, within SourcePawn, and give SourcePawn an API to expose which profilers it knows about.

The old profiling code and APIs are removed.

I would like commands for plugins to be able to start and stop profiles on their own, but since SM supports multiple profilers, it's a little tricky. Maybe there should be an option to sticky one profiler as default or something, and default to "vprof" otherwise.

Current usage:
```
sm prof start vprof
...
sm prof stop
```