From owner-freebsd-dtrace@FreeBSD.ORG Sun Dec 29 19:29:28 2013 Return-Path: Delivered-To: freebsd-dtrace@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F25C7891 for ; Sun, 29 Dec 2013 19:29:27 +0000 (UTC) Received: from mail-ie0-x233.google.com (mail-ie0-x233.google.com [IPv6:2607:f8b0:4001:c03::233]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BB543126A for ; Sun, 29 Dec 2013 19:29:27 +0000 (UTC) Received: by mail-ie0-f179.google.com with SMTP id x13so10957401ief.24 for ; Sun, 29 Dec 2013 11:29:26 -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:content-transfer-encoding :in-reply-to:user-agent; bh=lgFdcgNRPBACSqHW1Xd6BOumfqi82WI5HvKr6Qh1x20=; b=w+VS2g4zJZ+EENhujcY+MARMZDAkO7ePkgJBO+vjXL9VaI7oALALbahRFq1pW2jbMX VOrt0kTtM/+PjcA63m9J7YfXpJJovQVBrB5x8SQKRD8Zc3kTl9DThIi41fFJZtnv4U4l grJB+g1ea2+CdpVe5l76BQVOuNZ8Rjlx45L0ReXTl9rgMgnx7NowFiNO5o3IgNP72VEL AJIQ2cUc28ae/LskiSm2l7FPZElb3oaZaGUc/yDDrZo7CRGfvHBNtBOSgYls2GPX2aMe ooz3QpNJfLSYX7OEH7rifAX5dMFsH36Bi6UVQ3hyrbWkBwdCYExGVZd2tNr9dAkqAMBh 2pjg== X-Received: by 10.50.66.208 with SMTP id h16mr34219464igt.0.1388345366529; Sun, 29 Dec 2013 11:29:26 -0800 (PST) Received: from charmander.home ([65.95.185.87]) by mx.google.com with ESMTPSA id d18sm41465479igz.0.2013.12.29.11.29.24 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 29 Dec 2013 11:29:25 -0800 (PST) Sender: Mark Johnston Date: Sun, 29 Dec 2013 14:28:44 -0500 From: Mark Johnston To: Prashanth Kumar Subject: Re: Please review: dtrace usdt Message-ID: <20131229192844.GA8721@charmander.home> References: <1387107019.65592.YahooMailBasic@web192601.mail.sg3.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1387107019.65592.YahooMailBasic@web192601.mail.sg3.yahoo.com> User-Agent: Mutt/1.5.22 (2013-10-16) Cc: freebsd-dtrace@freebsd.org X-BeenThere: freebsd-dtrace@freebsd.org X-Mailman-Version: 2.1.17 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: Sun, 29 Dec 2013 19:29:28 -0000 On Sun, Dec 15, 2013 at 07:30:19PM +0800, Prashanth Kumar wrote: > > Dtrace doesn't properly process object file of relocation type SHT_REL, which is type > in FreeBSD i386. The following patch checks for both relocation types SHT_REL and SHT_RELA, and > calls matching update function.Tested usdt example program from (https://wiki.freebsd.org/DTrace/userland) > in FreeBSD -10BETA1 - i386 and it works. Hi Prashanth, Thanks for the patch. I've committed a modified version of it as r260051: http://svnweb.freebsd.org/base?view=revision&revision=260051 -Mark > -------------------------------------------------- > --- dt_link.c 2013-12-15 14:24:37.000000000 +0400 > +++ /usr/src/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c 2013-12-15 14:22:21.000000000 +0400 > @@ -1542,7 +1542,10 @@ > rela.r_offset = 0; > rela.r_info = 0; > rela.r_addend = 0; > - (void) gelf_update_rela(data_rel, i, &rela); > + if (shdr_rel.sh_type == SHT_RELA) > + (void) gelf_update_rela(data_rel, i, &rela); > + else > + (void) gelf_update_rel(data_rel, i, (GElf_Rel *)&rela); > #endif > > mod = 1; > ----------------------------------------------------------- > > prashanth > -------------------------------------------- > On Wed, 4/12/13, Michael Harsch wrote: > > Subject: Re: dtrace usdt > To: "Prashanth Kumar" > Cc: freebsd-dtrace@freebsd.org > Date: Wednesday, 4 December, 2013, 11:13 PM > > Hi Prashanth, > > I've reproduced this on 10.0BETA4.  It appears to be > specific to i386; > the same test works fine on amd64. > > On Wed, Dec 4, 2013 at 3:29 AM, Prashanth Kumar > wrote: > > Hi > > Tried running the dtrace usdt example code from freebsd > dtrace userland wiki page. > > (https://wiki.freebsd.org/DTrace/userland). > > > > If run standalone the program segfaults. > >  # ./db > > Bus error (core dumped) > > > > If run with dtrace > > > >   # dtrace -s db.d -c ./db > > dtrace: script 'db.d' matched 2 probes > > CPU     ID      >               > FUNCTION:NAME > >   0  43245      >         >    main:query-start Query: SELECT * FROM > apples > > > > the program hungs after printing the first probe. > > > > Had to use the following command > >   # env WITH_DTRACE=1 make > > > > to build the program. Is there any other steps that i > have missed to make the program work?. > > This was tested on FreeBSD 10BETA1 - i386. > > > > regards > > Prashanth > > _______________________________________________ > > freebsd-dtrace@freebsd.org > mailing list > > https://lists.freebsd.org/mailman/listinfo/freebsd-dtrace > > To unsubscribe, send any mail to "freebsd-dtrace-unsubscribe@freebsd.org" > > > > _______________________________________________ > freebsd-dtrace@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-dtrace > To unsubscribe, send any mail to "freebsd-dtrace-unsubscribe@freebsd.org"