This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: Bug and question
- From: "Daniel P. Berrange" <berrange at redhat dot com>
- To: Sebastien Decugis <sebastien dot decugis at ext dot bull dot net>
- Cc: SystemTAP <systemtap at sources dot redhat dot com>
- Date: Wed, 12 Oct 2005 11:09:11 +0100
- Subject: Re: Bug and question
- References: <1129110154.7277.49.camel@decugiss.frec.bull.fr>
- Reply-to: "Daniel P. Berrange" <berrange at redhat dot com>
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 -=|