Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 10 Dec 2013 20:00:42 -0500
From:      Mark Johnston <markj@freebsd.org>
To:        hiren panchasara <hiren.panchasara@gmail.com>
Cc:        freebsd-dtrace@freebsd.org
Subject:   Re: Examples from www.dtracebook.com
Message-ID:  <20131211010042.GB4080@raichu>
In-Reply-To: <CALCpEUEPaiRkNfxBPynvOE7c_xOvtjt_CRSBLUpUDDPwTHscyQ@mail.gmail.com>
References:  <CALCpEUFnwN%2BmwTDyq-_q3x8jkk8EBfzMMyRzVeHDrHq=j-nqVg@mail.gmail.com> <20131210234714.GQ1681@albert.catwhisker.org> <CALCpEUGms0S%2BQue%2B6TmAZmRW4t8LZh02r-q%2Bvf1WupDkwcpH-Q@mail.gmail.com> <CALCpEUE7%2BPY9tCdc3R-cXfeXCy%2BRYmz9aNTKcbwat3tgvniORQ@mail.gmail.com> <20131211003245.GA4080@raichu> <CALCpEUEPaiRkNfxBPynvOE7c_xOvtjt_CRSBLUpUDDPwTHscyQ@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Dec 10, 2013 at 04:54:36PM -0800, hiren panchasara wrote:
> On Tue, Dec 10, 2013 at 4:32 PM, Mark Johnston <markj@freebsd.org> wrote:
> > On Tue, Dec 10, 2013 at 04:26:54PM -0800, hiren panchasara wrote:
> >> $ sudo dtrace -n 'proc:::exec-success { trace(curpsinfo->pr_psargs); }'
> >> dtrace: description 'proc:::exec-success ' matched 1 probe
> >> CPU     ID                    FUNCTION:NAME
> >>   5  48876                    :exec-success   /bin/sh /usr/bin/man ls
> >>   2  48876                    :exec-success   /sbin/sysctl -n hw.machine_arch
> >>   6  48876                    :exec-success   /sbin/sysctl -n hw.machine
> >>   0  48876                    :exec-success   /usr/bin/locale
> >>   7  48876                    :exec-success   /usr/bin/zcat
> >> /usr/share/man/man1/ls.1.gz
> >>   2  48876                    :exec-success   head -1
> >>   1  48876                    :exec-success   tbl
> >>   6  48876                    :exec-success   groff -S -P-h -Wall
> >> -mtty-char -man -Tascii -P-c
> >>   7  48876                    :exec-success   /usr/bin/zcat
> >> /usr/share/man/man1/ls.1.gz
> >>   3  48876                    :exec-success   less
> >>   3  48876                    :exec-success   troff -Wall -mtty-char
> >> -man -Tascii
> >>   7  48876                    :exec-success   grotty -h -c
> >>
> >>
> >>   6  48876                    :exec-success   top
> >>   7  48876                    :exec-success   ps awwux
> >>   7  48876                    :exec-success   iostat
> >>   5  48876                    :exec-success   vmstat 1
> >>   4  48876                    :exec-success   bash
> >>   4  48876                    :exec-success   whois
> >>   5  48876                    :exec-success   whoami
> >>   4  48876                    :exec-success   devinfo
> >>   4  48876                    :exec-success   dmesg
> >>   6  48876                    :exec-success   pciconf -lv
> >>
> >> I am getting interesting info only when "man" is executed and not for
> >> any other command. What does that tell me? How is man special? Other
> >> programs must also be doing exec(2), no?
> >
> > /usr/bin/man is a shell script. You'll see similar output for any
> > executable that starts with a shebang.
> 
> Thanks Mark for responding but that doesn't seem true.
> 
> I tried apropos(1) without luck.

I get the following with "apropos dtrace":

mark@raichu: ~ $ sudo dtrace -n 'proc:::exec-success {trace(curpsinfo->pr_psargs);}'
Password:
dtrace: description 'proc:::exec-success ' matched 1 probe
CPU     ID                    FUNCTION:NAME
 4  35852                    :exec-success   /bin/sh /usr/bin/apropos dtrace  
 2  35852                    :exec-success   grep -Ehi -- dtrace /usr/share/man/whatis /usr/local/man/whatis /usr/share/openssl/man/whatis /usr/local/lib/perl5/5.14/man/whatis /usr/local/lib/perl5/5.14/perl/man/whatis
 2  35852                    :exec-success   /usr/bin/less -i     

I don't really know what you mean by "interesting info." The other
programs you ran (whoami, pciconf, dmesg, devinfo) above don't call
execv().



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