This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: container_of in systemtap scripts
- From: fche at redhat dot com (Frank Ch. Eigler)
- To: Andi Kleen <andi at firstfloor dot org>
- Cc: systemtap at sources dot redhat dot com
- Date: Mon, 18 Jan 2010 10:04:08 -0500
- Subject: Re: container_of in systemtap scripts
- References: <20100118131557.GA4127@basil.fritz.box>
Andi Kleen <andi@firstfloor.org> writes:
> systemtap 1.1 works nicely.
Thanks for trying it.
> [...] @cast doesn't support that. Are there any other clean ways to
> write container_of() natively
Actually it this sort of thing should work, since we have "&" operators:
@cast($subfieldptr - (& @cast(0, "struct container")->subfield),
"struct container")
> or are there plans to extend cast to include an offset?
Sure, we can do something like that if needed.
- FChE