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

Popular posts from this blog

Spring Boot + JPA + Hibernate: Unable to locate persister -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -

c - double free or corruption (fasttop) -