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: deferencing variable with embedded C code


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


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