This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Bug and question
- From: Sebastien Decugis <sebastien dot decugis at ext dot bull dot net>
- To: SystemTAP <systemtap at sources dot redhat dot com>
- Date: Wed, 12 Oct 2005 11:42:33 +0200
- Subject: Bug and question
- Organization: Bull S.A.
Hi all,
--- bug ---
Running the latest snapshot posted on this mailing-list (on saturday),
I've run into a bug: when using the "substr" function, 'man stapfuncs'
tells that the third argument is an offset, but it appears to be an
absolute position.
As an example we have:
str = "abcdef"
sstr = substr(str, 2, 3)
here, sstr is "c" whereas it should be "cde" according to man.
--- question ---
I want to access a structure field of a parameter which is a char table,
and I want to display it as a string. Is it possible? Here is what I
want to do:
* kernel code:
struct net_device {
char name[LEN];
...
}
int dev_put(struct net_device *dev)
{
...
}
* stap code:
probe kernel.function("dev_put") {
print("device name: " . $dev->name . "\n")
}
This doesn't work yet, stap complains that $dev->name is of type
'long'... Is there a workaround? I think I only get the 'name' address
yet (can be displayed if casted to a string). How can I get the string?
Thanks in advance, and SystemTap is a great tool :)
Seb.
--
Sebastien Decugis
Bull S.A.