Skip to contentSkip to conversation

Scalable Statistics Counters

RFC PATCH Andi Kleen 1 participant 1 message Dec 5, 2001 1 message not in the archive

lore
Share & tools
lore

Andi Kleen

author
#1 lore raw
In reply to a message not in the archive
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)