On 02/16/2014 06:51 AM, Kinkie wrote: > Hi all, > I'm working on debug together with Amos, working on reducing the > size of the API, removing cruft and making it a bit speedier in the > meantime. > I'm looking into refactoring ctx_enter/ctx_exit into RAII, but right > nw i can't remember ever seeing a context dump in a cache.log. > Is it actually used anywhere or is it just something we could get rid > of without regret?
The answer depends on the outcome of the debugs-ng discussion you started. As documented in Debug.h, Ctx debugging was a solution to provide context information (e.g., transaction URL) for debugging messages that happen at lower levels. A similar approach can also be used to limit debugging scope to certain transactions, for example. Moreover, a similar approach can even be useful when reducing debugging overheads and repetition of debugging information. All are items in that debate. I suspect that old Ctx debugging code has not been maintained for a long while, and most callers do not set up context any more, which would explain why you have not seen this code being used. FWIW, we do see it triggered in customer logs now and then, but I have not studied when and where it still works. If the feature stays, it should be upgraded to use RAII pattern, of course. A lot more (and more difficult) changes would need to be done to address some of the debugs-ng items using this API. We need to get an agreement regarding those items first though. HTH, Alex.