Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 16 Nov 2013 23:48:01 -0500
From:      Mark Johnston <markj@freebsd.org>
To:        Prashanth Kumar <pra_udupi@yahoo.co.in>
Cc:        "freebsd-dtrace@freebsd.org" <freebsd-dtrace@freebsd.org>
Subject:   Re: Fw: your mail
Message-ID:  <20131117044801.GB64214@charmander>
In-Reply-To: <1384260159.73063.YahooMailNeo@web192605.mail.sg3.yahoo.com>
References:  <1384228985.51085.YahooMailNeo@web192604.mail.sg3.yahoo.com> <20131112041805.GA76413@raichu> <1384258564.17896.YahooMailNeo@web192603.mail.sg3.yahoo.com> <1384260159.73063.YahooMailNeo@web192605.mail.sg3.yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Nov 12, 2013 at 08:42:39PM +0800, Prashanth Kumar wrote:
> 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.

I can't reproduce that problem. If I use 'pid$target:::entry', dtrace(1)
matches ~3000 probes and usually exits immediately with
"processing aborted: No error".

If I instead use 'pid$target:ld-elf.so.*::entry', I get:

markj@charmander: ~/src/dtrace/tls $ sudo dtrace -n 'pid$target:ld-elf.so.*::entry' -c ./test
dtrace: description 'pid$target:ld-elf.so.*::entry' matched 21 probes
CPU     ID                    FUNCTION:NAME
  2  39804             __tls_get_addr:entry 
mark
name: mark
dtrace: pid 75490 has exited
  2  39804             __tls_get_addr:entry 
  2  39804             __tls_get_addr:entry 
  2  39804             __tls_get_addr:entry 
  2  39804             __tls_get_addr:entry 
  2  39804             __tls_get_addr:entry 
  2  39804             __tls_get_addr:entry 
  2  39786            _rtld_addr_phdr:entry 

What version of FreeBSD are you using? Are you i386 or amd64? (I'm on
amd64.)

-Mark



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