Re: Average instruction length in x86-built kernel?

2005-08-01 Thread David Weinehall
On Sat, Jul 30, 2005 at 03:57:25PM -0400, Karim Yaghmour wrote: [snip] > # Remove non-instruction lines: > sed /^[^c].*/d $2-dissassembled-kernel > $2-stage-1 > > # Remove empty lines: > sed /^'\t'*$/d $2-stage-1 > $2-stage-2 > > # Remove function names: > sed /^c[0-9,a-f]*' '\<.*\>:$/d

Re: Average instruction length in x86-built kernel?

2005-08-01 Thread Jan Engelhardt
>> Here's a script that does what I was looking for: > Mmmmh, perlgolf? >#!/bin/bash >for a in "$@" >do >objdump -d "$a" -j .text >done | perl -ne' >BEGIN{%h=();$b=0}; >END{if($b){$h{$b}++};print map("$_: $h{$_}\n", sort(keys(%h)))}; >if(/\tnop$/){$h{nop}++}

Re: Average instruction length in x86-built kernel?

2005-08-01 Thread Jan Engelhardt
Here's a script that does what I was looking for: snip Mmmmh, perlgolf? #!/bin/bash for a in $@ do objdump -d $a -j .text done | perl -ne' BEGIN{%h=();$b=0}; END{if($b){$h{$b}++};print map($_: $h{$_}\n, sort(keys(%h)))}; if(/\tnop$/){$h{nop}++} elsif(/^[\s0-9a-f]{8}:\t([^\t]+)

Re: Average instruction length in x86-built kernel?

2005-08-01 Thread David Weinehall
On Sat, Jul 30, 2005 at 03:57:25PM -0400, Karim Yaghmour wrote: [snip] # Remove non-instruction lines: sed /^[^c].*/d $2-dissassembled-kernel $2-stage-1 # Remove empty lines: sed /^'\t'*$/d $2-stage-1 $2-stage-2 # Remove function names: sed /^c[0-9,a-f]*' '\.*\:$/d $2-stage-2

Re: Average instruction length in x86-built kernel?

2005-07-30 Thread Karim Yaghmour
Hello Ingo, Ingo Oeser wrote: > Just study the output od objdump -d and average the differences > of the first hex number in a line printed, which are followed by a ":" Here's a script that does what I was looking for: #!/bin/bash # Dissassemble objdump -d $1 -j .text > $2-dissassembled-kernel

Re: Average instruction length in x86-built kernel?

2005-07-30 Thread Ingo Oeser
Hi Karim, On Friday 29 July 2005 23:32, Karim Yaghmour wrote: > Googling around, I can find references claiming that the average > instruction length on x86 is anywhere from 2.7 to 3.5 bytes, but I > can't find anything studying Linux specifically. This is not that hard to find out yourself:

Re: Average instruction length in x86-built kernel?

2005-07-30 Thread Ingo Oeser
Hi Karim, On Friday 29 July 2005 23:32, Karim Yaghmour wrote: Googling around, I can find references claiming that the average instruction length on x86 is anywhere from 2.7 to 3.5 bytes, but I can't find anything studying Linux specifically. This is not that hard to find out yourself: Just

Re: Average instruction length in x86-built kernel?

2005-07-30 Thread Karim Yaghmour
Hello Ingo, Ingo Oeser wrote: Just study the output od objdump -d and average the differences of the first hex number in a line printed, which are followed by a : Here's a script that does what I was looking for: #!/bin/bash # Dissassemble objdump -d $1 -j .text $2-dissassembled-kernel #

Average instruction length in x86-built kernel?

2005-07-29 Thread Karim Yaghmour
I'm wondering if anyone's ever done an analysis on the average length of instructions in an x86-built kernel. Googling around, I can find references claiming that the average instruction length on x86 is anywhere from 2.7 to 3.5 bytes, but I can't find anything studying Linux specifically. Just

Average instruction length in x86-built kernel?

2005-07-29 Thread Karim Yaghmour
I'm wondering if anyone's ever done an analysis on the average length of instructions in an x86-built kernel. Googling around, I can find references claiming that the average instruction length on x86 is anywhere from 2.7 to 3.5 bytes, but I can't find anything studying Linux specifically. Just