This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Bug and question


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 -=| 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]