Greg suggested in his review of bug 1576550, that the extra timing routine before each
profiler_add_marker() call could instead be added to the existing
PROFILER_ADD_MARKER only accepts two arguments, and it's not used everywhere anyway... yet!
So I think we could:
PROFILER_ADD_MARKER for all two-argument calls to
profiler_add_marker() -- this will be more consistent, and will also save our users from having to fully qualify the category pair.
PROFILER_ADD_MARKER_WITH_PAYLOAD, which will take an additional payload type and the list of constructor arguments -- this will also be more consistent, but also make it easier to change to stack-allocated payloads in bug 1576555.
With these, it will be trivial to add the internal profiling instrumentation in bug 1576550.
I will keep the first review separate from the patch stack starting at bug 1576550, just in case this change here is not accepted or needs significant changes (so I don't waste time merging these patches if I then have to revert/remerge them).