Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Wed, 5 Dec 2001 09:03:31 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Wed, 5 Dec 2001 09:03:21 -0500 Received: from ns.suse.de ([213.95.15.193]:44812 "HELO Cantor.suse.de") by vger.kernel.org with SMTP id ; Wed, 5 Dec 2001 09:03:13 -0500 To: Rik van Riel Cc: linux-kernel@vger.kernel.org, lse-tech@lists.sourceforge.net, kiran@in.ibm.com Subject: Re: [RFC] [PATCH] Scalable Statistics Counters In-Reply-To: <20011205163153.E16315@in.ibm.com.suse.lists.linux.kernel> From: Andi Kleen Date: 05 Dec 2001 15:03:12 +0100 In-Reply-To: Rik van Riel's message of "5 Dec 2001 14:22:44 +0100" Message-ID: Lines: 19 X-Mailer: Gnus v5.7/Emacs 20.7 Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Rik van Riel 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/