C layer of the Profiler module: named zones, the text report and the CSV export.
The profiler is 'Profiler::CProfilerManager' of 'ethereal/cpp/profiler/profiler.hpp', one per process. A zone is a name: ETLC_ProfilerBegin starts the measurement and ETLC_ProfilerEnd with the same name closes it and adds the duration to the statistics of the name (calls, total, average, minimum, maximum, last, deviation, and p50, p90 and p99 of the last 254 samples).
The names are copied. The zones are keyed by name only, for every thread: two threads that open the same name at the same time share one measurement. Use a name per thread when that matters. A second ETLC_ProfilerBegin of an open name is ignored, and so is an ETLC_ProfilerEnd of a name that is not open.
The C++ side has no reading API other than the text report and the CSV file. There are no numeric getters.
Text output always ends in '\0'. The size written does not count it. When the buffer is too small, the call writes the capacity needed (text plus '\0'), so 'uCap = 0' asks for it.
Every export returns 'int'. Zero is success, negative is an error. The values are part of the ABI.