[squid-dev] [RFC][CODE] RAII profiler

Amos Jeffries squid3 at treenet.co.nz
Tue Aug 11 01:25:30 UTC 2015


On 11/08/2015 10:52 a.m., Kinkie wrote:
> Hi,
>   the attached patch implements a profiler API fashioned after the RAII
> pattern.
> It does nothing to attack the c API or the implementation, just adds on top
> of it a Profiler class to save the caller the hassle of having to track all
> exit paths from a function.
> As an example, it implements the new API for the HttpHeader::parse method.

Thank you or picking this up.

Please move the new class and #define outside the USE_XPROF_STATS
blocks. Use USE_XPROF_STATS wrapper to switch the class internals about
instead.
 That makes the class API guaranteed to be consistent, or where
inconsistent obviously so. And halves the LOC.


> 
> BTW: there is an issue in the profiler cachemgr report - it segfaults for
> me on mac.
> I'll try to check it out on Linux in the next few days.
> 

Amos



More information about the squid-dev mailing list