httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rahul <ra...@Sun.COM>
Subject dtrace in apache
Date Sat, 23 Aug 2008 07:30:37 GMT
Hi,
I was reviewing the omniti labs dtrace functions, at
http://labs.omniti.com/trac/project-dtrace/browser/trunk/apache22/apr-util-hook-probes.patch
This patch (util-hook) is committed into apache already.

I was concerned that quite a few were just tracing function boundaries,
which the dtrace does already for us with out the necessity of USDT probes
baked into the code.

For e.g in APR_IMPLEMENT_XXX macros, the below are inserted.
but APR_IMPLEMENT_XXX macros already create function boundaries when
they are called and these probes effectively duplicate the
instrumentation available.


 /**
  * @file apr_hooks.h
  * @brief Apache hook functions
@@ -107,12 +124,21 @@
     ns##_LINK_##name##_t *pHook; \
     int n; \
 \
-    if(!_hooks.link_##name) \
-   return; \
+    OLD_DTRACE_PROBE(name##__entry); \
 \
-    pHook=(ns##_LINK_##name##_t *)_hooks.link_##name->elts; \
-    for(n=0 ; n < _hooks.link_##name->nelts ; ++n) \
-   pHook[n].pFunc args_use; \
+    if(_hooks.link_##name) \
+        { \
+        pHook=(ns##_LINK_##name##_t *)_hooks.link_##name->elts; \
+        for(n=0 ; n < _hooks.link_##name->nelts ; ++n) \
+            { \
+            OLD_DTRACE_PROBE1(name##__dispatch__invoke, (char
*)pHook[n].szName); \
+       pHook[n].pFunc args_use; \
+            OLD_DTRACE_PROBE2(name##__dispatch__complete, (char
*)pHook[n].szName, 0); \
+            } \
+        } \
+\
+    OLD_DTRACE_PROBE1(name##__return, 0); \
+\
     }


What do you think?

                                    rahul
--
1. e4 _

Mime
View raw message