Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Using GCC PGO in portage
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
Letharion
Veteran
Veteran


Joined: 13 Jun 2005
Posts: 1316
Location: Sweden

PostPosted: Sun Mar 22, 2009 8:24 pm    Post subject: Using GCC PGO in portage Reply with quote

Is there any way to do PGO optimizations with portage?
On anything? On the kernel?
Has anyone looked at it at all? Gone outside of portage to do it?

I found this: https://forums.gentoo.org/viewtopic-t-692800.html but it doesn't help much
Back to top
View user's profile Send private message
V10lator
Apprentice
Apprentice


Joined: 11 Jul 2004
Posts: 199

PostPosted: Sun May 02, 2010 11:31 pm    Post subject: Reply with quote

It's a bit late but here is a little answer:

I don't think that pgo will ever be in portage couse (at much pakages?) it needs user interactivity.

I googled a bit for pgo-enabled kernels but it seems that there is nothing out there.
I will have a look now if I could do it for myself (but I'm not a dev!) and will share my results then.

P.S. Sorry for my bad english. :)

//EDIT: I compiled a gpo kernel!
I used this script I found (warning, it's for older kernels! Don't use it if you don't know what to do if a patch failed) for the extra flags: http://neo2.servizi-web.net/4410_custom-flags.patch

First I compiled the kernel with this flags:
-pg -fprofile-generate
I rebootet with the new kernel image, did a few things and rebootet back to the old kernel.
Then I compiled it with this flag:
-fprofile-use
The build process was very quick:
Code:
make -j3 && make modules_install
scripts/kconfig/conf -s arch/x86/Kconfig
  CHK     include/linux/version.h
  CHK     include/generated/utsrelease.h
  CALL    scripts/checksyscalls.sh
  CHK     include/generated/compile.h
  GZIP    kernel/config_data.gz
  IKCFG   kernel/config_data.h
  CC      kernel/configs.o
  LD      kernel/built-in.o
  LD      vmlinux.o
  MODPOST vmlinux.o
WARNING: modpost: Found 1 section mismatch(es).
To see full details build your kernel with:
'make CONFIG_DEBUG_SECTION_MISMATCH=y'
  GEN     .version
  CHK     include/generated/compile.h
  UPD     include/generated/compile.h
  CC      init/version.o
  LD      init/built-in.o
  LD      .tmp_vmlinux1
  KSYM    .tmp_kallsyms1.S
  AS      .tmp_kallsyms1.o
  LD      .tmp_vmlinux2
  KSYM    .tmp_kallsyms2.S
  AS      .tmp_kallsyms2.o
  LD      .tmp_vmlinux3
  KSYM    .tmp_kallsyms3.S
  AS      .tmp_kallsyms3.o
  LD      vmlinux
  SYSMAP  System.map
  SYSMAP  .tmp_System.map
  Building modules, stage 2.
  MODPOST 16 modules
  VOFFSET arch/x86/boot/voffset.h
  OBJCOPY arch/x86/boot/compressed/vmlinux.bin
  CC      arch/x86/boot/version.o
  LZMA    arch/x86/boot/compressed/vmlinux.bin.lzma
  MKPIGGY arch/x86/boot/compressed/piggy.S
  AS      arch/x86/boot/compressed/piggy.o
  LD      arch/x86/boot/compressed/vmlinux
  ZOFFSET arch/x86/boot/zoffset.h
  OBJCOPY arch/x86/boot/vmlinux.bin
  AS      arch/x86/boot/header.o
  LD      arch/x86/boot/setup.elf
  OBJCOPY arch/x86/boot/setup.bin
  BUILD   arch/x86/boot/bzImage
Root device is (8, 18)
Setup is 12060 bytes (padded to 12288 bytes).
System is 3580 kB
CRC 7db9b06e
Kernel: arch/x86/boot/bzImage is ready  (#2)
  INSTALL drivers/acpi/acpi_pad.ko
  INSTALL drivers/media/common/tuners/tda9887.ko
  INSTALL drivers/media/common/tuners/tuner-simple.ko
  INSTALL drivers/media/common/tuners/tuner-types.ko
  INSTALL drivers/media/video/gspca/gspca_main.ko
  INSTALL drivers/media/video/gspca/gspca_pac207.ko
  INSTALL drivers/media/video/uvc/uvcvideo.ko
  INSTALL drivers/misc/eeprom/at24.ko
  INSTALL drivers/misc/eeprom/eeprom.ko
  INSTALL drivers/misc/eeprom/eeprom_93cx6.ko
  INSTALL drivers/misc/eeprom/max6875.ko
  INSTALL drivers/scsi/scsi_wait_scan.ko
  INSTALL fs/fat/msdos.ko
  INSTALL lib/crc-ccitt.ko
  INSTALL net/bluetooth/hidp/hidp.ko
  INSTALL net/bluetooth/sco.ko
  DEPMOD  2.6.33-gentoo-gpo

but I gave the flags to LD and AS also and the resulting kernel image has a different size:
Code:

ls -l /boot/gentoo-2.6.33*
-rw-r--r-- 1 root root 3696576  2. Mai 22:30 /boot/gentoo-2.6.33
-rw-r--r-- 1 root root 3677120  3. Mai 02:25 /boot/gentoo-2.6.33-pre-gpo
-rw-r--r-- 1 root root 3677344  3. Mai 02:45 /boot/gentoo-2.6.33-gpo

I'm sorry but I don't know for sure that there were no other config changes between gentoo-2.6.33 and gentoo-2.6.33-pre-gpo.

Now I'm going to reboot into a (hopefully) gpo kernel :)
Back to top
View user's profile Send private message
savalas
n00b
n00b


Joined: 10 Dec 2009
Posts: 40

PostPosted: Tue May 04, 2010 5:16 pm    Post subject: Reply with quote

TAXI wrote:
The build process was very quick
It is my understanding that you need to run make clean before you recompile, otherwise it will not actually recompile anything. (it will skip the parts that have already been compiled, so basically everything)
Back to top
View user's profile Send private message
V10lator
Apprentice
Apprentice


Joined: 11 Jul 2004
Posts: 199

PostPosted: Thu May 06, 2010 6:13 pm    Post subject: Reply with quote

Thanks.
But a few tests showed that no gpo profile was created. It seems that the kernel isn't able to write these files out (maybe couse he tries to write them bevore any filesystems are mounted or he tried to do this at last step (so all filesystems are unmounted / read only).
As I sayed: I'm not a developer so i can only advise what's the issue here.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum