Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 12 Nov 2013 20:42:39 +0800 (SGT)
From:      Prashanth Kumar <pra_udupi@yahoo.co.in>
To:        "freebsd-dtrace@freebsd.org" <freebsd-dtrace@freebsd.org>
Subject:   Fw: your mail
Message-ID:  <1384260159.73063.YahooMailNeo@web192605.mail.sg3.yahoo.com>
In-Reply-To: <1384258564.17896.YahooMailNeo@web192603.mail.sg3.yahoo.com>
References:  <1384228985.51085.YahooMailNeo@web192604.mail.sg3.yahoo.com> <20131112041805.GA76413@raichu> <1384258564.17896.YahooMailNeo@web192603.mail.sg3.yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi Mark=0A=0A---------------------------------------=0A/* scan.c */=0A=0A#i=
nclude <stdio.h>=0A=0Aint main()=0A{=0A=A0=A0=A0 int str[10];=0A=0A=A0=A0=
=A0 if (scanf("%s", str) > 0)=0A=A0=A0=A0 =A0=A0=A0 printf("name %s\n", str=
);=0A=0A=A0=A0=A0 return 0;=0A}=0A-----------------------------=0A> "dtrace=
 -n 'pid$target:::entry' -c scanf"=0A=0Aif you run the above dtrace command=
 on the program , dtrace will not exit and hung in input.=0A=0ARegards=0APr=
ashanth=0A=0A=0A=0A=0A=0A=0AOn Tuesday, 12 November 2013 8:18 AM, Mark John=
ston <markj@freebsd.org> wrote:=0A =0AOn Tue, Nov 12, 2013 at 12:03:05PM +0=
800, Prashanth Kumar wrote:=0A> Hello, =0A> =0A> I had been doing some work=
 on the pid provider in Dtrace.=0A=0AHi Prashanth,=0A=0AI've been going thr=
ough your patches and committing them as time permits.=0A=0A>=A0 I have mad=
e a few modification=0A> =A0so that it will list all the functions used in =
the program as seen in Solaris or MacOSX.=0A> =A0Presently in FreeBSD, you =
have to name each functions you have to probe in the program. For=0A> =A0ex=
ample "dtrace -n 'pid$target:program::entry' -c ./program" will list all th=
e functions called=0A> =A0in the=0A program.This modification was made in l=
ibproc library(proc_sym.c).=0A=0AThis has been fixed:=0A=0Ahttp://svnweb.fr=
eebsd.org/base?view=3Drevision&revision=3D257300=0Ahttp://svnweb.freebsd.or=
g/base?view=3Drevision&revision=3D258000=0A=0A> =0A> =A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0 Also while creating probe points for return probe type, any fu=
nction with more than one return=0A> =A0path will fail.This is because "fas=
ttrap_probe_spec_t" type variable is not fully copied into the=0A> =A0kerne=
l in fasttrap_ioctl() function.I have modified in line with Solaris code=0A=
 where the copying=A0 is=0A> =A0done manually by Dtrace, rather than the ke=
rnel.(fasttap.c, fasttrap.h)=0A=0AI'm working on this one.=0A=0A> =A0Also i=
n "fasttrap_pid_probe()" (fasttrap_isa.c) for the case of "FASTTRAP_T_PUSHL=
_EBP", the ebp register=0A> =A0has to be copied to the stack not esp.=0A> =
=A0=A0=A0=A0=A0=A0=A0 I had attached the patch files for review.=0A=0AThis =
has been fixed:=0A=0Ahttp://svnweb.freebsd.org/base?view=3Drevision&revisio=
n=3D257679=0Ahttp://svnweb.freebsd.org/base?view=3Drevision&revision=3D2571=
43=0A=0A> =0A> =A0One other issue i noticed is that if the program being tr=
aced uses Thread Local Storage than=0A> =A0for the case of entry probe, it =
will hang in ___tls_get_addr function in ld-elf.so.=0A> =A0If you use scanf=
 or fscanf in your program you can notice this behaviour. This i believe is=
 due to=0A> =A0Dtrace using gs segment register to point to the scratch spa=
ce, and TLS also loading the thread variable=0A> =A0from gs register.=0A=0A=
I haven't been able to reproduce this one yet. If you can send me a=0Aprogr=
am and D script that does the trick, that'd be very helpful.=0A=0A> =0A> =
=A0if you change the following code in fasttrap_isa.c=0A> =A0<code>=0A> =A0=
#ifdef __i386__=0A> =A0=A0=A0=A0=A0=A0=A0=A0 addr =3D USD_GETBASE(&curthrea=
d->td_pcb->pcb_gsd);=0A> =A0#else=0A> =A0=A0=A0=A0=A0=A0=A0=A0 addr =3D cur=
thread->td_pcb->pcb_gsbase;=0A> =A0#endif=0A> =A0=A0=A0=A0=A0=A0=A0=A0 addr=
 +=3D sizeof (void *);=A0 =A0=0A> =A0</code>=0A> =0A> =A0to=0A> =0A> =A0<co=
de>=0A> =A0#ifdef __i386__=0A> =A0=A0=A0=A0=A0=A0=A0=A0 addr =3D USD_GETBAS=
E(&curthread->td_pcb->pcb_gsd);=0A> =A0#else=0A> =A0=A0=A0=A0=A0=A0=A0=A0 a=
ddr =3D curthread->td_pcb->pcb_gsbase;=0A> =A0#endif=0A>=0A =A0=A0=A0=A0=A0=
=A0=A0=A0 addr +=3D sizeof (void *) * 3;=A0 =A0=0A> =A0</code>=0A> =0A> =A0=
the Dtrace will not hang. I am not sure what is happening here and=0A> =A0w=
hether this is the correct solution.=0A=0ANeither am I. :)=0A=0A=0A> =A0Thi=
s changes were made in FreeBSD 9.2-386-RELEASE. I applied the above patches=
 on=0A> =A0FreeBSD 10-BETA (with some manual work) and it was still working=
.=0A> _______________________________________________=0A> freebsd-dtrace@fr=
eebsd.org mailing list=0A> https://lists.freebsd.org/mailman/listinfo/freeb=
sd-dtrace=0A> To unsubscribe, send any mail to "freebsd-dtrace-unsubscribe@=
freebsd.org=0A"
From owner-freebsd-dtrace@FreeBSD.ORG  Tue Nov 12 16:01:19 2013
Return-Path: <owner-freebsd-dtrace@FreeBSD.ORG>
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 ESMTPS id B05BB4ED
 for <freebsd-dtrace@freebsd.org>; Tue, 12 Nov 2013 16:01:19 +0000 (UTC)
Received: from mail-qe0-x232.google.com (mail-qe0-x232.google.com
 [IPv6:2607:f8b0:400d:c02::232])
 (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits))
 (No client certificate requested)
 by mx1.freebsd.org (Postfix) with ESMTPS id 782282775
 for <freebsd-dtrace@freebsd.org>; Tue, 12 Nov 2013 16:01:19 +0000 (UTC)
Received: by mail-qe0-f50.google.com with SMTP id 1so5759453qee.9
 for <freebsd-dtrace@freebsd.org>; Tue, 12 Nov 2013 08:01:18 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=mime-version:date:message-id:subject:from:to:content-type;
 bh=SQubBQr4FEjiygwLztQqXBTdycovjvRNRTjRECJ1YTM=;
 b=ul7PdNmKjHsCUb7oAg1iQnw+O4hN5rJqyYl0NwomP5bRHk4xgLYQ5vqNYeZK3pXNHs
 Cen1qIdKjps9heNfgkXzmpRAg1QTFievzpGtQMMfoHQejzfiYXtlzmN8wy/IkdlM6zbD
 sQHFB+yz4auWRHrNZu4xG0NaAdqGngUvMo7LoBaRir/i+o2UsoJVMIXi6BH2mChMuZq/
 mWYk9/YjursiMROekwZl4lj1kbSHGpHW2K1H3eEmMjZSh24HdMGJFLGh8ZOz5voxyaCv
 eDkuf0Jqmak9U7P4V/58WveB7Ttlm0iUfugJXbbpQ0gTna35aW1CJhOMAq3nHx0xQ08I
 nFvg==
MIME-Version: 1.0
X-Received: by 10.224.103.199 with SMTP id l7mr59542459qao.56.1384272078701;
 Tue, 12 Nov 2013 08:01:18 -0800 (PST)
Received: by 10.224.160.77 with HTTP; Tue, 12 Nov 2013 08:01:18 -0800 (PST)
Date: Wed, 13 Nov 2013 00:01:18 +0800
Message-ID: <CAAvnz_pb_6gwx7fF1731qUf4D5Bia9uZKKMRsyJgy_yAhYQg-g@mail.gmail.com>
Subject: bug in dtrace mips fbt
From: Howard Su <howard0su@gmail.com>
To: freebsd-dtrace@freebsd.org
Content-Type: text/plain; charset=ISO-8859-1
X-Content-Filtered-By: Mailman/MimeDel 2.1.16
X-BeenThere: freebsd-dtrace@freebsd.org
X-Mailman-Version: 2.1.16
Precedence: list
List-Id: "A discussion list for developers working on DTrace in FreeBSD."
 <freebsd-dtrace.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/freebsd-dtrace>, 
 <mailto:freebsd-dtrace-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/freebsd-dtrace/>;
List-Post: <mailto:freebsd-dtrace@freebsd.org>
List-Help: <mailto:freebsd-dtrace-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/freebsd-dtrace>,
 <mailto:freebsd-dtrace-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Tue, 12 Nov 2013 16:01:19 -0000

I notice a small error in fbt provider of mips.

In file: cddl/dev/fbt/powerpc.c
222:    limit = (u_int32_t *) symval->value + symval->size;

this should be limit = (u_int32_t *) ((u_int8_t*)symval->value +
symval->size);

I don't have powerpc to test. anyone can test this and fix it?

-Howard



-- 
-Howard



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1384260159.73063.YahooMailNeo>