Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Cherokee: commits

[3422] cherokee/trunk/cherokee: It speeds up slightly trace-enabled binaries.

 

 

Cherokee commits RSS feed   Index | Next | Previous | View Threaded


cherokee at cherokee-project

Jul 3, 2009, 6:20 AM

Post #1 of 1 (170 views)
Permalink
[3422] cherokee/trunk/cherokee: It speeds up slightly trace-enabled binaries.

Revision: 3422
http://svn.cherokee-project.com/changeset/3422
Author: alo
Date: 2009-07-03 15:20:21 +0200 (Fri, 03 Jul 2009)

Log Message:
-----------
It speeds up slightly trace-enabled binaries.

Modified Paths:
--------------
cherokee/trunk/cherokee/connection.c
cherokee/trunk/cherokee/trace.c
cherokee/trunk/cherokee/trace.h

Modified: cherokee/trunk/cherokee/connection.c
===================================================================
--- cherokee/trunk/cherokee/connection.c 2009-07-03 09:29:18 UTC (rev 3421)
+++ cherokee/trunk/cherokee/connection.c 2009-07-03 13:20:21 UTC (rev 3422)
@@ -2480,9 +2480,17 @@
char *
cherokee_connection_print (cherokee_connection_t *conn)
{
- cherokee_buffer_t *buf = &conn->self_trace;
+ ret_t ret;
const char *phase;
+ cherokee_buffer_t *buf = &conn->self_trace;

+ /* Shortcut: Don't render if not tracing
+ */
+ if (! cherokee_trace_is_tracing())
+ return "";
+
+ /* Render
+ */
cherokee_buffer_clean (buf);

if (conn == NULL) {

Modified: cherokee/trunk/cherokee/trace.c
===================================================================
--- cherokee/trunk/cherokee/trace.c 2009-07-03 09:29:18 UTC (rev 3421)
+++ cherokee/trunk/cherokee/trace.c 2009-07-03 13:20:21 UTC (rev 3422)
@@ -188,3 +188,10 @@
*buf_ref = &trace.modules;
return ret_ok;
}
+
+
+int
+cherokee_trace_is_tracing (void)
+{
+ return (! cherokee_buffer_is_empty (&trace.modules));
+}

Modified: cherokee/trunk/cherokee/trace.h
===================================================================
--- cherokee/trunk/cherokee/trace.h 2009-07-03 09:29:18 UTC (rev 3421)
+++ cherokee/trunk/cherokee/trace.h 2009-07-03 13:20:21 UTC (rev 3422)
@@ -38,6 +38,7 @@
ret_t cherokee_trace_set_modules (cherokee_buffer_t *modules);
ret_t cherokee_trace_do_trace (const char *entry, const char *file, int line, const char *func, const char *fmt, ...);
ret_t cherokee_trace_get_trace (cherokee_buffer_t **buf_ref);
+int cherokee_trace_is_tracing (void);

CHEROKEE_END_DECLS

Cherokee commits RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.