public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* Bug and question
@ 2005-10-12  9:41 Sebastien Decugis
  2005-10-12 10:09 ` Daniel P. Berrange
  0 siblings, 1 reply; 3+ messages in thread
From: Sebastien Decugis @ 2005-10-12  9:41 UTC (permalink / raw)
  To: SystemTAP

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.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-10-12 11:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-10-12  9:41 Bug and question Sebastien Decugis
2005-10-12 10:09 ` Daniel P. Berrange
2005-10-12 11:06   ` Sebastien Decugis

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).