On Tue, Jun 08, 2010 at 02:56:46PM -0500, William Rowe wrote:
> > URL:
> > http://svn.apache.org/viewvc/httpd/httpd/trunk/server/log.c?rev=952724&r1=952723&r2=952724&view=diff
> > ==============================================================================
> > --- httpd/httpd/trunk/server/log.c (original)
> > +++ httpd/httpd/trunk/server/log.c Tue Jun 8 16:26:39 2010
...
> > + if (ap_mpm_query(AP_MPMQ_IS_THREADED, &result) == 0
> > + && result == AP_MPMQ_STATIC) {
> > + apr_os_thread_t tid = apr_os_thread_current();
> > + len += apr_snprintf(errstr + len, MAX_STRING_LEN - len,
> > + ":tid %pT", &tid);
> > + }
> > }
> > #endif
> > errstr[len++] = ']';
>
> Question; where is the best place to perform this query once; and then to set
> aside the ap_mpm_query result as a static? Hitting an mpm_query on each and
> every log entry isn't exactly efficient.
Looking at this again, I'm not sure why using ap_mpm_query() is going to
a noticeable overhead. A hook invocation is only a couple of function
calls and pointer deferences; I would strongly suspect this is lost in
the noise relative to the huge amount of printf string parsing goop
going on here.
I am concerned about how verbose the error_log output is now though.
How about restricting this whole pid/tid logging block to
if (level_and_mask >= APLOG_DEBUG) {
?
Regards, Joe