public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
From: Wenji Huang <wenji.huang@oracle.com>
To: Jun Koi <junkoi2004@gmail.com>
Cc: SystemTAP <systemtap@sources.redhat.com>
Subject: Re: deferencing variable with embedded C code
Date: Tue, 09 Sep 2008 04:57:00 -0000	[thread overview]
Message-ID: <48C60162.20208@oracle.com> (raw)
In-Reply-To: <fdaac4d50809082025o25b75605q2620407dd27d3841@mail.gmail.com>

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

  reply	other threads:[~2008-09-09  4:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-09  3:26 Jun Koi
2008-09-09  4:57 ` Wenji Huang [this message]
2008-09-10  0:54   ` Stone, Joshua I

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=48C60162.20208@oracle.com \
    --to=wenji.huang@oracle.com \
    --cc=junkoi2004@gmail.com \
    --cc=systemtap@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).