From owner-freebsd-dtrace@FreeBSD.ORG Mon Nov 4 14:11:08 2013 Return-Path: Delivered-To: freebsd-dtrace@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id C8CCDBF4 for ; Mon, 4 Nov 2013 14:11:08 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-ie0-x235.google.com (mail-ie0-x235.google.com [IPv6:2607:f8b0:4001:c03::235]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 95AA127C3 for ; Mon, 4 Nov 2013 14:11:08 +0000 (UTC) Received: by mail-ie0-f181.google.com with SMTP id ar20so12580943iec.12 for ; Mon, 04 Nov 2013 06:11:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=q54fIYaTP4OeyntxEcgA04YZSrB4m79/SGXCNItKnvE=; b=e28M6JoPuUtpHmkDy4mo+cAcGN20Gv92ERZNp4xsO9YqLDdcEr5br85WnmkzofMV2c Fe/OCRXP1icmlhyoTvmyyceFVBnhZxytaKkMEOBEJYNQ4uqSD1Y4kMGoht0BK1MMoC9N qP6XMjnYVe41tTt5uTAz64k49oSPf8cdRRKNGqo0ztdxsIkWrAoEq0Zp3/q9zYpecQIt bX03Xy4u6/4aBL39nJUaNMCMLK6GQAMoh+T9gdBICgdhqiW5S4854pYxM1TWt9HcX6TW meX34k+im4EYha/LJllcIv4NLRms5sGKcXs4dCQGOFe0DWRcKtU2/yuTIzBlAiJjdfWR Pbvw== X-Received: by 10.42.46.80 with SMTP id j16mr24775icf.94.1383574267743; Mon, 04 Nov 2013 06:11:07 -0800 (PST) Received: from raichu (24-212-218-13.cable.teksavvy.com. [24.212.218.13]) by mx.google.com with ESMTPSA id ka1sm2124671igb.7.2013.11.04.06.11.06 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 04 Nov 2013 06:11:07 -0800 (PST) Sender: Mark Johnston Date: Mon, 4 Nov 2013 09:11:05 -0500 From: Mark Johnston To: John Luk Subject: Re: dtrace showed matched probes but nothing in output on FreeBSD 9.1-RELEASE Message-ID: <20131104141105.GE8007@raichu> References: <20131103235936.GB15661@raichu> <20131104043519.GB8007@raichu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: freebsd-dtrace@freebsd.org X-BeenThere: freebsd-dtrace@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "A discussion list for developers working on DTrace in FreeBSD." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Nov 2013 14:11:08 -0000 On Mon, Nov 04, 2013 at 04:56:43PM +0800, John Luk wrote: > EDIT:Apologies for miss-sent mail. > > Great! Seems that we're on the right way, I got the output below: > > # dtrace -s ufunc.d -c ./a.out a.out > dtrace: script 'ufunc.d' matched 5 probes > ^C > > foo 1 > foo1 1 > main 1 > > through the inet_makeaddr was missing. I applied the patch with: It could be that your compiler is inlining it. Can you run the following commands and paste the output? # gdb ./a.out (gdb) disas main Thanks -Mark > > patch < libproc_sym_lookup-9.1.diff > > Thanks again for your patch, Mark :) > > > Cheers, > spin6lock > > 2013/11/4 John Luk : > > Great! Seems that we're on the right way, I got the output below: > > > > # dtrace -s ufunc.d -c ./a.out a.out > > dtrace: script 'ufunc.d' matched 5 probes > > ^C > > > > foo 1 > > foo1 1 > > main 1 > > > > through the inet_makeaddr was missing. I applied the patch with: > > > > patch < libproc_sym_lookup-9.1.diff > > > > Thanks again for your patch, Mark :) > > > > Cheers, > > spin6lock > > > > > > 2013/11/4 Mark Johnston : > >> On Mon, Nov 04, 2013 at 12:11:55PM +0800, John Luk wrote: > >>> Thanks, Mark. But I still got nothing :( > >>> The line number of your patch wasn't match with mine, I patched it > >>> on hand. Was it because I was on an older version of src? The head > >>> of proc_sym.c shows: > >>> > >>> $FreeBSD: release/9.1.0/lib/libproc/proc_sym.c 211184 2010-08-11 > >>> 17:33:26Z rpaulo > >>> > >>> And the patch of mine is include below, is it correct? > >> > >> Sorry, I missed that you were on 9.1. The patch you pasted had a mistake > >> in it; can you instead try applying the patch here: > >> > >> http://people.freebsd.org/~markj/patches/libproc_sym_lookup-9.1.diff > >> > >> I created it against the 9.1 tree, so it should apply cleanly. I built and > >> installed the patched 9.1 libproc on a machine running head, and got the > >> expected behaviour: > >> > >> mark@raichu: ~/src/dtrace/ufunc $ sudo dtrace -s ufunc.d -c ./test test > >> dtrace: script 'ufunc.d' matched 9 probes > >> dtrace: pid 11555 has exited > >> > >> __do_global_dtors_aux 1 > >> foo 1 > >> foo1 1 > >> inet_makeaddr 1 > >> main 1 > >> > >> mark@raichu: ~/src/dtrace/ufunc $ > >> > >> I don't think that this will be the final patch; checking for ET_EXEC to > >> determine whether to add a relocation offset seems a bit dubious; I'm > >> pretty sure it won't work for position-independent executables. > >> > >> Thanks, > >> -Mark > >> > >>> > >>> [...] > >>>