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: container_of in systemtap scripts


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


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