Chris,
attached is a script I use for memset.
rick
On Sat, Apr 12, 2008 at 06:06:30PM -0700, Chris Williams
wrote:> Date: Sat, 12 Apr 2008 18:06:30 -0700 (PDT)
> From: Chris Williams <chris_d_williams at yahoo.com>
> Subject: [dtrace-discuss] Newbie help with a dtrace script
> To: dtrace-discuss at opensolaris.org
> Errors-to: dtrace-discuss-bounces at opensolaris.org
> Precedence: list
> X-BeenThere: dtrace-discuss at opensolaris.org
> Delivered-to: dtrace-discuss at opensolaris.org
> X-PMX-Version: 5.4.1.325704
> X-Brightmail-Tracker: AAAAAA=> X-Spam-Checker-Version: SpamAssassin
3.2.3 (2007-08-08) on
> oss-mail1.opensolaris.org
> X-Original-To: dtrace-discuss at opensolaris.org
> X-OpenSolaris-URL:
>
http://www.opensolaris.org/jive/message.jspa?messageID=224840&tstart=0#224840
> X-Antispam: No, score=-0.3/5.0, scanned in 0.101sec at (localhost
[127.0.0.1])
> by smf-spamd v1.3.1 - http://smfs.sf.net/
> X-Mailman-Version: 2.1.9
> List-Post: <mailto:dtrace-discuss at opensolaris.org>
> List-Subscribe:
<http://mail.opensolaris.org/mailman/listinfo/dtrace-discuss>,
> <mailto:dtrace-discuss-request at opensolaris.org?subject=subscribe>
> List-Unsubscribe:
> <http://mail.opensolaris.org/mailman/listinfo/dtrace-discuss>,
> <mailto:dtrace-discuss-request at
opensolaris.org?subject=unsubscribe>
> List-Archive: <http://mail.opensolaris.org/pipermail/dtrace-discuss>
> List-Help: <mailto:dtrace-discuss-request at
opensolaris.org?subject=help>
> List-Id: DTrace General Discussion <dtrace-discuss.opensolaris.org>
> X-Spam-Status: No, score=1.6 required=5.0 tests=AWL,FORGED_YAHOO_RCVD,
> RDNS_NONE autolearn=no version=3.2.3
> X-Spam-Level: *
>
> I am looking for some help with a dtrace I would like to create. I am
using the dtrace toolkit and used dappprof to see some of my user functions that
are getting called ALOT. What I would like to do is to create a dtrace script
that would give me a count of where those functions are being called and get an
aggregate count. I am just looking for some pointers on how I would go about
staring the script.
>
> Thanks!
> Chris
>
>
> --
> This message posted from opensolaris.org
> _______________________________________________
> dtrace-discuss mailing list
> dtrace-discuss at opensolaris.org
--
Rickey C. Weisner
Software Development and Performance Specialist
Sun Microsystems, INC
cell phone: 615-308-1147
email: rick.weisner at sun.com
-------------- next part --------------
#!/usr/sbin/dtrace -s
pid$1::memset:entry
/ arg2 < 17 /
{
this->tval=arg2;
@[ustack(2),arg2] = count();
/* @[ustack(5),this->tval] = count(); */
/* @[this->tval] = count(); */
/* @["memset"] = quantize(arg2); */
}
tick-10sec
{
printf("\n memset stack, size count Date: %Y ",
walltimestamp);
/* printf("\n memset size count Date: %Y ", walltimestamp); */
printa(@);
clear(@);
}
tick-100sec
{
exit(0);
}