Kernel Omnislash (Unofficial) - Aprendendo a voar sem segredos!!!

Iniciado por Hqxriven, 24 de Dezembro de 2007, 13:26

tópico anterior - próximo tópico

Stivekx

Obrigaodo pela dica, vou recompilar de novo agora ;p

Desativar typos de arquivos com JFS que eu não uso pode ter alguma relação? É tudo ext4 aqui ;s

galactus

Citação de: Stivekx online 14 de Janeiro de 2011, 22:50
Obrigaodo pela dica, vou recompilar de novo agora ;p

Desativar typos de arquivos com JFS que eu não uso pode ter alguma relação? É tudo ext4 aqui ;s

Não!

Só se você esqueceu de colocar o ext4 dentro do kernel!

Talvez você tenha "tirado" demais do seu kernel!
BigLinux no Notebook  / Várias Distros Virtualizadas no PC.

4d4c47

#3182
aqui vai uma comparação de cflags, faça um teste e  um bom estudo delas:

codigo-fonte = teste.c


#include <stdio.h>

main ()
{
 printf("Hello world\n");
 return 0;
}

-------------------------------------------------------------------------------------------------------------------------------------

gcc -fverbose-asm -S teste.c -o a.s

cat a.s:




.file "teste.c"
# GNU C (Ubuntu 4.4.3-4ubuntu5) version 4.4.3 (x86_64-linux-gnu)
# compiled by GNU C version 4.4.3, GMP version 4.3.2, MPFR version 2.4.2-p1.
# GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
# options passed:  teste.c -D_FORTIFY_SOURCE=2 -mtune=generic
# -auxbase-strip a.s -fverbose-asm -fstack-protector
# options enabled:  -falign-loops -fargument-alias
# -fasynchronous-unwind-tables -fauto-inc-dec -fbranch-count-reg -fcommon
# -fdwarf2-cfi-asm -fearly-inlining -feliminate-unused-debug-types
# -ffunction-cse -fgcse-lm -fident -finline-functions-called-once
# -fira-share-save-slots -fira-share-spill-slots -fivopts
# -fkeep-static-consts -fleading-underscore -fmath-errno
# -fmerge-debug-strings -fmove-loop-invariants -fpeephole
# -freg-struct-return -fsched-interblock -fsched-spec
# -fsched-stalled-insns-dep -fsigned-zeros -fsplit-ivs-in-unroller
# -fstack-protector -ftrapping-math -ftree-cselim -ftree-loop-im
# -ftree-loop-ivcanon -ftree-loop-optimize -ftree-parallelize-loops=
# -ftree-reassoc -ftree-scev-cprop -ftree-switch-conversion
# -ftree-vect-loop-version -funit-at-a-time -funwind-tables
# -fvect-cost-model -fverbose-asm -fzero-initialized-in-bss
# -m128bit-long-double -m64 -m80387 -maccumulate-outgoing-args
# -malign-stringops -mfancy-math-387 -mfp-ret-in-387 -mfused-madd -mglibc
# -mieee-fp -mmmx -mno-sse4 -mpush-args -mred-zone -msse -msse2
# -mtls-direct-seg-refs

# Compiler executable checksum: 2129e1a56226bd6e8f7af5e0a3ff467d

.section .rodata
.LC0:
.string "Hello world"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushq %rbp #
.cfi_def_cfa_offset 16
movq %rsp, %rbp #,
.cfi_offset 6, -16
.cfi_def_cfa_register 6
movl $.LC0, %edi #,
call puts #
movl $0, %eax #, D.2045
leave
ret
.cfi_endproc
.LFE0:
.size main, .-main
.ident "GCC: (Ubuntu 4.4.3-4ubuntu5) 4.4.3"
.section .note.GNU-stack,"",@progbits


---------------------------------------------------------------------------------------------------------------------------------------------------------------------

gcc -O2 -march=k8 -fverbose-asm -S teste.c -o march_k8.s


cat march_k8.s:



.file "teste.c"
# GNU C (Ubuntu 4.4.3-4ubuntu5) version 4.4.3 (x86_64-linux-gnu)
# compiled by GNU C version 4.4.3, GMP version 4.3.2, MPFR version 2.4.2-p1.
# GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
# options passed:  teste.c -D_FORTIFY_SOURCE=2 -march=k8 -auxbase-strip
# march_k8.s -O2 -fverbose-asm -fstack-protector
# options enabled:  -falign-loops -fargument-alias
# -fasynchronous-unwind-tables -fauto-inc-dec -fbranch-count-reg
# -fcaller-saves -fcommon -fcprop-registers -fcrossjumping
# -fcse-follow-jumps -fdefer-pop -fdelete-null-pointer-checks
# -fdwarf2-cfi-asm -fearly-inlining -feliminate-unused-debug-types
# -fexpensive-optimizations -fforward-propagate -ffunction-cse -fgcse
# -fgcse-lm -fguess-branch-probability -fident -fif-conversion
# -fif-conversion2 -findirect-inlining -finline
# -finline-functions-called-once -finline-small-functions -fipa-cp
# -fipa-pure-const -fipa-reference -fira-share-save-slots
# -fira-share-spill-slots -fivopts -fkeep-static-consts
# -fleading-underscore -fmath-errno -fmerge-constants -fmerge-debug-strings
# -fmove-loop-invariants -fomit-frame-pointer -foptimize-register-move
# -foptimize-sibling-calls -fpeephole -fpeephole2 -freg-struct-return
# -fregmove -freorder-blocks -freorder-functions -frerun-cse-after-loop
# -fsched-interblock -fsched-spec -fsched-stalled-insns-dep
# -fschedule-insns2 -fsigned-zeros -fsplit-ivs-in-unroller
# -fsplit-wide-types -fstack-protector -fstrict-aliasing -fstrict-overflow
# -fthread-jumps -ftoplevel-reorder -ftrapping-math -ftree-builtin-call-dce
# -ftree-ccp -ftree-ch -ftree-copy-prop -ftree-copyrename -ftree-cselim
# -ftree-dce -ftree-dominator-opts -ftree-dse -ftree-fre -ftree-loop-im
# -ftree-loop-ivcanon -ftree-loop-optimize -ftree-parallelize-loops=
# -ftree-pre -ftree-reassoc -ftree-scev-cprop -ftree-sink -ftree-sra
# -ftree-switch-conversion -ftree-ter -ftree-vect-loop-version -ftree-vrp
# -funit-at-a-time -funwind-tables -fvect-cost-model -fverbose-asm
# -fzero-initialized-in-bss -m128bit-long-double -m3dnow -m64 -m80387
# -maccumulate-outgoing-args -malign-stringops -mfancy-math-387
# -mfp-ret-in-387 -mfused-madd -mglibc -mieee-fp -mmmx -mno-sse4
# -mpush-args -mred-zone -msse -msse2 -mtls-direct-seg-refs

# Compiler executable checksum: 2129e1a56226bd6e8f7af5e0a3ff467d

.section .rodata.str1.1,"aMS",@progbits,1
.LC0:
.string "Hello world\n"
.text
.p2align 4,,15
.globl main
.type main, @function
main:
.LFB22:
.cfi_startproc
subq $8, %rsp #,
.cfi_def_cfa_offset 16
movl $.LC0, %esi #,
movl $1, %edi #,
xorl %eax, %eax #
call __printf_chk #
xorl %eax, %eax #
addq $8, %rsp #,
ret
.cfi_endproc
.LFE22:
.size main, .-main
.ident "GCC: (Ubuntu 4.4.3-4ubuntu5) 4.4.3"
.section .note.GNU-stack,"",@progbits


----------------------------------------------------------------------------------------------------------------------------------------------------------------------

gcc -O2 -march=native -fverbose-asm -S teste.c -o march_native.s

cat march_native.s:


.file "teste.c"
# GNU C (Ubuntu 4.4.3-4ubuntu5) version 4.4.3 (x86_64-linux-gnu)
# compiled by GNU C version 4.4.3, GMP version 4.3.2, MPFR version 2.4.2-p1.
# GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
# options passed:  teste.c -D_FORTIFY_SOURCE=2 -march=amdfam10 -mcx16
# -msahf -mpopcnt --param l1-cache-size=64 --param l1-cache-line-size=64
# --param l2-cache-size=512 -mtune=amdfam10 -auxbase-strip march_native.s
# -O2 -fverbose-asm -fstack-protector
# options enabled:  -falign-loops -fargument-alias
# -fasynchronous-unwind-tables -fauto-inc-dec -fbranch-count-reg
# -fcaller-saves -fcommon -fcprop-registers -fcrossjumping
# -fcse-follow-jumps -fdefer-pop -fdelete-null-pointer-checks
# -fdwarf2-cfi-asm -fearly-inlining -feliminate-unused-debug-types
# -fexpensive-optimizations -fforward-propagate -ffunction-cse -fgcse
# -fgcse-lm -fguess-branch-probability -fident -fif-conversion
# -fif-conversion2 -findirect-inlining -finline
# -finline-functions-called-once -finline-small-functions -fipa-cp
# -fipa-pure-const -fipa-reference -fira-share-save-slots
# -fira-share-spill-slots -fivopts -fkeep-static-consts
# -fleading-underscore -fmath-errno -fmerge-constants -fmerge-debug-strings
# -fmove-loop-invariants -fomit-frame-pointer -foptimize-register-move
# -foptimize-sibling-calls -fpeephole -fpeephole2 -freg-struct-return
# -fregmove -freorder-blocks -freorder-functions -frerun-cse-after-loop
# -fsched-interblock -fsched-spec -fsched-stalled-insns-dep
# -fschedule-insns2 -fsigned-zeros -fsplit-ivs-in-unroller
# -fsplit-wide-types -fstack-protector -fstrict-aliasing -fstrict-overflow
# -fthread-jumps -ftoplevel-reorder -ftrapping-math -ftree-builtin-call-dce
# -ftree-ccp -ftree-ch -ftree-copy-prop -ftree-copyrename -ftree-cselim
# -ftree-dce -ftree-dominator-opts -ftree-dse -ftree-fre -ftree-loop-im
# -ftree-loop-ivcanon -ftree-loop-optimize -ftree-parallelize-loops=
# -ftree-pre -ftree-reassoc -ftree-scev-cprop -ftree-sink -ftree-sra
# -ftree-switch-conversion -ftree-ter -ftree-vect-loop-version -ftree-vrp
# -funit-at-a-time -funwind-tables -fvect-cost-model -fverbose-asm
# -fzero-initialized-in-bss -m128bit-long-double -m3dnow -m64 -m80387 -mabm
# -maccumulate-outgoing-args -malign-stringops -mcx16 -mfancy-math-387
# -mfp-ret-in-387 -mfused-madd -mglibc -mieee-fp -mmmx -mno-sse4 -mpopcnt
# -mpush-args -mred-zone -msahf -msse -msse2 -msse3 -msse4a
# -mtls-direct-seg-refs

# Compiler executable checksum: 2129e1a56226bd6e8f7af5e0a3ff467d

.section .rodata.str1.1,"aMS",@progbits,1
.LC0:
.string "Hello world\n"
.text
.p2align 5,,31
.globl main
.type main, @function
main:
.LFB22:
.cfi_startproc
subq $8, %rsp #,
.cfi_def_cfa_offset 16
movl $.LC0, %esi #,
movl $1, %edi #,
xorl %eax, %eax #
call __printf_chk #
xorl %eax, %eax #
addq $8, %rsp #,
ret
.cfi_endproc
.LFE22:
.size main, .-main
.ident "GCC: (Ubuntu 4.4.3-4ubuntu5) 4.4.3"
.section .note.GNU-stack,"",@progbits



dá pra ver as diferenças das instruções que vai na cflag, pelo que vi o march=native é o mais completo,

tenho aqui um AMD athlon II x2 M300

o gcc é a versão 4.4.3 do ubuntu 10.04 64 bits

vale a pena testar.



vampire_thunder

Cara, que maneiro isso aí. Mas dá até medo  :-X

Pra q serve o teste.c? Só para chamar o gcc?

Aqui apareceram umas informações interessantes:

.file "teste.c"
# GNU C (Debian 4.5.2-1) version 4.5.2 (x86_64-linux-gnu)
# compiled by GNU C version 4.5.2, GMP version 4.3.2, MPFR version 3.0.0-p3, MPC version 0.8.2
# warning: MPFR header version 3.0.0-p3 differs from library version 3.0.0-p7.
# warning: MPC header version 0.8.2 differs from library version 0.8.1.
# GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
# options passed:  teste.c -march=amdfam10 -mcx16 -msahf -mpopcnt -mabm
# --param l1-cache-size=64 --param l1-cache-line-size=64 --param


Parece que tem umas libs desatualizadas.

galactus

#3184
Saída do cat a.s:

galactus@galactus-desktop:~$ cat a.s
       .file   "teste.c"
# GNU C (Ubuntu/Linaro 4.5.1-7ubuntu2) version 4.5.1 (x86_64-linux-gnu)
#       compiled by GNU C version 4.5.1, GMP version 4.3.2, MPFR version 3.0.0-p3, MPC version 0.8.2
# GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
# options passed:  teste.c -D_FORTIFY_SOURCE=2 -mtune=generic -march=x86-64
# -auxbase-strip a.s -fverbose-asm -fstack-protector
# options enabled:  -falign-loops -fargument-alias
# -fasynchronous-unwind-tables -fauto-inc-dec -fbranch-count-reg -fcommon
# -fdelete-null-pointer-checks -fdwarf2-cfi-asm -fearly-inlining
# -feliminate-unused-debug-types -ffunction-cse -fgcse-lm -fident
# -finline-functions-called-once -fira-share-save-slots
# -fira-share-spill-slots -fivopts -fkeep-static-consts
# -fleading-underscore -fmath-errno -fmerge-debug-strings
# -fmove-loop-invariants -fpeephole -freg-struct-return
# -fsched-critical-path-heuristic -fsched-dep-count-heuristic
# -fsched-group-heuristic -fsched-interblock -fsched-last-insn-heuristic
# -fsched-rank-heuristic -fsched-spec -fsched-spec-insn-heuristic
# -fsched-stalled-insns-dep -fshow-column -fsigned-zeros
# -fsplit-ivs-in-unroller -fstack-protector -ftrapping-math -ftree-cselim
# -ftree-forwprop -ftree-loop-im -ftree-loop-ivcanon -ftree-loop-optimize
# -ftree-parallelize-loops= -ftree-phiprop -ftree-pta -ftree-reassoc
# -ftree-scev-cprop -ftree-slp-vectorize -ftree-vect-loop-version
# -funit-at-a-time -funwind-tables -fvect-cost-model -fverbose-asm
# -fzero-initialized-in-bss -m128bit-long-double -m64 -m80387
# -maccumulate-outgoing-args -malign-stringops -mfancy-math-387
# -mfp-ret-in-387 -mfused-madd -mglibc -mieee-fp -mmmx -mno-sse4
# -mpush-args -mred-zone -msse -msse2 -mtls-direct-seg-refs

# Compiler executable checksum: 55ab920cb876e6d7d91c14d105b791d9

       .section        .rodata
.LC0:
       .string "Hello world"                                                                                                                                                                                                                                                  
       .text                                                                                                                                                                                                                                                                  
.globl main                                                                                                                                                                                                                                                                    
       .type   main, @function                                                                                                                                                                                                                                                
main:                                                                                                                                                                                                                                                                          
.LFB0:                                                                                                                                                                                                                                                                        
       .cfi_startproc                                                                                                                                                                                                                                                        
       pushq   %rbp    #                                                                                                                                                                                                                                                      
       .cfi_def_cfa_offset 16                                                                                                                                                                                                                                                
       movq    %rsp, %rbp      #,                                                                                                                                                                                                                                            
       .cfi_offset 6, -16                                                                                                                                                                                                                                                    
       .cfi_def_cfa_register 6                                                                                                                                                                                                                                                
       movl    $.LC0, %edi     #,                                                                                                                                                                                                                                            
       call    puts    #                                                                                                                                                                                                                                                      
       movl    $0, %eax        #, D.3278                                                                                                                                                                                                                                      
       leave                                                                                                                                                                                                                                                                  
       .cfi_def_cfa 7, 8                                                                                                                                                                                                                                                      
       ret                                                                                                                                                                                                                                                                    
       .cfi_endproc                                                                                                                                                                                                                                                          
.LFE0:                                                                                                                                                                                                                                                                        
       .size   main, .-main                                                                                                                                                                                                                                                  
       .ident  "GCC: (Ubuntu/Linaro 4.5.1-7ubuntu2) 4.5.1"                                                                                                                                                                                                                    
       .section        .note.GNU-stack,"",@progbits
   

Saída do core2:


galactus@galactus-desktop:~$ cat march_core2.s
       .file   "teste.c"
# GNU C (Ubuntu/Linaro 4.5.1-7ubuntu2) version 4.5.1 (x86_64-linux-gnu)
#       compiled by GNU C version 4.5.1, GMP version 4.3.2, MPFR version 3.0.0-p3, MPC version 0.8.2
# GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
# options passed:  teste.c -D_FORTIFY_SOURCE=2 -march=core2 -auxbase-strip
# march_core2.s -O2 -fverbose-asm -fstack-protector
# options enabled:  -falign-loops -fargument-alias
# -fasynchronous-unwind-tables -fauto-inc-dec -fbranch-count-reg
# -fcaller-saves -fcommon -fcprop-registers -fcrossjumping
# -fcse-follow-jumps -fdefer-pop -fdelete-null-pointer-checks
# -fdwarf2-cfi-asm -fearly-inlining -feliminate-unused-debug-types
# -fexpensive-optimizations -fforward-propagate -ffunction-cse -fgcse
# -fgcse-lm -fguess-branch-probability -fident -fif-conversion
# -fif-conversion2 -findirect-inlining -finline
# -finline-functions-called-once -finline-small-functions -fipa-cp
# -fipa-pure-const -fipa-reference -fipa-sra -fira-share-save-slots
# -fira-share-spill-slots -fivopts -fkeep-static-consts
# -fleading-underscore -fmath-errno -fmerge-constants -fmerge-debug-strings
# -fmove-loop-invariants -fomit-frame-pointer -foptimize-register-move
# -foptimize-sibling-calls -fpeephole -fpeephole2 -freg-struct-return
# -fregmove -freorder-blocks -freorder-functions -frerun-cse-after-loop
# -fsched-critical-path-heuristic -fsched-dep-count-heuristic
# -fsched-group-heuristic -fsched-interblock -fsched-last-insn-heuristic
# -fsched-rank-heuristic -fsched-spec -fsched-spec-insn-heuristic
# -fsched-stalled-insns-dep -fschedule-insns2 -fshow-column -fsigned-zeros
# -fsplit-ivs-in-unroller -fsplit-wide-types -fstack-protector
# -fstrict-aliasing -fstrict-overflow -fthread-jumps -ftoplevel-reorder
# -ftrapping-math -ftree-builtin-call-dce -ftree-ccp -ftree-ch
# -ftree-copy-prop -ftree-copyrename -ftree-cselim -ftree-dce
# -ftree-dominator-opts -ftree-dse -ftree-forwprop -ftree-fre
# -ftree-loop-im -ftree-loop-ivcanon -ftree-loop-optimize
# -ftree-parallelize-loops= -ftree-phiprop -ftree-pre -ftree-pta
# -ftree-reassoc -ftree-scev-cprop -ftree-sink -ftree-slp-vectorize
# -ftree-sra -ftree-switch-conversion -ftree-ter -ftree-vect-loop-version
# -ftree-vrp -funit-at-a-time -funwind-tables -fvect-cost-model
# -fverbose-asm -fzero-initialized-in-bss -m128bit-long-double -m64 -m80387
# -maccumulate-outgoing-args -malign-stringops -mcx16 -mfancy-math-387
# -mfp-ret-in-387 -mfused-madd -mglibc -mieee-fp -mmmx -mno-sse4
# -mpush-args -mred-zone -msahf -msse -msse2 -msse3 -mssse3
# -mtls-direct-seg-refs

# Compiler executable checksum: 55ab920cb876e6d7d91c14d105b791d9

       .section        .rodata.str1.1,"aMS",@progbits,1
.LC0:
       .string "Hello world"
       .text
       .p2align 4,,15
.globl main
       .type   main, @function
main:
.LFB22:
       .cfi_startproc
       subq    $8, %rsp        #,
       .cfi_def_cfa_offset 16
       movl    $.LC0, %edi     #,
       call    puts    #
       xorl    %eax, %eax      #
       addq    $8, %rsp        #,
       .cfi_def_cfa_offset 8
       ret
       .cfi_endproc
.LFE22:
       .size   main, .-main
       .ident  "GCC: (Ubuntu/Linaro 4.5.1-7ubuntu2) 4.5.1"
       .section        .note.GNU-stack,"",@progbits


Saída do native:


galactus@galactus-desktop:~$ cat march_native.s
       .file   "teste.c"
# GNU C (Ubuntu/Linaro 4.5.1-7ubuntu2) version 4.5.1 (x86_64-linux-gnu)
#       compiled by GNU C version 4.5.1, GMP version 4.3.2, MPFR version 3.0.0-p3, MPC version 0.8.2
# GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
# options passed:  teste.c -D_FORTIFY_SOURCE=2 -march=core2 -mcx16 -msahf
# -mpopcnt -msse4.2 --param l1-cache-size=32 --param l1-cache-line-size=64
# --param l2-cache-size=8192 -mtune=core2 -auxbase-strip march_native.s -O2
# -fverbose-asm -fstack-protector
# options enabled:  -falign-loops -fargument-alias
# -fasynchronous-unwind-tables -fauto-inc-dec -fbranch-count-reg
# -fcaller-saves -fcommon -fcprop-registers -fcrossjumping
# -fcse-follow-jumps -fdefer-pop -fdelete-null-pointer-checks
# -fdwarf2-cfi-asm -fearly-inlining -feliminate-unused-debug-types
# -fexpensive-optimizations -fforward-propagate -ffunction-cse -fgcse
# -fgcse-lm -fguess-branch-probability -fident -fif-conversion
# -fif-conversion2 -findirect-inlining -finline
# -finline-functions-called-once -finline-small-functions -fipa-cp
# -fipa-pure-const -fipa-reference -fipa-sra -fira-share-save-slots
# -fira-share-spill-slots -fivopts -fkeep-static-consts
# -fleading-underscore -fmath-errno -fmerge-constants -fmerge-debug-strings
# -fmove-loop-invariants -fomit-frame-pointer -foptimize-register-move
# -foptimize-sibling-calls -fpeephole -fpeephole2 -freg-struct-return
# -fregmove -freorder-blocks -freorder-functions -frerun-cse-after-loop
# -fsched-critical-path-heuristic -fsched-dep-count-heuristic
# -fsched-group-heuristic -fsched-interblock -fsched-last-insn-heuristic
# -fsched-rank-heuristic -fsched-spec -fsched-spec-insn-heuristic
# -fsched-stalled-insns-dep -fschedule-insns2 -fshow-column -fsigned-zeros
# -fsplit-ivs-in-unroller -fsplit-wide-types -fstack-protector
# -fstrict-aliasing -fstrict-overflow -fthread-jumps -ftoplevel-reorder
# -ftrapping-math -ftree-builtin-call-dce -ftree-ccp -ftree-ch
# -ftree-copy-prop -ftree-copyrename -ftree-cselim -ftree-dce
# -ftree-dominator-opts -ftree-dse -ftree-forwprop -ftree-fre
# -ftree-loop-im -ftree-loop-ivcanon -ftree-loop-optimize
# -ftree-parallelize-loops= -ftree-phiprop -ftree-pre -ftree-pta
# -ftree-reassoc -ftree-scev-cprop -ftree-sink -ftree-slp-vectorize
# -ftree-sra -ftree-switch-conversion -ftree-ter -ftree-vect-loop-version
# -ftree-vrp -funit-at-a-time -funwind-tables -fvect-cost-model
# -fverbose-asm -fzero-initialized-in-bss -m128bit-long-double -m64 -m80387
# -maccumulate-outgoing-args -malign-stringops -mcx16 -mfancy-math-387
# -mfp-ret-in-387 -mfused-madd -mglibc -mieee-fp -mmmx -mpopcnt -mpush-args
# -mred-zone -msahf -msse -msse2 -msse3 -msse4 -msse4.1 -msse4.2 -mssse3
# -mtls-direct-seg-refs

# Compiler executable checksum: 55ab920cb876e6d7d91c14d105b791d9

       .section        .rodata.str1.1,"aMS",@progbits,1
.LC0:
       .string "Hello world"
       .text
       .p2align 4,,15
.globl main
       .type   main, @function
main:
.LFB22:
       .cfi_startproc
       subq    $8, %rsp        #,
       .cfi_def_cfa_offset 16
       movl    $.LC0, %edi     #,
       call    puts    #
       xorl    %eax, %eax      #
       addq    $8, %rsp        #,
       .cfi_def_cfa_offset 8
       ret
       .cfi_endproc
.LFE22:
       .size   main, .-main
       .ident  "GCC: (Ubuntu/Linaro 4.5.1-7ubuntu2) 4.5.1"
       .section        .note.GNU-stack,"",@progbits


E agora 4d4c47? Eu coloco o quê na linha do HOSTCFLAGS do MakeFile do Kernel?

A opção -march=native foi a mais completa, sem dúvida! Ela especifica os três níveis de Caches do meu processador e todas as instruções SSE suportadas por ele!  A opção Core2 não especifica os caches e não coloca todas as instruções do processador!  A genérica é muito pior!
BigLinux no Notebook  / Várias Distros Virtualizadas no PC.

4d4c47

#3185
Citação de: galactus online 15 de Janeiro de 2011, 01:38
Saída do cat a.s:

galactus@galactus-desktop:~$ cat a.s
       .file   "teste.c"
# GNU C (Ubuntu/Linaro 4.5.1-7ubuntu2) version 4.5.1 (x86_64-linux-gnu)
#       compiled by GNU C version 4.5.1, GMP version 4.3.2, MPFR version 3.0.0-p3, MPC version 0.8.2
# GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
# options passed:  teste.c -D_FORTIFY_SOURCE=2 -mtune=generic -march=x86-64
# -auxbase-strip a.s -fverbose-asm -fstack-protector
# options enabled:  -falign-loops -fargument-alias
# -fasynchronous-unwind-tables -fauto-inc-dec -fbranch-count-reg -fcommon
# -fdelete-null-pointer-checks -fdwarf2-cfi-asm -fearly-inlining
# -feliminate-unused-debug-types -ffunction-cse -fgcse-lm -fident
# -finline-functions-called-once -fira-share-save-slots
# -fira-share-spill-slots -fivopts -fkeep-static-consts
# -fleading-underscore -fmath-errno -fmerge-debug-strings
# -fmove-loop-invariants -fpeephole -freg-struct-return
# -fsched-critical-path-heuristic -fsched-dep-count-heuristic
# -fsched-group-heuristic -fsched-interblock -fsched-last-insn-heuristic
# -fsched-rank-heuristic -fsched-spec -fsched-spec-insn-heuristic
# -fsched-stalled-insns-dep -fshow-column -fsigned-zeros
# -fsplit-ivs-in-unroller -fstack-protector -ftrapping-math -ftree-cselim
# -ftree-forwprop -ftree-loop-im -ftree-loop-ivcanon -ftree-loop-optimize
# -ftree-parallelize-loops= -ftree-phiprop -ftree-pta -ftree-reassoc
# -ftree-scev-cprop -ftree-slp-vectorize -ftree-vect-loop-version
# -funit-at-a-time -funwind-tables -fvect-cost-model -fverbose-asm
# -fzero-initialized-in-bss -m128bit-long-double -m64 -m80387
# -maccumulate-outgoing-args -malign-stringops -mfancy-math-387
# -mfp-ret-in-387 -mfused-madd -mglibc -mieee-fp -mmmx -mno-sse4
# -mpush-args -mred-zone -msse -msse2 -mtls-direct-seg-refs

# Compiler executable checksum: 55ab920cb876e6d7d91c14d105b791d9

       .section        .rodata
.LC0:
       .string "Hello world"                                                                                                                                                                                                                                                  
       .text                                                                                                                                                                                                                                                                  
.globl main                                                                                                                                                                                                                                                                    
       .type   main, @function                                                                                                                                                                                                                                                
main:                                                                                                                                                                                                                                                                          
.LFB0:                                                                                                                                                                                                                                                                        
       .cfi_startproc                                                                                                                                                                                                                                                        
       pushq   %rbp    #                                                                                                                                                                                                                                                      
       .cfi_def_cfa_offset 16                                                                                                                                                                                                                                                
       movq    %rsp, %rbp      #,                                                                                                                                                                                                                                            
       .cfi_offset 6, -16                                                                                                                                                                                                                                                    
       .cfi_def_cfa_register 6                                                                                                                                                                                                                                                
       movl    $.LC0, %edi     #,                                                                                                                                                                                                                                            
       call    puts    #                                                                                                                                                                                                                                                      
       movl    $0, %eax        #, D.3278                                                                                                                                                                                                                                      
       leave                                                                                                                                                                                                                                                                  
       .cfi_def_cfa 7, 8                                                                                                                                                                                                                                                      
       ret                                                                                                                                                                                                                                                                    
       .cfi_endproc                                                                                                                                                                                                                                                          
.LFE0:                                                                                                                                                                                                                                                                        
       .size   main, .-main                                                                                                                                                                                                                                                  
       .ident  "GCC: (Ubuntu/Linaro 4.5.1-7ubuntu2) 4.5.1"                                                                                                                                                                                                                    
       .section        .note.GNU-stack,"",@progbits
   

Saída do core2:


galactus@galactus-desktop:~$ cat march_core2.s
       .file   "teste.c"
# GNU C (Ubuntu/Linaro 4.5.1-7ubuntu2) version 4.5.1 (x86_64-linux-gnu)
#       compiled by GNU C version 4.5.1, GMP version 4.3.2, MPFR version 3.0.0-p3, MPC version 0.8.2
# GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
# options passed:  teste.c -D_FORTIFY_SOURCE=2 -march=core2 -auxbase-strip
# march_core2.s -O2 -fverbose-asm -fstack-protector
# options enabled:  -falign-loops -fargument-alias
# -fasynchronous-unwind-tables -fauto-inc-dec -fbranch-count-reg
# -fcaller-saves -fcommon -fcprop-registers -fcrossjumping
# -fcse-follow-jumps -fdefer-pop -fdelete-null-pointer-checks
# -fdwarf2-cfi-asm -fearly-inlining -feliminate-unused-debug-types
# -fexpensive-optimizations -fforward-propagate -ffunction-cse -fgcse
# -fgcse-lm -fguess-branch-probability -fident -fif-conversion
# -fif-conversion2 -findirect-inlining -finline
# -finline-functions-called-once -finline-small-functions -fipa-cp
# -fipa-pure-const -fipa-reference -fipa-sra -fira-share-save-slots
# -fira-share-spill-slots -fivopts -fkeep-static-consts
# -fleading-underscore -fmath-errno -fmerge-constants -fmerge-debug-strings
# -fmove-loop-invariants -fomit-frame-pointer -foptimize-register-move
# -foptimize-sibling-calls -fpeephole -fpeephole2 -freg-struct-return
# -fregmove -freorder-blocks -freorder-functions -frerun-cse-after-loop
# -fsched-critical-path-heuristic -fsched-dep-count-heuristic
# -fsched-group-heuristic -fsched-interblock -fsched-last-insn-heuristic
# -fsched-rank-heuristic -fsched-spec -fsched-spec-insn-heuristic
# -fsched-stalled-insns-dep -fschedule-insns2 -fshow-column -fsigned-zeros
# -fsplit-ivs-in-unroller -fsplit-wide-types -fstack-protector
# -fstrict-aliasing -fstrict-overflow -fthread-jumps -ftoplevel-reorder
# -ftrapping-math -ftree-builtin-call-dce -ftree-ccp -ftree-ch
# -ftree-copy-prop -ftree-copyrename -ftree-cselim -ftree-dce
# -ftree-dominator-opts -ftree-dse -ftree-forwprop -ftree-fre
# -ftree-loop-im -ftree-loop-ivcanon -ftree-loop-optimize
# -ftree-parallelize-loops= -ftree-phiprop -ftree-pre -ftree-pta
# -ftree-reassoc -ftree-scev-cprop -ftree-sink -ftree-slp-vectorize
# -ftree-sra -ftree-switch-conversion -ftree-ter -ftree-vect-loop-version
# -ftree-vrp -funit-at-a-time -funwind-tables -fvect-cost-model
# -fverbose-asm -fzero-initialized-in-bss -m128bit-long-double -m64 -m80387
# -maccumulate-outgoing-args -malign-stringops -mcx16 -mfancy-math-387
# -mfp-ret-in-387 -mfused-madd -mglibc -mieee-fp -mmmx -mno-sse4
# -mpush-args -mred-zone -msahf -msse -msse2 -msse3 -mssse3
# -mtls-direct-seg-refs

# Compiler executable checksum: 55ab920cb876e6d7d91c14d105b791d9

       .section        .rodata.str1.1,"aMS",@progbits,1
.LC0:
       .string "Hello world"
       .text
       .p2align 4,,15
.globl main
       .type   main, @function
main:
.LFB22:
       .cfi_startproc
       subq    $8, %rsp        #,
       .cfi_def_cfa_offset 16
       movl    $.LC0, %edi     #,
       call    puts    #
       xorl    %eax, %eax      #
       addq    $8, %rsp        #,
       .cfi_def_cfa_offset 8
       ret
       .cfi_endproc
.LFE22:
       .size   main, .-main
       .ident  "GCC: (Ubuntu/Linaro 4.5.1-7ubuntu2) 4.5.1"
       .section        .note.GNU-stack,"",@progbits


Saída do native:


galactus@galactus-desktop:~$ cat march_native.s
       .file   "teste.c"
# GNU C (Ubuntu/Linaro 4.5.1-7ubuntu2) version 4.5.1 (x86_64-linux-gnu)
#       compiled by GNU C version 4.5.1, GMP version 4.3.2, MPFR version 3.0.0-p3, MPC version 0.8.2
# GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
# options passed:  teste.c -D_FORTIFY_SOURCE=2 -march=core2 -mcx16 -msahf
# -mpopcnt -msse4.2 --param l1-cache-size=32 --param l1-cache-line-size=64
# --param l2-cache-size=8192 -mtune=core2 -auxbase-strip march_native.s -O2
# -fverbose-asm -fstack-protector
# options enabled:  -falign-loops -fargument-alias
# -fasynchronous-unwind-tables -fauto-inc-dec -fbranch-count-reg
# -fcaller-saves -fcommon -fcprop-registers -fcrossjumping
# -fcse-follow-jumps -fdefer-pop -fdelete-null-pointer-checks
# -fdwarf2-cfi-asm -fearly-inlining -feliminate-unused-debug-types
# -fexpensive-optimizations -fforward-propagate -ffunction-cse -fgcse
# -fgcse-lm -fguess-branch-probability -fident -fif-conversion
# -fif-conversion2 -findirect-inlining -finline
# -finline-functions-called-once -finline-small-functions -fipa-cp
# -fipa-pure-const -fipa-reference -fipa-sra -fira-share-save-slots
# -fira-share-spill-slots -fivopts -fkeep-static-consts
# -fleading-underscore -fmath-errno -fmerge-constants -fmerge-debug-strings
# -fmove-loop-invariants -fomit-frame-pointer -foptimize-register-move
# -foptimize-sibling-calls -fpeephole -fpeephole2 -freg-struct-return
# -fregmove -freorder-blocks -freorder-functions -frerun-cse-after-loop
# -fsched-critical-path-heuristic -fsched-dep-count-heuristic
# -fsched-group-heuristic -fsched-interblock -fsched-last-insn-heuristic
# -fsched-rank-heuristic -fsched-spec -fsched-spec-insn-heuristic
# -fsched-stalled-insns-dep -fschedule-insns2 -fshow-column -fsigned-zeros
# -fsplit-ivs-in-unroller -fsplit-wide-types -fstack-protector
# -fstrict-aliasing -fstrict-overflow -fthread-jumps -ftoplevel-reorder
# -ftrapping-math -ftree-builtin-call-dce -ftree-ccp -ftree-ch
# -ftree-copy-prop -ftree-copyrename -ftree-cselim -ftree-dce
# -ftree-dominator-opts -ftree-dse -ftree-forwprop -ftree-fre
# -ftree-loop-im -ftree-loop-ivcanon -ftree-loop-optimize
# -ftree-parallelize-loops= -ftree-phiprop -ftree-pre -ftree-pta
# -ftree-reassoc -ftree-scev-cprop -ftree-sink -ftree-slp-vectorize
# -ftree-sra -ftree-switch-conversion -ftree-ter -ftree-vect-loop-version
# -ftree-vrp -funit-at-a-time -funwind-tables -fvect-cost-model
# -fverbose-asm -fzero-initialized-in-bss -m128bit-long-double -m64 -m80387
# -maccumulate-outgoing-args -malign-stringops -mcx16 -mfancy-math-387
# -mfp-ret-in-387 -mfused-madd -mglibc -mieee-fp -mmmx -mpopcnt -mpush-args
# -mred-zone -msahf -msse -msse2 -msse3 -msse4 -msse4.1 -msse4.2 -mssse3
# -mtls-direct-seg-refs

# Compiler executable checksum: 55ab920cb876e6d7d91c14d105b791d9

       .section        .rodata.str1.1,"aMS",@progbits,1
.LC0:
       .string "Hello world"
       .text
       .p2align 4,,15
.globl main
       .type   main, @function
main:
.LFB22:
       .cfi_startproc
       subq    $8, %rsp        #,
       .cfi_def_cfa_offset 16
       movl    $.LC0, %edi     #,
       call    puts    #
       xorl    %eax, %eax      #
       addq    $8, %rsp        #,
       .cfi_def_cfa_offset 8
       ret
       .cfi_endproc
.LFE22:
       .size   main, .-main
       .ident  "GCC: (Ubuntu/Linaro 4.5.1-7ubuntu2) 4.5.1"
       .section        .note.GNU-stack,"",@progbits


E agora 4d4c47? Eu coloco o quê na linha do HOSTCFLAGS do MakeFile do Kernel?

A opção -march=native foi a mais completa, sem dúvida! Ela especifica os três níveis de Caches do meu processador e todas as instruções SSE suportadas por ele!  A opção Core2 não especifica os caches e não coloca todas as instruções do processador!  A genérica é muito pior!


@galactus, na boa, vai de march=native mesmo, faça um teste mais completo aé e passa o resultado para nois, beleza ?

vou continuar testando aqui também, se houver mesmo muita diferença retorno mais informação.

valeu.


Citação de: vampire_thunder online 15 de Janeiro de 2011, 01:23
Cara, que maneiro isso aí. Mas dá até medo  :-X

Pra q serve o teste.c? Só para chamar o gcc?

Aqui apareceram umas informações interessantes:

.file "teste.c"
# GNU C (Debian 4.5.2-1) version 4.5.2 (x86_64-linux-gnu)
# compiled by GNU C version 4.5.2, GMP version 4.3.2, MPFR version 3.0.0-p3, MPC version 0.8.2
# warning: MPFR header version 3.0.0-p3 differs from library version 3.0.0-p7.
# warning: MPC header version 0.8.2 differs from library version 0.8.1.
# GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
# options passed:  teste.c -march=amdfam10 -mcx16 -msahf -mpopcnt -mabm
# --param l1-cache-size=64 --param l1-cache-line-size=64 --param


Parece que tem umas libs desatualizadas.

@vampire_thunder, teste.c é o codigo-fonte pare ser compilado pelo gcc

procure mais informação sobre linguagem C na net, é um pouco complicado, mas com força de vontade aprenderá facil facil

valeu.

galactus

Tá bom 4d4c47, vou tentar apenas com o march=native pra ver o que rola!
BigLinux no Notebook  / Várias Distros Virtualizadas no PC.

Hqxriven

Uma coisa eu não sabia vendo esse teste -msse4 -msse4.1 -msse4.2 -mssse3

Mesmo colocando core 2 ele não engloba os novos cores i3 a i7...

Então sempre que não usarmos native e nosso processador for mais novo que os listados no site usaremos instruções "incompletas"
Sem distro Linux fixa - Kernel Omnislash
Meu objetivo nesse fórum é ajudar. Sou um mero humano mas desejo sempre aprender e melhorar em tudo o que faço em minha vida. Então, por favor, quando eu postar me notifique depois

galactus

Citação de: Hqxriven online 15 de Janeiro de 2011, 02:17
Uma coisa eu não sabia vendo esse teste -msse4 -msse4.1 -msse4.2 -mssse3

Mesmo colocando core 2 ele não engloba os novos cores i3 a i7...

Então sempre que não usarmos native e nosso processador for mais novo que os listados no site usaremos instruções "incompletas"

Hqx, você não tinha um config com a opção de usar os CFLAGS no menuconfig?

O kernel do DiamondMax tinha, mas nenhum link dele está funcionando no momento! 

Algum outro lugar para pegar uma config que ativa o CFLAGS?
BigLinux no Notebook  / Várias Distros Virtualizadas no PC.

vampire_thunder

Citação de: 4d4c47 online 15 de Janeiro de 2011, 01:59

@vampire_thunder, teste.c é o codigo-fonte pare ser compilado pelo gcc

procure mais informação sobre linguagem C na net, é um pouco complicado, mas com força de vontade aprenderá facil facil

valeu.


Já desisti. Acho que esse tipo de coisa não dá para aprender sem um professor. Já faço minhas compilações desde que usava Windows, compilando o emulador Mame, lá para os meados da década passada, e realmente queria mesmo aprender C.

Por exemplo, eu nem sei onde vou colocar essa "native"

Lá vai meu teste completo:

a.s
.file "teste.c"
# GNU C (Debian 4.5.2-1) version 4.5.2 (x86_64-linux-gnu)
# compiled by GNU C version 4.5.2, GMP version 4.3.2, MPFR version 3.0.0-p3, MPC version 0.8.2
# warning: MPFR header version 3.0.0-p3 differs from library version 3.0.0-p7.
# warning: MPC header version 0.8.2 differs from library version 0.8.1.
# GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
# options passed:  teste.c -mtune=generic -march=x86-64 -auxbase-strip a.s
# -fverbose-asm
# options enabled:  -falign-loops -fargument-alias
# -fasynchronous-unwind-tables -fauto-inc-dec -fbranch-count-reg -fcommon
# -fdelete-null-pointer-checks -fdwarf2-cfi-asm -fearly-inlining
# -feliminate-unused-debug-types -ffunction-cse -fgcse-lm -fident
# -finline-functions-called-once -fira-share-save-slots
# -fira-share-spill-slots -fivopts -fkeep-static-consts
# -fleading-underscore -fmath-errno -fmerge-debug-strings
# -fmove-loop-invariants -fpeephole -freg-struct-return
# -fsched-critical-path-heuristic -fsched-dep-count-heuristic
# -fsched-group-heuristic -fsched-interblock -fsched-last-insn-heuristic
# -fsched-rank-heuristic -fsched-spec -fsched-spec-insn-heuristic
# -fsched-stalled-insns-dep -fshow-column -fsigned-zeros
# -fsplit-ivs-in-unroller -ftrapping-math -ftree-cselim -ftree-forwprop
# -ftree-loop-im -ftree-loop-ivcanon -ftree-loop-optimize
# -ftree-parallelize-loops= -ftree-phiprop -ftree-pta -ftree-reassoc
# -ftree-scev-cprop -ftree-slp-vectorize -ftree-vect-loop-version
# -funit-at-a-time -funwind-tables -fvect-cost-model -fverbose-asm
# -fzero-initialized-in-bss -m128bit-long-double -m64 -m80387
# -maccumulate-outgoing-args -malign-stringops -mfancy-math-387
# -mfp-ret-in-387 -mfused-madd -mglibc -mieee-fp -mmmx -mno-sse4
# -mpush-args -mred-zone -msse -msse2 -mtls-direct-seg-refs

# Compiler executable checksum: a968648126f8c105e89f7b7d56fd651a

.section .rodata
.LC0:
.string "Hello world"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
pushq %rbp #
.cfi_def_cfa_offset 16
movq %rsp, %rbp #,
.cfi_offset 6, -16
.cfi_def_cfa_register 6
movl $.LC0, %edi #,
call puts #
movl $0, %eax #, D.3275
leave
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.ident "GCC: (Debian 4.5.2-1) 4.5.2"
.section .note.GNU-stack,"",@progbits


k8:
.file "teste.c"
# GNU C (Debian 4.5.2-1) version 4.5.2 (x86_64-linux-gnu)
# compiled by GNU C version 4.5.2, GMP version 4.3.2, MPFR version 3.0.0-p3, MPC version 0.8.2
# warning: MPFR header version 3.0.0-p3 differs from library version 3.0.0-p7.
# warning: MPC header version 0.8.2 differs from library version 0.8.1.
# GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
# options passed:  teste.c -march=k8 -auxbase-strip march_k8.s -O2
# -fverbose-asm
# options enabled:  -falign-loops -fargument-alias
# -fasynchronous-unwind-tables -fauto-inc-dec -fbranch-count-reg
# -fcaller-saves -fcommon -fcprop-registers -fcrossjumping
# -fcse-follow-jumps -fdefer-pop -fdelete-null-pointer-checks
# -fdwarf2-cfi-asm -fearly-inlining -feliminate-unused-debug-types
# -fexpensive-optimizations -fforward-propagate -ffunction-cse -fgcse
# -fgcse-lm -fguess-branch-probability -fident -fif-conversion
# -fif-conversion2 -findirect-inlining -finline
# -finline-functions-called-once -finline-small-functions -fipa-cp
# -fipa-pure-const -fipa-reference -fipa-sra -fira-share-save-slots
# -fira-share-spill-slots -fivopts -fkeep-static-consts
# -fleading-underscore -fmath-errno -fmerge-constants -fmerge-debug-strings
# -fmove-loop-invariants -fomit-frame-pointer -foptimize-register-move
# -foptimize-sibling-calls -fpeephole -fpeephole2 -freg-struct-return
# -fregmove -freorder-blocks -freorder-functions -frerun-cse-after-loop
# -fsched-critical-path-heuristic -fsched-dep-count-heuristic
# -fsched-group-heuristic -fsched-interblock -fsched-last-insn-heuristic
# -fsched-rank-heuristic -fsched-spec -fsched-spec-insn-heuristic
# -fsched-stalled-insns-dep -fschedule-insns2 -fshow-column -fsigned-zeros
# -fsplit-ivs-in-unroller -fsplit-wide-types -fstrict-aliasing
# -fstrict-overflow -fthread-jumps -ftoplevel-reorder -ftrapping-math
# -ftree-builtin-call-dce -ftree-ccp -ftree-ch -ftree-copy-prop
# -ftree-copyrename -ftree-cselim -ftree-dce -ftree-dominator-opts
# -ftree-dse -ftree-forwprop -ftree-fre -ftree-loop-im -ftree-loop-ivcanon
# -ftree-loop-optimize -ftree-parallelize-loops= -ftree-phiprop -ftree-pre
# -ftree-pta -ftree-reassoc -ftree-scev-cprop -ftree-sink
# -ftree-slp-vectorize -ftree-sra -ftree-switch-conversion -ftree-ter
# -ftree-vect-loop-version -ftree-vrp -funit-at-a-time -funwind-tables
# -fvect-cost-model -fverbose-asm -fzero-initialized-in-bss
# -m128bit-long-double -m3dnow -m64 -m80387 -maccumulate-outgoing-args
# -malign-stringops -mfancy-math-387 -mfp-ret-in-387 -mfused-madd -mglibc
# -mieee-fp -mmmx -mno-sse4 -mpush-args -mred-zone -msse -msse2
# -mtls-direct-seg-refs

# Compiler executable checksum: a968648126f8c105e89f7b7d56fd651a

.section .rodata.str1.1,"aMS",@progbits,1
.LC0:
.string "Hello world"
.text
.p2align 4,,15
.globl main
.type main, @function
main:
.LFB11:
.cfi_startproc
subq $8, %rsp #,
.cfi_def_cfa_offset 16
movl $.LC0, %edi #,
call puts #
xorl %eax, %eax #
addq $8, %rsp #,
.cfi_def_cfa_offset 8
ret
.cfi_endproc
.LFE11:
.size main, .-main
.ident "GCC: (Debian 4.5.2-1) 4.5.2"
.section .note.GNU-stack,"",@progbits


core2:
.file "teste.c"
# GNU C (Debian 4.5.2-1) version 4.5.2 (x86_64-linux-gnu)
# compiled by GNU C version 4.5.2, GMP version 4.3.2, MPFR version 3.0.0-p3, MPC version 0.8.2
# warning: MPFR header version 3.0.0-p3 differs from library version 3.0.0-p7.
# warning: MPC header version 0.8.2 differs from library version 0.8.1.
# GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
# options passed:  teste.c -march=core2 -auxbase-strip march_core2.s -O2
# -fverbose-asm
# options enabled:  -falign-loops -fargument-alias
# -fasynchronous-unwind-tables -fauto-inc-dec -fbranch-count-reg
# -fcaller-saves -fcommon -fcprop-registers -fcrossjumping
# -fcse-follow-jumps -fdefer-pop -fdelete-null-pointer-checks
# -fdwarf2-cfi-asm -fearly-inlining -feliminate-unused-debug-types
# -fexpensive-optimizations -fforward-propagate -ffunction-cse -fgcse
# -fgcse-lm -fguess-branch-probability -fident -fif-conversion
# -fif-conversion2 -findirect-inlining -finline
# -finline-functions-called-once -finline-small-functions -fipa-cp
# -fipa-pure-const -fipa-reference -fipa-sra -fira-share-save-slots
# -fira-share-spill-slots -fivopts -fkeep-static-consts
# -fleading-underscore -fmath-errno -fmerge-constants -fmerge-debug-strings
# -fmove-loop-invariants -fomit-frame-pointer -foptimize-register-move
# -foptimize-sibling-calls -fpeephole -fpeephole2 -freg-struct-return
# -fregmove -freorder-blocks -freorder-functions -frerun-cse-after-loop
# -fsched-critical-path-heuristic -fsched-dep-count-heuristic
# -fsched-group-heuristic -fsched-interblock -fsched-last-insn-heuristic
# -fsched-rank-heuristic -fsched-spec -fsched-spec-insn-heuristic
# -fsched-stalled-insns-dep -fschedule-insns2 -fshow-column -fsigned-zeros
# -fsplit-ivs-in-unroller -fsplit-wide-types -fstrict-aliasing
# -fstrict-overflow -fthread-jumps -ftoplevel-reorder -ftrapping-math
# -ftree-builtin-call-dce -ftree-ccp -ftree-ch -ftree-copy-prop
# -ftree-copyrename -ftree-cselim -ftree-dce -ftree-dominator-opts
# -ftree-dse -ftree-forwprop -ftree-fre -ftree-loop-im -ftree-loop-ivcanon
# -ftree-loop-optimize -ftree-parallelize-loops= -ftree-phiprop -ftree-pre
# -ftree-pta -ftree-reassoc -ftree-scev-cprop -ftree-sink
# -ftree-slp-vectorize -ftree-sra -ftree-switch-conversion -ftree-ter
# -ftree-vect-loop-version -ftree-vrp -funit-at-a-time -funwind-tables
# -fvect-cost-model -fverbose-asm -fzero-initialized-in-bss
# -m128bit-long-double -m64 -m80387 -maccumulate-outgoing-args
# -malign-stringops -mcx16 -mfancy-math-387 -mfp-ret-in-387 -mfused-madd
# -mglibc -mieee-fp -mmmx -mno-sse4 -mpush-args -mred-zone -msahf -msse
# -msse2 -msse3 -mssse3 -mtls-direct-seg-refs

# Compiler executable checksum: a968648126f8c105e89f7b7d56fd651a

.section .rodata.str1.1,"aMS",@progbits,1
.LC0:
.string "Hello world"
.text
.p2align 4,,15
.globl main
.type main, @function
main:
.LFB11:
.cfi_startproc
subq $8, %rsp #,
.cfi_def_cfa_offset 16
movl $.LC0, %edi #,
call puts #
xorl %eax, %eax #
addq $8, %rsp #,
.cfi_def_cfa_offset 8
ret
.cfi_endproc
.LFE11:
.size main, .-main
.ident "GCC: (Debian 4.5.2-1) 4.5.2"
.section .note.GNU-stack,"",@progbits


Native:
.file "teste.c"
# GNU C (Debian 4.5.2-1) version 4.5.2 (x86_64-linux-gnu)
# compiled by GNU C version 4.5.2, GMP version 4.3.2, MPFR version 3.0.0-p3, MPC version 0.8.2
# warning: MPFR header version 3.0.0-p3 differs from library version 3.0.0-p7.
# warning: MPC header version 0.8.2 differs from library version 0.8.1.
# GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
# options passed:  teste.c -march=amdfam10 -mcx16 -msahf -mpopcnt -mabm
# --param l1-cache-size=64 --param l1-cache-line-size=64 --param
# l2-cache-size=512 -mtune=amdfam10 -auxbase-strip march_native.s -O2
# -fverbose-asm
# options enabled:  -falign-loops -fargument-alias
# -fasynchronous-unwind-tables -fauto-inc-dec -fbranch-count-reg
# -fcaller-saves -fcommon -fcprop-registers -fcrossjumping
# -fcse-follow-jumps -fdefer-pop -fdelete-null-pointer-checks
# -fdwarf2-cfi-asm -fearly-inlining -feliminate-unused-debug-types
# -fexpensive-optimizations -fforward-propagate -ffunction-cse -fgcse
# -fgcse-lm -fguess-branch-probability -fident -fif-conversion
# -fif-conversion2 -findirect-inlining -finline
# -finline-functions-called-once -finline-small-functions -fipa-cp
# -fipa-pure-const -fipa-reference -fipa-sra -fira-share-save-slots
# -fira-share-spill-slots -fivopts -fkeep-static-consts
# -fleading-underscore -fmath-errno -fmerge-constants -fmerge-debug-strings
# -fmove-loop-invariants -fomit-frame-pointer -foptimize-register-move
# -foptimize-sibling-calls -fpeephole -fpeephole2 -freg-struct-return
# -fregmove -freorder-blocks -freorder-functions -frerun-cse-after-loop
# -fsched-critical-path-heuristic -fsched-dep-count-heuristic
# -fsched-group-heuristic -fsched-interblock -fsched-last-insn-heuristic
# -fsched-rank-heuristic -fsched-spec -fsched-spec-insn-heuristic
# -fsched-stalled-insns-dep -fschedule-insns2 -fshow-column -fsigned-zeros
# -fsplit-ivs-in-unroller -fsplit-wide-types -fstrict-aliasing
# -fstrict-overflow -fthread-jumps -ftoplevel-reorder -ftrapping-math
# -ftree-builtin-call-dce -ftree-ccp -ftree-ch -ftree-copy-prop
# -ftree-copyrename -ftree-cselim -ftree-dce -ftree-dominator-opts
# -ftree-dse -ftree-forwprop -ftree-fre -ftree-loop-im -ftree-loop-ivcanon
# -ftree-loop-optimize -ftree-parallelize-loops= -ftree-phiprop -ftree-pre
# -ftree-pta -ftree-reassoc -ftree-scev-cprop -ftree-sink
# -ftree-slp-vectorize -ftree-sra -ftree-switch-conversion -ftree-ter
# -ftree-vect-loop-version -ftree-vrp -funit-at-a-time -funwind-tables
# -fvect-cost-model -fverbose-asm -fzero-initialized-in-bss
# -m128bit-long-double -m3dnow -m64 -m80387 -mabm
# -maccumulate-outgoing-args -malign-stringops -mcx16 -mfancy-math-387
# -mfp-ret-in-387 -mfused-madd -mglibc -mieee-fp -mmmx -mno-sse4 -mpopcnt
# -mpush-args -mred-zone -msahf -msse -msse2 -msse3 -msse4a
# -mtls-direct-seg-refs

# Compiler executable checksum: a968648126f8c105e89f7b7d56fd651a

.section .rodata.str1.1,"aMS",@progbits,1
.LC0:
.string "Hello world"
.text
.p2align 5,,31
.globl main
.type main, @function
main:
.LFB11:
.cfi_startproc
subq $8, %rsp #,
.cfi_def_cfa_offset 16
movl $.LC0, %edi #,
call puts #
xorl %eax, %eax #
addq $8, %rsp #,
.cfi_def_cfa_offset 8
ret
.cfi_endproc
.LFE11:
.size main, .-main
.ident "GCC: (Debian 4.5.2-1) 4.5.2"
.section .note.GNU-stack,"",@progbits


Meu processador é um AMD Phenom II N830, com 3 núcleos.

galactus

vampire_thunder, o Native vai dentro do MakeFile do Kernel!

Descompacta o source do kernel vanilla que você usa, abre o Makefile que está lá dentro, mais ou menos na página 4 tem isso aqui:

# SHELL used by kbuild
CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
     else if [ -x /bin/bash ]; then echo /bin/bash; \
     else echo sh; fi ; fi)

HOSTCC       = gcc
HOSTCXX      = g++
HOSTCFLAGS   = -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -march=native -fomit-frame-pointer
HOSTCXXFLAGS = "${CFLAGS}"


Ali na linha do HOSTCFLAGS você coloca o -march=native!

Infelizmente não é só aí que tem que mudar, mas já muda alguma coisa!
BigLinux no Notebook  / Várias Distros Virtualizadas no PC.

maiconramones

Pessoal percebi no meu kernel novo o driver da placa de rede sem fio não está funcionando tem que reinstalar alguma coisa ou tem que marcar alguma coisa nas opções de compilação?

Sobre o que falaram do trio 1000 + low latency +performance.. Eu confesso que não marquei essa possibilidade de performance... aonde que eu habilito isso?

Stivekx

Citação de: maiconramones online 15 de Janeiro de 2011, 13:12
Pessoal percebi no meu kernel novo o driver da placa de rede sem fio não está funcionando tem que reinstalar alguma coisa ou tem que marcar alguma coisa nas opções de compilação?

Sobre o que falaram do trio 1000 + low latency +performance.. Eu confesso que não marquei essa possibilidade de performance... aonde que eu habilito isso?

se voce usou o kernelcheck, é na hora que aparece uma janela cheia de coisas pra configurar..
Se não é quando tu digita make config

Stivekx

#3193
Achei esse tutorial explicando várias coisas especialmente da configuração do kernel, como otimizar pro seu processador, dicas de segurança...
Vou ler ele certinho na prox compilação.

http://www.faqs.org/docs/securing/secopt-kernel.html

Edit.:
Mais tutoriais legais sobre otimização nesse livro:
http://www.faqs.org/docs/securing/
To gostando das dicas (Y)

4d4c47

#3194
Citação de: galactus online 15 de Janeiro de 2011, 10:08
vampire_thunder, o Native vai dentro do MakeFile do Kernel!

Descompacta o source do kernel vanilla que você usa, abre o Makefile que está lá dentro, mais ou menos na página 4 tem isso aqui:

# SHELL used by kbuild
CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
    else if [ -x /bin/bash ]; then echo /bin/bash; \
    else echo sh; fi ; fi)

HOSTCC       = gcc
HOSTCXX      = g++
HOSTCFLAGS   = -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -march=native -fomit-frame-pointer
HOSTCXXFLAGS = "${CFLAGS}"


Ali na linha do HOSTCFLAGS você coloca o -march=native!

Infelizmente não é só aí que tem que mudar, mas já muda alguma coisa!

como diria o grande @galactus:

Senhoras e Senhores,

CONSEGUIR compilar o kernel todo com a cflag -march=native

aí vai um simples tutorial:

1 - baixa o kernel linux-2.6.36.tar.bz2

2 - descompacta em /usr/src

3 - baixa o patch do kernel zen, exatamente este http://downloads.zen-kernel.org/2.6.36/2.6.36-zen1.patch.lzma

4 - descompacta o patch zen na pasta /usr/src, depois aplique o patch zen no kernel linux-2.6.36

5 - pegue o .config do omnislash e copie para /usr/src/linux-2.6.36

6 - executa um make menuconfig e marque o seu processador exato ( não pentium4 ou outra coisa, marque a sua arquitetura exata)

7 - abaixo da escolha do processador, tem uma opção de -march=native ( isso é só de enfeite, não serve pra nada, mas marque ela mesmo assim)

8 - salve tudo e feche o menuconfig, agora vamos pra parte que interessa...

9 - edit o arquivo Makefile:

Citação de: galactus online 15 de Janeiro de 2011, 10:08
... mais ou menos na página 4 tem isso aqui:

# SHELL used by kbuild
CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
    else if [ -x /bin/bash ]; then echo /bin/bash; \
    else echo sh; fi ; fi)

HOSTCC       = gcc
HOSTCXX      = g++
HOSTCFLAGS   = -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -march=native -fomit-frame-pointer
HOSTCXXFLAGS = "${CFLAGS}"

Ali na linha do HOSTCFLAGS você coloca o -march=native!

10 - agora começa a ***** toda, execute: cd /usr/src/linux-2.6.36/arch/x86/

11 - dentro dessa pasta tem todos os codigo-fonte da parte principal do kernel, dentro dessa pasta existe varias outras pastas (e varias outras dentro delas), e o que voce vai fazer é adentrar uma por uma e procurar o arquivo Makefile dentro delas, e edita-lo: onde tiver -march=XXXX ou -mtune=XXXX ou -mcpu=XXXX, vc vai substituir por -march=native (obs: alguns Makefile não tem cflag nenhuma, então não mexa neles, só modifique os que tem -march=XXXX ou -mtune=XXXX ou -mcpu=XXXX), modifique tambem os arquivos: Kbuild, Kconfig, Kconfig.cpu, Kconfig.debug, Makefile_32.cpu( esse por exemplo está lotado de -march=XXXX e -mtune=XXXX, subistitua tudo sem medo de ser feliz)

12 - depois de tudo isso, comesse a compilação ( pra ver se tá compilando com march=native mesmo, abra um outro terminal e execute após 2 minutos de compilação: ps ax | grep gcc | grep march )


13 - pronto, taí o kernel exato pro seu processador

rapaz, o troço ficou bem mais rápido mesmo (nossa senhora, não sei se é só impressão minha só sei que a diferença é grande, :O   )

espero ter ajudado, agradeço ao grande galactus pela ideia, fico na espera do novo omnislash, valeu a todos.