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]

Bug and question


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.


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