deferencing variable with embedded C code
Wenji Huang
wenji.huang@oracle.com
Tue Sep 9 04:57:00 GMT 2008
Jun Koi wrote:
> Hi,
>
> I am still not an experience Systemtap user, so sorry for the naive question.
Welcome to Systemtap.
>
> I am looking at the documentation on embedded C code, and see that to
> dereference a field of structure (like skb->dev->name), we need to do
> something like below:
>
> struct net_device *dev;
> char *name;
> dev = kread(&(skb->dev));
> name = kread(&(dev->name));
>
> Why is that? Because embedded C is running in kernel context, and
> compiled with kernel code, it has access to all kernel structure, but
> why it cannot deference structure itself?
This is the safe way to avoid deference of incorrect pointer.
>
> It seems that do do the above, we need Dwarf information supplied to
> Systemtap, correct?
Embedded code doesn't read Dwarf information.
Regards,
Wenji
More information about the Systemtap
mailing list