[#6630] Oprofile test fail during toolchain update

Document created by Aaronwu Employee on Oct 17, 2013
Version 1Show Document
  • View in full screen mode

[#6630] Oprofile test fail during toolchain update

Submitted By: Vivi Li

Open Date

2011-06-09 05:34:29     Close Date

2011-09-23 04:44:58

Priority:

Medium High     Assignee:

Vivi Li

Stuart Henderson

Board:

N/A     Silicon Revision:

Resolution:

Fixed     Fixed In Release:

N/A

Processor:

ALL     

Host Operating System:

toolchain rev.:

    kernel rev.:

State:

Closed     Found In Release:

2011R1

Is this bug repeatable?:

N/A     

Summary: Oprofile test fail during toolchain update

Details:

 

Oprofile test fail during toolchain update.

This happened between toolchain svn revision 5057 and 5118.

 

First failed version:

--

kernel:    Linux release 2.6.36.2-ADI-2011R1-pre-svn9536, build #4 Wed Dec 29 15:15:51 GMT 2010

toolchain: bfin-linux-uclibc-gcc release gcc version 4.3.5 (ADI-trunk/svn-5074)

user-dist: release svn-10023, build #62 Wed Dec 29 15:15:07 GMT 2010

--

 

Last passed version:

--

kernel:    Linux release 2.6.36.2-ADI-2011R1-pre-svn9530, build #36 Sun Dec 26 17:46:42 GMT 2010

toolchain: bfin-uclinux-gcc release gcc version 4.3.5 (ADI-trunk/svn-5013)

user-dist: release svn-10009, build #711 Sun Dec 26 17:39:58 GMT 2010

--

 

 

Bellow is the log:

--

Linux version 2.6.39.1-ADI-2011R1-pre-svn9923 (test@uclinux59-kernel-perf) (gcc version 4.3.5 (ADI-trunk/svn-5074) ) #70 Thu Jun1

register early platform devices

bootconsole [early_shadow0] enabled

bootconsole [early_BFuart0] enabled

early printk enabled on early_BFuart0

Limiting kernel memory to 56MB due to anomaly 05000263

Board Memory: 64MB

Kernel Managed Memory: 64MB

Memory map:

  fixedcode = 0x00000400-0x00000490

  text      = 0x00001000-0x001182a8

  rodata    = 0x001182a8-0x0016f6b4

  bss       = 0x00170000-0x00180964

  data      = 0x00180964-0x00192000

    stack   = 0x00190000-0x00192000

  init      = 0x00192000-0x00b09000

  available = 0x00b09000-0x03800000

  DMA Zone  = 0x03f00000-0x04000000

Hardware Trace active and enabled

Boot Mode: 0

Reset caused by Software reset

Blackfin support (C) 2004-2010 Analog Devices, Inc.

Compiled for ADSP-BF537 Rev 0.2

Blackfin Linux support by http://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: 14224

Kernel command line: root=/dev/mtdblock0 rw clkin_hz=25000000 earlyprintk=serial,uart0,57600 console=ttyBF0,57600 ip=10.100.4.50f

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: 45436k/65536k RAM, (9692k init code, 1116k kernel code, 488k data, 1024k dma, 7780k reserved)

NR_IRQS:146

Configuring Blackfin Priority Driven Interrupts

console [ttyBF0] enabled, bootconsole disabled

console [ttyBF0] enabled, bootconsole disabled

Calibrating delay loop... 995.32 BogoMIPS (lpj=1990656)

pid_max: default: 32768 minimum: 301

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 (36 KB free)

NET: Registered protocol family 16

Blackfin DMA Controller

stamp_init(): registering device resources

bio: create slab <bio-0> at 0

Switching to clocksource bfin_cs_cycles

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

debug-mmrs: setting up Blackfin MMR debugfs

msgmni has been set to 88

io scheduler noop 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=2500000Hz(mdc_div=24)@sclk=125MHz)

bfin_mac bfin_mac.0: eth0: 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

rtc-bfin rtc-bfin: setting system clock to 2025-10-16 13:07:59 UTC (1760620079)

IP-Config: Complete:

     device=eth0, addr=10.100.4.50, mask=255.255.255.0, gw=10.100.4.174,

     host=bf537-stamp, domain=, nis-domain=(none),

     bootserver=10.100.4.174, rootserver=10.100.4.174, rootpath=

dma_alloc_init: dma_page @ 0x029cd000 - 256 pages at 0x03f00000

Freeing unused kernel memory: 9692k freed

                           _____________________________________

        a8888b.           / Welcome to the uClinux distribution \

       d888888b.         /       _     _                         \

       8P"YP"Y88        /       | |   |_|            __  __ (TM)  |

       8|o||o|88  _____/        | |    _ ____  _   _ \ \/ /       |

       8'    .88       \        | |   | |  _ \| | | | \  /        |

       8`._.' Y8.       \       | |__ | | | | | |_| | /  \        |

      d/      `8b.       \      \____||_|_| |_|\____|/_/\_\       |

     dP   .    Y8b.       \   For embedded processors including   |

    d8:'  "  `::88b        \    the Analog Devices Blackfin      /

   d8"         'Y88b        \___________________________________/

  :8P    '      :888

   8a.   :     _a88P         For further information, check out:

._/"Yaa_:   .| 88P|            - http://blackfin.uclinux.org/

\    YP"    `| 8P  `.          - http://docs.blackfin.uclinux.org/

/     \.___.d|    .'           - http://www.uclinux.org/

`--..__)8888P`._.'  jgs/a:f    - http://www.analog.com/blackfin

 

Have a lot of fun...

 

 

BusyBox v1.18.4 (2011-06-09 07:43:54 GMT) hush - the humble shell

 

root:/> PHY: 0:01 - Link is Up - 100/Full

 

root:/> /usr/bin/bfin_opcontrol --init

mkdir: can't create directory '/var/lib/': File exists

root:/> /usr/bin/bfin_opcontrol --start-daemon

root:/> Using 2.6+ OProfile kernel interface.

Reading module info.

Using log file /var/lib/oprofile/oprofiled.log

 

root:/>

root:/>

root:/> ps ax

  PID USER       VSZ STAT COMMAND

    1 root       104 S    /init

    2 root         0 SW   [kthreadd]

    3 root         0 SW   [ksoftirqd/0]

    4 root         0 SW   [kworker/0:0]

    5 root         0 SW   [kworker/u:0]

    6 root         0 SW   [rcu_kthread]

    7 root         0 SW<  [khelper]

    8 root         0 SW   [kworker/u:1]

   39 root         0 SW   [sync_supers]

   41 root         0 SW   [bdi-default]

   43 root         0 SW<  [kblockd]

   63 root         0 SW   [khungtaskd]

   64 root         0 SW   [kswapd0]

   65 root         0 SW   [fsnotify_mark]

  125 root         0 SW   [kworker/0:1]

  146 root       435 S    -/bin/sh

  147 root        44 S    /sbin/inetd

  148 root       428 S    /sbin/syslogd -n

  149 root       424 S    /sbin/klogd -n

  150 root        32 S    /bin/watchdogd -f -s

  159 root       672 S    ./oprofiled --events=TOTAL_BRANCH:0x9:0:100000:1:1:1

  160 root       428 R    ps ax

root:/> /usr/bin/bfin_opcontrol --start

root:/> /usr/bin/bfin_opcontrol --dump

root:/> /usr/bin/opreport -l

CPU: CPU with timer interrupt, speed 500 MHz (estimated)

Profiling through timer interrupt

 

/usr/bin/opreport error: profile_t::samples_range(): start > end something wrong with kernel or module layout ?

please report problem to oprofile-list@lists.sourceforge.net

root:/>

root:/> /usr/bin/bfin_opcontrol --dump

root:/> /usr/bin/opreport -l

CPU: CPU with timer interrupt, speed 500 MHz (estimated)

Profiling through timer interrupt

warning: /bin/busybox is not in a usable binary format.

warning: /usr/bin/opreport is not in a usable binary format.

warning: /usr/bin/oprofiled is not in a usable binary format.

/usr/bin/opreport error: profile_t::samples_range(): start > end something wrong with kernel or module layout ?

please report problem to oprofile-list@lists.sourceforge.net

root:/>

--

 

Follow-ups

 

--- Sonic Zhang                                              2011-06-10 06:35:08

The only change between 5057 and 5118 in gcc 4.3 is:

 

r5074 | vapier | 2010-12-22 02:50:01 +0800 (Wed, 22 Dec 2010) | 1 line

 

gcc: bfin-elf: link in new -lbfinbsp

 

Index: gcc/config/bfin/elf.h

===================================================================

--- gcc/config/bfin/elf.h    (revision 5013)

+++ gcc/config/bfin/elf.h    (revision 5074)

@@ -10,7 +10,7 @@

#define ENDFILE_SPEC    "crtend%O%s crtn%O%s"

 

#undef  LIB_SPEC

-#define LIB_SPEC "--start-group -lc %{msim:-lsim}%{!msim:-lnosys}

--end-group \

+#define LIB_SPEC "--start-group -lc %{msim:-lsim}%{!msim:-lbfinbsp

-lnosys} --end-group \

%{!T*:%{!msim:%{!msdram: \

           %{mcpu=bf504*:-T bf504.ld%s}%{mcpu=bf506*:-T bf506.ld%s} \

           %{mcpu=bf512*:-T bf512.ld%s}%{mcpu=bf514*:-T bf514.ld%s} \

 

--- Mike Frysinger                                           2011-06-10 11:54:18

and that only affects the bfin-elf toolchain

 

--- Stuart Henderson                                         2011-06-22 07:15:37

is it possible this is a kernel bug then?

 

if it is still to be investigated, then could you provide me with some more

info on oprofile and how you are building it?

 

--- Vivi Li                                                  2011-09-02 06:21:39

Set configs in kernel configuration as bellow and enable

"CONFIG_USER_OPROFILE" in config/.config. Then make.

 

--

CONFIG_PROFILING=y

CONFIG_OPROFILE=y

# CONFIG_DEBUG_INFO is not set

--

 

--- Sonic Zhang                                              2011-09-02 06:28:45

According to he kernel commit log, patches between  9531 and 9536 have nothing

to do with kernel generic code or architecture code.

 

The latest 3.0 kernel has no this oprofile bug if built by older toolchain, but

this bug occurs after switch to new toolchain.

 

 

r9536 | cliff | 2010-12-23 16:28:08 +0800 (Thu, 23 Dec 2010) | 1 line

 

bug[#]sound:default 0db gain for record is not audible

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

r9535 | lliubbo | 2010-12-22 16:26:14 +0800 (Wed, 22 Dec 2010) | 3 lines

 

drivers:musb: remove pointless casts/masks in musbhsdma.h

 

 

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

r9534 | aaronwu1 | 2010-12-22 14:21:03 +0800 (Wed, 22 Dec 2010) | 1 line

 

bfin_can: add CAN1 support for bf54x

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

r9533 | lliubbo | 2010-12-21 14:38:37 +0800 (Tue, 21 Dec 2010) | 6 lines

 

[#6411] drivers:musb: revert musbhsdma.h

 

Our Blackfin platform doesn't support musb_writel/musb_readl hsdma registers,

use long read/write will make dma can't work, so revert it.

 

 

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

r9532 | aaronwu1 | 2010-12-21 14:16:22 +0800 (Tue, 21 Dec 2010) | 1 line

 

[#6414] bfin_sport: To support TDM mode

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

r9531 | aaronwu1 | 2010-12-21 10:49:41 +0800 (Tue, 21 Dec 2010) | 1 line

 

[#6299]: delete the kernel space driver for twi lcd since it's moved to

userspace

 

--- Stuart Henderson                                         2011-09-05 10:52:57

So what's the status with this bug?  are we thinking this is a toolchain bug

after all?

 

could you try using the latest trunk, but with the two different versions of

binutils?

e.g.

./BuildToolChain -B 2.17

and then

./BuildToolChain -B 2.21

 

if you see a difference in behaviour, then this could prove it's a toolchain

issue.

 

--- Vivi Li                                                  2011-09-06 22:17:22

Build toolchain with binutils-2.17, oprofile test will fail;

Build toolchain with binutils-2.21, oprofile test will pass.

 

--- Stuart Henderson                                         2011-09-07 05:51:59

the toolchain should be using 2.21 by default.  are you forcing it back to 2.17

for testing?

 

--- Vivi Li                                                  2011-09-07 22:51:03

Yes, I forced to build 2.17 by -B option.

 

--- Stuart Henderson                                         2011-09-08 04:52:38

well if the default configurations work (e.g. gcc4.5-binutils2.21 &

gcc4.3-binutils2.21), then i'd like to downgrade the severity of this bug as the

binaries we will be releasing won't include a binutils2.17 linker/assembler

etc.

 

or is there a specific reason that you require to be able to use binutils2.17?

 

--- Vivi Li                                                  2011-09-12 22:34:50

Sorry Stuart, I just notice that I mistyped on my reply at 2011-09-07 03:17:22.

The fact is, oprofile test fails with latest binutils-2.21 and passes with old

2.17.

So this bug still needs to be investigated.

 

--- Stuart Henderson                                         2011-09-16 06:44:53

in that case can you provide me with full instructions on how to reproduce.

 

thanks.

 

--- Vivi Li                                                  2011-09-19 01:27:28

Bellow is the command in our test script to build toolchain. Now we are using

trunk toolchain with default binutils-2.21. If I add "-B 2.17" to

build toolchain, later oprofile test will fail.

--

./BuildToolChain -j 1 -w -s /home/test/work/cruise/checkouts/toolchain -b

/home/test/uClinux -k /home/test/work/cruise/checkouts/uclinux-dist/linux-2.6.x/

-u /home/test/work/cruise/checkouts/u-boot -c 4.3 >

/home/test/uClinux/toolchain_test_log 2>&1 &

--

 

To build kernel, set configs in kernel configuration as bellow and enable

"CONFIG_USER_OPROFILE" in uclinux-dist/config/.config. Then make.

--

CONFIG_PROFILING=y

CONFIG_OPROFILE=y

# CONFIG_DEBUG_INFO is not set

--

 

Then please follow the steps that I paste in main body of tracker to test

oprofile.

 

you can also refer to document:

http://docs.blackfin.uclinux.org/doku.php?id=linux-kernel:oprofile

 

--- Stuart Henderson                                         2011-09-20 09:11:39

enabling these options results in a rather huge image file (19mb), resulting

in:

 

Bytes transferred = 19756215 (12d74b7 hex)

## Booting kernel from Legacy Image at 01000000 ...

   Image Name:   bf537-2.6.34.7-ADI-2010R1-g44285

   Created:      2011-09-20  13:07:25 UTC

   Image Type:   Blackfin Linux Kernel Image (gzip compressed)

   Data Size:    19756151 Bytes = 18.8 MiB

   Load Address: 00001000

   Entry Point:  001a344c

   Verifying Checksum ... OK

   Uncompressing Kernel Image ... Error: inflate() returned -2

GUNZIP: uncompress, out-of-mem or overwrite error - must RESET board to

recover

 

 

are you disabling other options to keep the file size down?  if so, what

modules/settings?

 

--- Vivi Li                                                  2011-09-20 23:35:22

Yes, I disabled all unrelated applications to make it smaller.

 

Please use attached config.kernel.oprofile.flat to replace

uclinux-dist/linux-2.6.x/.config, config.user.oprofile.flat to replace

uclinux-dist/config/.config.

 

Then you'll get uclinux-dist well configured for oprofile test on bf537-stamp.

It should work with a smaller size.

 

--- Stuart Henderson                                         2011-09-21 07:19:27

Hi Vivi, i can only see one file attached and it doesn't appear to match the

names you describe.

 

--- Vivi Li                                                  2011-09-21 23:06:47

It seems files are failed to attach.

It should be fine this time. Please check.

 

--- Stuart Henderson                                         2011-09-22 05:29:00

Thanks Vivi, that's it working now.

 

This is a bug in oprofile which is exposed by the new binutils.  you need to

apply the following patch to your source tree:

 

Index: user/oprofile/oprofile-0.9.1/libutil++/op_bfd.cpp

===================================================================

--- user/oprofile/oprofile-0.9.1/libutil++/op_bfd.cpp   (revision 10410)

+++ user/oprofile/oprofile-0.9.1/libutil++/op_bfd.cpp   (working copy)

@@ -352,6 +352,9 @@

        unsigned long start = sym.filepos();

        unsigned long end = next ? next->filepos() : file_size;

 

+       if (start > end)

+               return 0;

+

        return end - start;

}

 

 

or use a more modern version of oprofile that already has the patch.

 

--- Vivi Li                                                  2011-09-23 02:04:59

Thanks Stuart, your patch works fine.

I think we can commit this patch first to make current trunk work, then

consider to upgrade oprofile.

 

--- Vivi Li                                                  2011-09-23 04:44:59

Patch is checked in trunk.

Close it.

 

 

 

    Files

    Changes

    Commits

    Dependencies

    Duplicates

    Associations

    Tags

 

File Name     File Type     File Size     Posted By

config.user.oprofile.flat    application/octet-stream    51871    Vivi Li

config.kernel.oprofile.flat    application/octet-stream    36405    Vivi Li

Outcomes