2011-04-05 09:12:50 Oprofile issues
zied bouazizi (TUNISIA)
Message: 99599
Hello,
I want to compile oprofile with my uclinux distribution to run it on the blackfin board bf537-stamp. I followed uclinux oprofile compiling instructions from this page: docs.blackfin.uclinux.org/doku.php?id=linux-kernel:oprofile.
The problem is that the generated uImage file's size is 14 MB. Unfortunately I can't load the uImage file on my board with such size. The returned error is the following Error: inflate() returned -3.
Which directives shoud I follow. I'm wondering wether I should switch to work on another blackfin board or is there anyother solution to load the 14 MB uImage file on my bf537-stamp.
Thank you for help.
QuoteReplyEditDelete
2011-04-05 11:04:43 Re: Oprofile issues
Mike Frysinger (UNITED STATES)
Message: 99604
that doesnt sound right at all. when i build the default config with OPROFILE, my kernel is a lot smaller than 14MiB. you sure you only enabled oprofile ? maybe you also (incorrectly) enabled gcov ?
QuoteReplyEditDelete
2011-04-05 11:12:45 Re: Oprofile issues
zied bouazizi (TUNISIA)
Message: 99605
No I didn't enable gcov
QuoteReplyEditDelete
2011-04-05 23:04:41 Re: Oprofile issues
Aaron Wu (CHINA)
Message: 99613
Please disable the "Compile the kernel with debug info" in kernel hacking for kernel configuration, this will decrease your uImage size greatly. If not smaller enough please go on to remove some other drivers/libs/apps that you don't need.
QuoteReplyEditDelete
2011-04-06 08:01:30 Re: Oprofile issues
zied bouazizi (TUNISIA)
Message: 99624
Thank you Mr Aaron I got a uImage file sized 6.77 MB.
The problem now is that I couldn't load it on the kernel using the following instructions after copying the uImage file in the /tftpboot/ directory:
tftp 0x1000000 uImage
bootm 0x1000000
what is shown on the terminal program screen is the following:
## Booting kernel from Legacy Image at 01000000 ...
Image Name: bf537-2.6.34.7-ADI-2010R1
Created: 2011-04-06 11:48:07 UTC
Image Type: Blackfin Linux Kernel Image (gzip compressed)
Data Size: 7098161 Bytes = 6.8 MiB
Load Address: 00001000
Entry Point: 001a761c
Verifying Checksum ... OK
Uncompressing Kernel Image ... OK
Starting Kernel at = 001a761c
Linux version 2.6.34.7-ADI-2010R1 (root@PC-de-Zied) (gcc version 4.3.5 (ADI-2010R1-RC4) ) #3
Wed Apr 6 12:48:03 CET 2011
register early platform devices
bootconsole [early_shadow0] enabled
bootconsole [early_BFuart0] enabled
early printk enabled on early_BFuart0
Board Memory: 64MB
Kernel Managed Memory: 64MB
Memory map:
fixedcode = 0x00000400-0x00000490
text = 0x00001000-0x0011a7c8
rodata = 0x0011a7c8-0x001794cc
bss = 0x0017a000-0x0018a58c
data = 0x0018a58c-0x0019c000
stack = 0x0019a000-0x0019c000
init = 0x0019c000-0x00d7c000
available = 0x00d7c000-0x03f00000
DMA Zone = 0x03f00000-0x04000000
Hardware Trace Active and Enabled
Boot Mode: 0
Blackfin support (C) 2004-2010 Analog Devices, Inc.
Compiled for ADSP-BF537 Rev 0.3
Blackfin Linux support by blackfin.uclinux.org/
Processor Speed: 500 MHz core clock and 125 MHz System Clock
NOMPU: setting up cplb tables
Instruction Cache Enabled for CPU0
External memory: cacheable in instruction cache
Data Cache Enabled for CPU0
External memory: cacheable (write-back) in data cache
Built 1 zonelists in Zone order, mobility grouping off. Total pages: 16002
Kernel command line: root=/dev/mtdblock0 rw clkin_hz=25000000 earlyprintk=serial,uart0,57600
console=ttyBF0,57600 ip=192.168.10.55:192.168.10.63:192.168.0.1:255.255.255.0:bf537-stamp:eth
0:off
PID hash table entries: 256 (order: -2, 1024 bytes)
Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
Memory available: 50136k/65536k RAM, (12160k init code, 1125k kernel code, 519k data, 1024k d
ma, 572k reserved)
Hierarchical RCU implementation.
NR_IRQS:138
Configuring Blackfin Priority Driven Interrupts
console [ttyBF0] enabled, bootconsole disabled
console [ttyBF0] enabled, bootconsole disabled
Calibrating delay loop... 995.32 BogoMIPS (lpj=1990656)
Security Framework initialized
Mount-cache hash table entries: 512
Blackfin Scratchpad data SRAM: 4 KB
Blackfin L1 Data A SRAM: 16 KB (16 KB free)
Blackfin L1 Data B SRAM: 16 KB (16 KB free)
Blackfin L1 Instruction SRAM: 48 KB (35 KB free)
NET: Registered protocol family 16
Blackfin DMA Controller
stamp_init(): registering device resources
bio: create slab <bio-0> at 0
bfin-spi bfin-spi.0: Blackfin on-chip SPI Controller Driver, Version 1.0, regs_base@ffc00500,
dma channel@7
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 2048 (order: 2, 16384 bytes)
TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
TCP: Hash tables configured (established 2048 bind 2048)
TCP reno registered
UDP hash table entries: 256 (order: 0, 4096 bytes)
UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
NET: Registered protocol family 1
msgmni has been set to 97
io scheduler noop registered
io scheduler cfq registered (default)
bfin-uart: Blackfin serial driver
bfin-uart.0: ttyBF0 at MMIO 0xffc00400 (irq = 18) is a BFIN-UART
brd: module loaded
bfin_mii_bus: probed
bfin_mac: attached PHY driver [SMSC LAN83C185] (mii_bus:phy_addr=0:01, irq=-1, mdc_clk=250000
0Hz(mdc_div=24)@sclk=125MHz)
bfin_mac bfin_mac.0: Blackfin on-chip Ethernet MAC driver, Version 1.1
rtc-bfin rtc-bfin: rtc core: registered rtc-bfin as rtc0
bfin-wdt: initialized: timeout=20 sec (nowayout=0)
oprofile: using timer interrupt.
TCP cubic registered
NET: Registered protocol family 17
IP-Config: Gateway not on directly connected network. 08:54:55 UTC (2101280095)
dma_alloc_init: dma_page @ 0x02d64000 - 256 pages at 0x03f00000
Freeing unused kernel memory: 12160k freed
init: exec rc failed
init: Booting to single user mode
init: exec of single user shell failed
iled
init: -/bin/sh exec failed
PHY: 0:01 - Link is Up - 10/Half
init: -/bin/sh exec failed
Booting to single user mode
init: exec of single user shell failed
init: -/bin/sh exec failed
init: -/bin/sh exec failed
Booting to single user mode
init: exec of single user shell failed
init: -/bin/sh exec failed
init: -/bin/sh exec failed
Booting to single user mode
init: exec of single user shell failed
init: -/bin/sh exec failed
init: -/bin/sh exec failed
Booting to single user mode
init: exec of single user shell failed
init: -/bin/sh exec failed
init: -/bin/sh respawning too fast
init: /bin/watchdogd respawning too fast
init: -/bin/sh respawning too fast
init: /bin/watchdogd respawning too fast
init: -/bin/sh exec failed
in/sh exec failed
init: -/bin/sh respawning too fast
init: /bin/watchdogd respawning too fast
init: -/bin/sh respawning too fast
init: /bin/watchdogd respawning too fast
init: -/bin/sh exec failed
in/sh exec failed
init: -/bin/sh respawning too fast
init: /bin/watchdogd respawning too fast
init: -/bin/sh respawning too fast
what is init: -/bin/sh exec failed??
QuoteReplyEditDelete
2011-04-06 13:51:56 Re: Oprofile issues
Mike Frysinger (UNITED STATES)
Message: 99628
does it boot fine without oprofile enabled ?
did you build userspace as FLAT or FDPIC ? did you enable the right exec options in the kernel ?
QuoteReplyEditDelete
2011-04-07 04:24:34 Re: Oprofile issues
zied bouazizi (TUNISIA)
Message: 99646
yes Mike without oprofile enabled I got a uImage file sized of 3 MB at maximum and it boots fine.
I'm quite new with uclinux that's why I left the default kernel configuration. I'v just enabled profiling support , oprofile system profiling in kernel configuration and oprofile in miscellaneous applications. I disabled "compile kernel with debug information" as Aaron advised me. Then I set up the silicon revision (0.3), vendor and the board bf537-stamp
Then in kernel configuration under "Executable file format" the default options enabled are the following:
Kernel support for FDPIC ELF binaries
Kernel support for flat binaries
Enable ZFLAT support
Is that what you mean with building userspace as FLAT or FDPIC.
I really don't know what are exactly the right exec options in the kernel and how can I get them. Is there any link or document to fix these options.
Thank you for help
QuoteReplyEditDelete
2011-04-07 04:59:34 Re: Oprofile issues
Aaron Wu (CHINA)
Message: 99647
Suggest you to start on a clean 2010R1 version, or do a "make distclean" then reconfigure the distribution as needed before compiling again. As everything works well on my side for 2010R1 release with oprofile enabled on a bf537-stamp board. For executable formats please read this document: docs.blackfin.uclinux.org/doku.php?id=toolchain:executable_file_formats
QuoteReplyEditDelete
2011-04-07 06:28:32 Re: Oprofile issues
zied bouazizi (TUNISIA)
Message: 99650
Thank you Aaron. While trying to compile a clean ditribution, I got the same error message even without oprofile compiled with the kernel. It seems that I made wrong exec options for the kernel and I don't know what to enable and disable exactly since I don't know many options.
I'm now focusing on reading how to compile the kernel exactly and I hope to fix out the problem.
The good news is that while compiling oprofile I find in the /blackfin-distribution/romfs/usr/bin directory the files related to oprofile (opannotate, opcontrol, oprofiled, bfin_opcontrol, oparchive, opgprof, ophelp, opreport) and I it means that oprofile has been successfully compiled with linu kernel.
The remaining problem is the previous error shown while loading the uImage file on the board:
init: exec rc failed
init: Booting to single user mode
init: exec of single user shell failed
iled
init: -/bin/sh exec failed
PHY: 0:01 - Link is Up - 10/Half
init: -/bin/sh exec failed
Booting to single user mode
init: exec of single user shell failed
init: -/bin/sh exec failed
init: -/bin/sh exec failed
Booting to single user mode
init: exec of single user shell failed
init: -/bin/sh exec failed
init: -/bin/sh exec failed
Booting to single user mode
init: exec of single user shell failed
init: -/bin/sh exec failed
init: -/bin/sh exec failed
Booting to single user mode
init: exec of single user shell failed
init: -/bin/sh exec failed
init: -/bin/sh respawning too fast
init: /bin/watchdogd respawning too fast
init: -/bin/sh respawning too fast
init: /bin/watchdogd respawning too fast
init: -/bin/sh exec failed
in/sh exec failed
init: -/bin/sh respawning too fast
init: /bin/watchdogd respawning too fast
init: -/bin/sh respawning too fast
init: /bin/watchdogd respawning too fast
init: -/bin/sh exec failed
in/sh exec failed
And I think that Mike has reason to ask me about the exec options for linux kernel. Which basic options shoud I enable or disable?
I hope you can help me to get the right configuration
Thank you for help.
QuoteReplyEditDelete
2011-04-07 06:43:14 Re: Oprofile issues
Aaron Wu (CHINA)
Message: 99651
As already said, "make distclean" will reset all the configs to the default value, for both the kernel and other part of the distributions, or simply download a clean version. For the executable format, have you read the document I mentioned? Our wiki also support search function, please make use of it.
QuoteReplyEditDelete
2011-04-07 06:46:49 Re: Oprofile issues
zied bouazizi (TUNISIA)
Message: 99652
Yes Aaron I am working on it right now. I hope I will help me to get the desirable configuration.
QuoteReplyEditDelete
2011-04-07 11:25:57 Re: Oprofile issues
zied bouazizi (TUNISIA)
Message: 99656
I have always the same problem.
Here are the steps I followed: (after installing toolchain)
1. I installed the distribution blackfin-linux-dist-2010R1-RC5 at the /opt/ directory.
2. I used make menuconfig.
3. I setup the vendor configurations (Analog devices, Board: BF537stamp)
4. I enabled silicon revision (0.3)
5. I enabled : profiling support , oprofile system porfiling under the General setup of the kernel configuration.
6. I disabled "compile the kernel with debug information" under kernel hacking of the kernel configuration.
7. I enabled Kernel support for flat binaries, Enable ZFLAT support and Enable shared FLAT support under "Executable file formats" the FDPIC option is diabled.
8. In the user application space, I enabled oprofile under "miscellaneous applications"
9. I disabled "busybox" since many options makes many errors while compiling it.
10. I disabled inetutils and pngview under "blackfin apps"
11. I enabled Binary format (FLAT) and Install FLAT shared libraries under "blackfin build options".
12. I disabled also mtd-utils (it makes errors during compilation)
and that's all.
So, what could the wrong steps and/or what could be the missing steps to complete the whole configuration??
QuoteReplyEditDelete
2011-04-07 11:26:56 Re: Oprofile issues
zied bouazizi (TUNISIA)
Message: 99657
I have always the same problem.
Here are the steps I followed: (after installing toolchain)
1. I installed the distribution blackfin-linux-dist-2010R1-RC5 at the /opt/ directory.
2. I used make menuconfig.
3. I setup the vendor configurations (Analog devices, Board: BF537stamp)
4. I enabled silicon revision (0.3)
5. I enabled : profiling support , oprofile system porfiling under the General setup of the kernel configuration.
6. I disabled "compile the kernel with debug information" under kernel hacking of the kernel configuration.
7. I enabled Kernel support for flat binaries, Enable ZFLAT support and Enable shared FLAT support under "Executable file formats" the FDPIC option is diabled.
8. In the user application space, I enabled oprofile under "miscellaneous applications"
9. I disabled "busybox" since many options makes many errors while compiling it.
10. I disabled inetutils and pngview under "blackfin apps"
11. I enabled Binary format (FLAT) and Install FLAT shared libraries under "blackfin build options".
12. I disabled also mtd-utils (it makes errors during compilation)
and that's all.
However I got the same errors:
init: exec rc failed
init: Booting to single user mode
init: exec of single user shell failed
iled
init: -/bin/sh exec failed
PHY: 0:01 - Link is Up - 10/Half
init: -/bin/sh exec failed
Booting to single user mode
init: exec of single user shell failed
init: -/bin/sh exec failed
init: -/bin/sh exec failed
Booting to single user mode
init: exec of single user shell failed
init: -/bin/sh exec failed
init: -/bin/sh exec failed
Booting to single user mode
init: exec of single user shell failed
init: -/bin/sh exec failed
init: -/bin/sh exec failed
So, what could the wrong steps and/or what could be the missing steps to complete the whole configuration??
QuoteReplyEditDelete
2011-04-07 22:39:57 Re: Oprofile issues
Aaron Wu (CHINA)
Message: 99672
My advice is to start on a clean 2010R1 version, leaving all the default configuration unchanged, then make. First make sure the complilation for default release will pass then move forward. How to do this is well documented on our wiki: docs.blackfin.uclinux.org/doku.php. If can not pass the default compilation then you should have miss something. By the way you can not disable the busybox. And do not change the executable format unless have clear idea what you are doing. The default release should compile fine with the default configuration so long as you have the right tool chain, dist package and proper package installed on your host machine.
If still have problem building the default package please create a new help thread.
QuoteReplyEditDelete
2011-04-08 11:55:13 Re: Oprofile issues
zied bouazizi (TUNISIA)
Message: 99701
Thank you I could compile oprofile successfully and I could also load load the uImage file (9 MiB) on the board using a clean distribution.
I am trying now to start with oprofile on my board.
Thank you for help