From: David A Sperry <David_A_Sperry@raytheon.com>
To: <systemtap@sources.redhat.com>
Subject: Another Newbie question about measuring time in a sys call
Date: Wed, 08 Feb 2006 01:29:00 -0000 [thread overview]
Message-ID: <OF9A980AD4.6A1AABB6-ON8525710F.0006CB90-8525710F.000827AB@mck.us.ray.com> (raw)
Hi,
I'm trying to run the top example from a few months ago to play with
measuring time. I run top in one window and stap in another. The problem is
I am getting some strange answers.
Here's the script I copied out of an old message:
[sperryd@ibm systap]$ cat top.stp
global called, ttime
probe kernel.syscall.* {
if (execname() == "top")
called[name] = gettimeofday_us()
}
probe kernel.syscall.*.return {
if (execname() == "top")
ttime[name] += gettimeofday_us() - called[name]
}
probe end {
foreach ([n] in ttime-)
printf("%s took %d usecs\n", n, ttime[n])
}
Here are the results I get:
[root@ibm systap]# stap top.stp -v
Pass 1: parsed user script and 11 library script(s) in 140usr/0sys/140real
ms.
Pass 2: analyzed script: 293 probe(s), 18 function(s), 2 global(s) in
1160usr/40sys/1210real ms.
Pass 3: translated to C into "/tmp/stapOj2TEx/stap_905.c" in
300usr/110sys/406real ms.
Pass 4: compiled C into "stap_905.ko" in 45460usr/1690sys/46011real ms.
stat64.return took 4918620585892709376 usecs
fcntl64.return took 1886781490013993830 usecs
lseek.return took 123050966740266106 usecs
llseek.return took 82033977826804214 usecs
ioctl.return took 82033977825997218 usecs
getdents.return took 82033977825866159 usecs
fstat64.return took 41016988912499374 usecs
gettimeofday.return took 41016988912493711 usecs
creat.return took -8486451935184063013 usecs
Pass 5: run completed in 10usr/100sys/117204real ms.
[root@ibm systap]#
I'm guessing the syscall tapsets may have changed and the associative array
may be getting confused between a call and it's return (lseek vs
lseek.return)
Any help would be appreciated
Thanks
Dave Sperry
next reply other threads:[~2006-02-08 1:29 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-02-08 1:29 David A Sperry [this message]
2006-02-08 1:52 ` Li Guanglei
2006-02-08 5:56 ` Li Guanglei
2006-02-08 12:32 ` Frank Ch. Eigler
2006-02-08 13:46 ` David A Sperry
2006-02-08 15:18 ` Frank Ch. Eigler
2006-02-08 15:54 ` David A Sperry
2006-02-08 16:24 ` Frank Ch. Eigler
2006-02-08 17:38 ` Martin Hunt
2006-02-08 21:14 ` Martin Hunt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=OF9A980AD4.6A1AABB6-ON8525710F.0006CB90-8525710F.000827AB@mck.us.ray.com \
--to=david_a_sperry@raytheon.com \
--cc=systemtap@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).