From: "J. Scott Kasten" <jscottkasten@yahoo.com>
To: Mohamed Bamakhrama <bamakhrama@gmail.com>
Cc: linux-mips@linux-mips.org, linux-kernel@vger.kernel.org
Subject: Re: Average number of instructions per line of kernel code
Date: Thu, 30 Aug 2007 12:29:38 -0400 (EDT) [thread overview]
Message-ID: <Pine.LNX.4.64.0708301212030.14590@pixie.tetracon-eng.net> (raw)
In-Reply-To: <40378e40708300648i4f016906v60f821bf182a5633@mail.gmail.com>
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-
next prev parent reply other threads:[~2007-08-30 16:37 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-30 13:00 Mohamed Bamakhrama
2007-08-30 13:31 ` Jesper Juhl
2007-08-30 13:48 ` Mohamed Bamakhrama
2007-08-30 13:54 ` Jesper Juhl
2007-08-30 16:29 ` J. Scott Kasten [this message]
2007-08-30 19:49 ` Jan Engelhardt
2007-08-30 19:56 ` Freddy Spierenburg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.LNX.4.64.0708301212030.14590@pixie.tetracon-eng.net \
--to=jscottkasten@yahoo.com \
--cc=bamakhrama@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@linux-mips.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®