This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: container_of in systemtap scripts
> The @cast extensions are clever. But if we want to support it directly
> and introduce new syntax I think it makes sense to just have new "magic
> @" syntax instead of reusing @cast.
> @container_of(ptr, "type", "member" [, "module" | "<header>"])
> That keeps @cast simple as it is now, and when reading (kernel) sources
> it makes transposing it into a stap script straightforward since the
> syntax is almost identical.
Yes agreed having a specialized function for this would be probably best,
preferable over syntactic vingear for @cast.
It's used often enough that it deserves an own function.
BTW some builtin helpers for list_heads would be also nice, these
are nearly everywhere these days too.
-Andi
--
ak@linux.intel.com -- Speaking for myself only.