[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.64.0708301212030.14590@pixie.tetracon-eng.net>
Date: Thu, 30 Aug 2007 12:29:38 -0400 (EDT)
From: "J. Scott Kasten" <jscottkasten@...oo.com>
To: Mohamed Bamakhrama <bamakhrama@...il.com>
cc: linux-mips@...ux-mips.org, linux-kernel@...r.kernel.org
Subject: Re: Average number of instructions per line of kernel code
On Thu, 30 Aug 2007, Mohamed Bamakhrama wrote:
>>> Hi all,
>>> I have a question regarding the average number of assembly
>>> instructions per line of kernel code. I know that this is a difficult
>>> question since it depends on many factors such as the instruction set
Here's a quick answer, not the best, but quick.
I took a user space flash memory driver I'm doing at work and compiled it
on my R5000 at home using gcc 4.1 and the MIPS3 abi, stopping with a .o
file. I also ran the source through cpp and a couple of grep passes to
strip out junk that wasn't really code. This driver may be somewhat
typical of what you would run into as it has quite a few inline functions
and such.
The driver.o was about 23000 bytes. Forgetting about the symboltables and
just dividing by 4 to estimate instructions and dividing by about 1650
net lines of code, I got about 3.5 instructions per line of C code.
I'm guessing that ball park, you're looking at 3-5 average - 10 seems high
except in sections with lots and lots of inlines.
Regards,
-S-
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists