Return-Path: Delivered-To: apmail-httpd-dev-archive@www.apache.org Received: (qmail 7351 invoked from network); 23 Aug 2008 11:29:51 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 23 Aug 2008 11:29:51 -0000 Received: (qmail 8017 invoked by uid 500); 23 Aug 2008 11:29:43 -0000 Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 7936 invoked by uid 500); 23 Aug 2008 11:29:42 -0000 Mailing-List: contact dev-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list dev@httpd.apache.org Received: (qmail 7924 invoked by uid 99); 23 Aug 2008 11:29:42 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 23 Aug 2008 04:29:42 -0700 X-ASF-Spam-Status: No, hits=-2.1 required=10.0 tests=DATE_IN_PAST_06_12,RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [192.18.43.132] (HELO sca-es-mail-1.sun.com) (192.18.43.132) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 23 Aug 2008 11:28:43 +0000 Received: from fe-sfbay-09.sun.com ([192.18.43.129]) by sca-es-mail-1.sun.com (8.13.7+Sun/8.12.9) with ESMTP id m7NBSoRr017917 for ; Sat, 23 Aug 2008 04:29:01 -0700 (PDT) Received: from conversion-daemon.fe-sfbay-09.sun.com by fe-sfbay-09.sun.com (Sun Java System Messaging Server 6.2-8.04 (built Feb 28 2007)) id <0K6100M01X2WKK00@fe-sfbay-09.sun.com> (original mail from Basant.Kukreja@Sun.COM) for dev@httpd.apache.org; Sat, 23 Aug 2008 04:28:50 -0700 (PDT) Received: from sun.com ([129.150.16.8]) by fe-sfbay-09.sun.com (Sun Java System Messaging Server 6.2-8.04 (built Feb 28 2007)) with ESMTPSA id <0K61009KWX82ZSD0@fe-sfbay-09.sun.com> for dev@httpd.apache.org; Sat, 23 Aug 2008 04:28:50 -0700 (PDT) Date: Fri, 22 Aug 2008 21:27:19 -0700 From: Basant Kukreja Subject: Re: dtrace in apache In-reply-to: <20080823073037.GD23418@vayavyam.India.Sun.COM> Sender: Basant.Kukreja@Sun.COM To: dev@httpd.apache.org Message-id: <20080823042719.GA3710@lmonica2.home> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7BIT Content-disposition: inline References: <20080823073037.GD23418@vayavyam.India.Sun.COM> User-Agent: Mutt/1.5.18 (2008-05-17) X-Virus-Checked: Checked by ClamAV on apache.org Hi, I agree with Rahul. pid provider can be used to trace apr calls. Following dscript traces apr calls in stock apache (without any probes) pid*::apr_*:entry /execname == "httpd"/ { } pid*::apr_*:return /execname == "httpd"/ { } -------------------------------------- If apr calls would not have been started with prefix apr_ then putting a specific probe might make more sense. I have written a small blog for it. http://blogs.sun.com/basant/entry/tracking_apr_calls_in_apache Regards, Basant. On Sat, Aug 23, 2008 at 01:00:37PM +0530, rahul wrote: > 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 _