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

---------------------------------------
/* scan.c */

#include <stdio.h>

int main()
{
    int str[10];

    if (scanf("%s", str) > 0)
        printf("name %s\n", str);

    return 0;
}
-----------------------------
> "dtrace -n 'pid$target:::entry' -c scanf"

if you run the above dtrace command on the program , dtrace will not exit and hung in input.

Regards
Prashanth






On Tuesday, 12 November 2013 8:18 AM, Mark Johnston <markj@freebsd.org> wrote:
 
On Tue, Nov 12, 2013 at 12:03:05PM +0800, Prashanth Kumar wrote:
> Hello, 
> 
> I had been doing some work on the pid provider in Dtrace.

Hi Prashanth,

I've been going through your patches and committing them as time permits.

>  I have made a few modification
>  so that it will list all the functions used in the program as seen in Solaris or MacOSX.
>  Presently in FreeBSD, you have to name each functions you have to probe in the program. For
>  example "dtrace -n 'pid$target:program::entry' -c ./program" will list all the functions called
>  in the
 program.This modification was made in libproc library(proc_sym.c).

This has been fixed:

http://svnweb.freebsd.org/base?view=revision&revision=257300
http://svnweb.freebsd.org/base?view=revision&revision=258000

> 
>             Also while creating probe points for return probe type, any function with more than one return
>  path will fail.This is because "fasttrap_probe_spec_t" type variable is not fully copied into the
>  kernel in fasttrap_ioctl() function.I have modified in line with Solaris code
 where the copying  is
>  done manually by Dtrace, rather than the kernel.(fasttap.c, fasttrap.h)

I'm working on this one.

>  Also in "fasttrap_pid_probe()" (fasttrap_isa.c) for the case of "FASTTRAP_T_PUSHL_EBP", the ebp register
>  has to be copied to the stack not esp.
>         I had attached the patch files for review.

This has been fixed:

http://svnweb.freebsd.org/base?view=revision&revision=257679
http://svnweb.freebsd.org/base?view=revision&revision=257143

> 
>  One other issue i noticed is that if the program being traced uses Thread Local Storage than
>  for the case of entry probe, it will hang in ___tls_get_addr function in ld-elf.so.
>  If you use scanf or fscanf in your program you can notice this behaviour. This i believe is due to
>  Dtrace using gs segment register to point to the scratch space, and TLS also loading the thread variable
>  from gs register.

I haven't been able to reproduce this one yet. If you can send me a
program and D script that does the trick, that'd be very helpful.

> 
>  if you change the following code in fasttrap_isa.c
>  <code>
>  #ifdef __i386__
>          addr = USD_GETBASE(&curthread->td_pcb->pcb_gsd);
>  #else
>          addr = curthread->td_pcb->pcb_gsbase;
>  #endif
>          addr += sizeof (void *);   
>  </code>
> 
>  to
> 
>  <code>
>  #ifdef __i386__
>          addr = USD_GETBASE(&curthread->td_pcb->pcb_gsd);
>  #else
>          addr = curthread->td_pcb->pcb_gsbase;
>  #endif
>
          addr += sizeof (void *) * 3;   
>  </code>
> 
>  the Dtrace will not hang. I am not sure what is happening here and
>  whether this is the correct solution.

Neither am I. :)


>  This changes were made in FreeBSD 9.2-386-RELEASE. I applied the above patches on
>  FreeBSD 10-BETA (with some manual work) and it was still working.
> _______________________________________________
> 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
"
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 120113;
 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>