lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20191129134929.GA26903@krava>
Date:   Fri, 29 Nov 2019 14:49:29 +0100
From:   Jiri Olsa <jolsa@...hat.com>
To:     Ivan Babrou <ivan@...udflare.com>
Cc:     linux-kernel <linux-kernel@...r.kernel.org>,
        linux-perf-users@...r.kernel.org,
        Peter Zijlstra <peterz@...radead.org>,
        Ingo Molnar <mingo@...hat.com>,
        Arnaldo Carvalho de Melo <acme@...nel.org>,
        Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
        Namhyung Kim <namhyung@...nel.org>,
        kernel-team <kernel-team@...udflare.com>
Subject: Re: perf is unable to read dward from go programs

On Wed, Nov 27, 2019 at 01:15:20PM -0800, Ivan Babrou wrote:
> There were no response in linux-perf-users@, so I think it's fair to
> ask maintainers.
> 
> On Fri, Nov 8, 2019 at 3:53 PM Ivan Babrou <ivan@...udflare.com> wrote:
> >
> > I have a simple piece of code that burns CPU for 1s:
> >
> > * https://gist.github.com/bobrik/cf022ff6950d09032fa13a984e2272ed
> >
> > I can build it just fine: go build -o /tmp/burn burn.go
> >
> > And I can see correct stacks if I record with fp:
> >
> > perf record -e cpu-clock -g -F 99 /tmp/burn
> >
> > But if I record with gwarf:
> >
> > perf record -e cpu-clock -g -F 99 --call-graph dwarf /tmp/burn
> >
> > Then stacks are lost with the following complaints during "perf script":
> >
> > BFD: Dwarf Error: found dwarf version '376', this reader only handles
> > version 2, 3 and 4 information.
> > BFD: Dwarf Error: found dwarf version '31863', this reader only
> > handles version 2, 3 and 4 information.
> > BFD: Dwarf Error: found dwarf version '65271', this reader only
> > handles version 2, 3 and 4 information.
> > BFD: Dwarf Error: found dwarf version '289', this reader only handles
> > version 2, 3 and 4 information.

hi,
the binary generated by go has compressed debug info (on my setup)
and libunwind (default dwarf unwinder) does not seem to support that

but when I compile perf with libdw unwind support:

  $ make DEBUG=1 VF=1 NO_LIBUNWIND=1

I'm getting proper backtraces (below), maybe it's time to change
the default dwarf unwinder ;-)

thanks,
jirka


---
    51.63%  ex       ex                [.] crypto/sha512.blockAVX2
            |
            ---crypto/sha512.blockAVX2
               |          
                --51.48%--crypto/sha512.block
                          crypto/sha512.(*digest).Write
                          crypto/sha512.(*digest).checkSum
                          crypto/sha512.(*digest).Sum
                          main.burn
                          main.main
                          runtime.main
                          runtime.goexit

    11.55%  ex       ex                [.] runtime.mallocgc
            |
            ---runtime.mallocgc
               |          
               |--7.45%--runtime.newobject
               |          |          
               |           --7.45%--main.burn
               |                     main.main
               |                     runtime.main
               |                     runtime.goexit
               |          
                --3.40%--runtime.growslice
                          crypto/sha512.(*digest).Sum
                          main.burn
                          main.main
                          runtime.main
                          runtime.goexit

     3.69%  ex       ex                [.] crypto/sha512.(*digest).Write
            |
            ---crypto/sha512.(*digest).Write
               |          
               |--2.91%--crypto/sha512.(*digest).checkSum
               |          crypto/sha512.(*digest).Sum
               |          main.burn
               |          main.main
               |          runtime.main
               |          runtime.goexit
               |          
                --0.57%--main.burn
                          main.main
                          runtime.main
                          runtime.goexit

     3.44%  ex       ex                [.] runtime.memclrNoHeapPointers
            |
            ---runtime.memclrNoHeapPointers
               |          
                --2.92%--runtime.(*mheap).alloc
                          runtime.(*mcentral).grow
                          runtime.(*mcentral).cacheSpan
                          runtime.(*mcache).refill
                          runtime.(*mcache).nextFree
                          runtime.mallocgc
                          |          
                          |--2.27%--runtime.newobject
                          |          main.burn
                          |          main.main
                          |          runtime.main
                          |          runtime.goexit
                          |          
                           --0.64%--runtime.growslice
                                     crypto/sha512.(*digest).Sum
                                     main.burn
                                     main.main
                                     runtime.main
                                     runtime.goexit
...

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ