This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Newbie question -- arrays
- From: Om Narasimhan <om dot turyx at gmail dot com>
- To: systemtap at sourceware dot org
- Date: Wed, 20 Aug 2008 23:38:51 -0700
- Subject: Newbie question -- arrays
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:content-type :content-transfer-encoding; bh=DJCoIgUBhURir9sUhPkPpcXnyrmr5GIExNsF5DcwHYw=; b=ncZvW1cSQsj+BXrY8XffRriTiolSKx+uVo0EmUYnw0nGqdXoQliIKHeWfog5WjaV6o Ukm1wa1cm0dbuLsexVqZPkdoIxgu/6DYBZM43oPRDPemf82yj23XlVos2cem/UdjgWaV 5p3XYi2alvl9+7c229IcjwZBOfLDAhDchV7K4=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; b=Mv4w9bFlYKBWPU216CaX8nrHl7GkeK7Anjlfs+ZJr5LlDC8i1k52cEztaVnz+mqpzx Osq7/jENZojp8GcUPn2X7qtGVMUVnfPRN+g48La9U/nXcdG0jusgZmTplhvVE7IigmkI fNrIGqtxH1okLeS0hCgqEjKCAa42vWTWvL08Q=
Just started with systemtap, going with the tutorial exercises.
--script begin--
[om@testserv /space/stap]$ cat open-count.stp
# establish a timer for 3 seconds, in the meantime traces open() and
counts who
# does it most and prints top 10
global op_uid_a # keeps the open counts by uid
probe timer.ms(3000)
{
foreach ( [op_id, op_name, op_count-] in op_uid_a limit 10) {
printf ("%s issued sys_open %d times\n", name, count)
}
exit()
}
probe syscall.open
{
op_uid_a[uid(), execname()]++
printf ("%s(%d): sys_open, uid = %d\n", execname(), pid(), uid());
}
--script end --
--errors start --
[om@testserv /space/stap]$ sudo stap -vv -u ./open-count.stp
SystemTap translator/driver (version 0.6.2/0.127 built 2008-03-27)
Copyright (C) 2005-2008 Red Hat, Inc. and others
This is free software; see the source for copying conditions.
Created temporary directory "/tmp/stap4iW4ix"
Searched '/usr/share/systemtap/tapset/x86_64/*.stp', found 1
Searched '/usr/share/systemtap/tapset/*.stp', found 37
Pass 1: parsed user script and 38 library script(s) in
120usr/10sys/249real ms.
probe sys_open@fs/open.c:1048 kernel section=.text pc=0xffffffff810964f3
probe compat_sys_open@fs/compat.c:1212 kernel section=.text
pc=0xffffffff810c1874
semantic error: probe_1064 with unresolved type: identifier 'op_id' at
./open-count.stp:9:13
semantic error: probe_1064 with unresolved type: identifier 'op_name' at
./open-count.stp:9:20
semantic error: probe_1064 with unresolved type: identifier 'op_count'
at ./open-count.stp:9:29
semantic error: probe_1067 with unresolved type: identifier 'op_uid_a'
at ./open-count.stp:5:8
Pass 2: analyzed script: 3 probe(s), 139 function(s), 14 embed(s), 1
global(s) in 290usr/70sys/361real ms.
Pass 2: analysis failed. Try again with more '-v' (verbose) options.
Running rm -rf /tmp/stap4iW4ix
--errors end--