Bug and question
Daniel P. Berrange
berrange@redhat.com
Wed Oct 12 10:09:00 GMT 2005
On Wed, Oct 12, 2005 at 11:42:33AM +0200, Sebastien Decugis wrote:
> 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:
Yes, but you need to use either 'user_string' or 'kernel_string' functions
to convert into the systemtap runtime string object. If you don't do this
you'll just get back the pointer as a long.
> probe kernel.function("dev_put") {
> print("device name: " . $dev->name . "\n")
> }
Try changing it to look like:
probe kernel.function("dev_put") {
print("device name: " . kernel_string($dev->name) . "\n")
}
Regards,
Dan.
--
|=- Red Hat, Global Professional Services, London. +44 (0)7977 267 243 -=|
|=- Perl modules: http://search.cpan.org/~danberr/ -=|
|=- Projects: http://freshmeat.net/~danielpb/ -=|
|=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=|
More information about the Systemtap
mailing list