c - How to get the number of the instances of a struct existing in a running Linux kernel? -
suppose struct a
structure of linux kernel code, , there may many instances of struct a
being created , destroyed in running linux kernel, how can know number of instances of struct a
existing right now?
in general can't, unless can see structure instantiated in single way (if there constructor/factory function).
for structures used on stack, there typically no such function (although it's possible since structure instances can returned values).
c doesn't provide way automatically, you'd have build require finding places instances created.
Comments
Post a Comment