Re: ctx_enter, ctx_exit, ctx_print

From: Amos Jeffries <squid3_at_treenet.co.nz>
Date: Mon, 17 Feb 2014 12:48:25 +1300

On 17/02/2014 2:51 a.m., 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?

It's used to prevent functions or methods used in displaying debugs()
content from screwing up when recursively calling debugs().

The RefCount and CbcPointer lock display messages are a good example,
Ip::Address string conversion for printing and similar object self-print
mechanisms, possibly also SBuf constructor/destructor when a string is
generated for printing, etc.

You should be able to see Ctx level 1 or so in a full ALL,9 log.

It may also have been intended for the AUFS threads to separate lines
when overlapping. Though in practice it fails at that and we now use
thread-local Debug connections and the ostringstream buffering to ensure
whole per-line writes to cache.log.

Amos
Received on Sun Feb 16 2014 - 23:48:42 MST

This archive was generated by hypermail 2.2.0 : Mon Feb 17 2014 - 12:00:13 MST