Scalable Statistics Counters
Quoted 4 lines · Rik van Riel
(it'd be so cool if we could just start using a statistic variable through some macro and it'd be automatically declared and visible in /proc ;))
It is rather easy using ELF segments. You just do macros that put the names and a pointer to the variable and the type into an ELF segment starting with a known symbol. Then at kernel/module init you walk this segment and do the necessary registration.
[has also been done for sysctls]
Disadvantage is that one needs to change modutils for it to make it also
Also it needs new binutils; old binutils tend to mislink code with the many inter section relocations generated by this technique.
-Andi (who would also like such an easy statistics interface)