Re: [RFC] [PATCH] Scalable Statistics Counters

Andi Kleen (ak@suse.de)
05 Dec 2001 15:03:12 +0100


Rik van Riel <riel@conectiva.com.br> writes:
>
> (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)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/