From owner-freebsd-dtrace@FreeBSD.ORG Wed Dec 11 01:10:10 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 5DCDDB46; Wed, 11 Dec 2013 01:10:10 +0000 (UTC) Received: from mail-ea0-x234.google.com (mail-ea0-x234.google.com [IPv6:2a00:1450:4013:c01::234]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C0A1E11CC; Wed, 11 Dec 2013 01:10:09 +0000 (UTC) Received: by mail-ea0-f180.google.com with SMTP id f15so2593192eak.11 for ; Tue, 10 Dec 2013 17:10:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=IcYOMmry++KAwZRE0b4NUzsyvnnXGkvdhEiduUo31oQ=; b=tSlqTrFaSq3TeaLMS7cF0JqW/Rb8V0HSkb/DxD3zhS0CGOumIAc4HDk8MAg375UPE/ U0sK72jyoUP1RF/nDymQMmu0rjenNTS8tPMgbhptGd2qyaYAYe/ja/ZyugVk3T3APM8L 4KAStADkee0FMctn/Rle+PqTfJx9bfG3zagVgSlHay+9UIqw3ian6P0wFG7PtTXWWn+Q U+U3nKoZ9M0rI1hgJhWiMTjCkMETKaMhlBVrdKKKiQCJRhr5sygBjNoiwfnde6iLoXe7 9+p9n4fOr+lig5l9fc2lMtvaT5J+IBAa8uylU3igdL4coCyfo400PMAXCkfd2dyQ21xG m7YQ== MIME-Version: 1.0 X-Received: by 10.14.150.5 with SMTP id y5mr15504601eej.73.1386724207999; Tue, 10 Dec 2013 17:10:07 -0800 (PST) Received: by 10.14.2.66 with HTTP; Tue, 10 Dec 2013 17:10:07 -0800 (PST) In-Reply-To: <20131211010042.GB4080@raichu> References: <20131210234714.GQ1681@albert.catwhisker.org> <20131211003245.GA4080@raichu> <20131211010042.GB4080@raichu> Date: Tue, 10 Dec 2013 17:10:07 -0800 Message-ID: Subject: Re: Examples from www.dtracebook.com From: hiren panchasara To: Mark Johnston Content-Type: text/plain; charset=UTF-8 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: Wed, 11 Dec 2013 01:10:10 -0000 On Tue, Dec 10, 2013 at 5:00 PM, Mark Johnston wrote: > On Tue, Dec 10, 2013 at 04:54:36PM -0800, hiren panchasara wrote: >> On Tue, Dec 10, 2013 at 4:32 PM, Mark Johnston 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(). My bad. I am now seeing the o/p what you are seeing above. "interesting info" == exec calls :p Thanks a lot, Hiren