Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp8115653ybc; Fri, 29 Nov 2019 05:51:17 -0800 (PST) X-Google-Smtp-Source: APXvYqzrudFH+vHeGx5z0N3suoWdtDgTfEFOuDsYX6IzMTYxNfg4xQCgfdEO7he3nz5Pt1vxepud X-Received: by 2002:a17:906:958e:: with SMTP id r14mr37119501ejx.228.1575035477153; Fri, 29 Nov 2019 05:51:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575035477; cv=none; d=google.com; s=arc-20160816; b=P4fXDZ2n+igLXjEvGXa6SuHvCIBYqO11YZB1G23QrjFwvPRmch6lEScZlGEBqrsw/+ Pi3LM7lsUhkv8LeeadfNxik1MD+y2tRdYJo4ohcmjhwiPRTxP0jUvGWF0fX13n12GBka b5G6jj5k3D+CyvDqO8Tm3WrP24Cc+H8QVacKHghdERapySJUxxsmiyVqq4Ta1qRb3SK8 Km/ivjJ6/L8C0lFx5kRr8Z7jEjZkxZZuEqB4872enJqAGhQ2Ax2caU9bWwm0EWSyocHz 0ShLBgTM8PJwdMvL6Pf618h7DBdrVS644HwKdR50lNqi5ddaP1gw1oUuijbxr2tr0RQO DDUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:user-agent:in-reply-to:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=3xCy0nxTbAZVp5vEUkYIW3ozNj+sxeQG2POsXKW5FaE=; b=RbUnLjKqDdL2uGS8CoUnzCLlNIPNBiHcf4fWTpwZOCpcA0hnVszecqt9s/FU1s+cYQ NORIaS1poukarg9ofpOFLPrZhXtGjEXKzbuDDvoI6GTPQ2lZUQJRwsGN0mGmSOi/pcHW q8lct7LGnaIVcvdIjEy7+RS490gwJpyG0fjc/ticKfuz73apYybcKSG/YZKYAvFyS4FO F2U3uJiQ5/yMO3n3cWNHvD6ztQSbEj+SKdymWjSwBbTRsl7IzC/ulvSnvcEOzTlhd57c DAJtfYNyEG9ZI0ykLM727rLBK7IEuW/5HbDM8fj3JEZcu3xxG+SOBVY+mOTEsaJHe2K0 sgNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=OFtrkQ7d; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k20si13336261ejj.21.2019.11.29.05.50.52; Fri, 29 Nov 2019 05:51:17 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=OFtrkQ7d; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726877AbfK2Ntn (ORCPT + 99 others); Fri, 29 Nov 2019 08:49:43 -0500 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:50669 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726853AbfK2Ntn (ORCPT ); Fri, 29 Nov 2019 08:49:43 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1575035381; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3xCy0nxTbAZVp5vEUkYIW3ozNj+sxeQG2POsXKW5FaE=; b=OFtrkQ7dHOKU/FvtLR7+oK4AeWkzlMISiPyJj4Cf25sqhjzONSfK8/bBjiI6hEbvhFBq56 JoeDWA6jc5lWe+x3+4Us1Ag9/VgEd+FDRdK/CNyo7WkADZjsoKZTgg79Y1s9g2fjxDJrgP GP83JG+xBylRHd0PyyqiLr/GsB3ZWjc= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-214-QijvxbDoNciiPLjItl4oYQ-1; Fri, 29 Nov 2019 08:49:33 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7B86910054E3; Fri, 29 Nov 2019 13:49:32 +0000 (UTC) Received: from krava (unknown [10.43.17.48]) by smtp.corp.redhat.com (Postfix) with SMTP id B182460BF1; Fri, 29 Nov 2019 13:49:30 +0000 (UTC) Date: Fri, 29 Nov 2019 14:49:29 +0100 From: Jiri Olsa To: Ivan Babrou Cc: linux-kernel , linux-perf-users@vger.kernel.org, Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Alexander Shishkin , Namhyung Kim , kernel-team Subject: Re: perf is unable to read dward from go programs Message-ID: <20191129134929.GA26903@krava> References: MIME-Version: 1.0 In-Reply-To: User-Agent: Mutt/1.12.1 (2019-06-15) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-MC-Unique: QijvxbDoNciiPLjItl4oYQ-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. >=20 > On Fri, Nov 8, 2019 at 3:53 PM Ivan Babrou 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=3D1 VF=3D1 NO_LIBUNWIND=3D1 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 | =20 --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 | =20 |--7.45%--runtime.newobject | | =20 | --7.45%--main.burn | main.main | runtime.main | runtime.goexit | =20 --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 | =20 |--2.91%--crypto/sha512.(*digest).checkSum | crypto/sha512.(*digest).Sum | main.burn | main.main | runtime.main | runtime.goexit | =20 --0.57%--main.burn main.main runtime.main runtime.goexit 3.44% ex ex [.] runtime.memclrNoHeapPointers | ---runtime.memclrNoHeapPointers | =20 --2.92%--runtime.(*mheap).alloc runtime.(*mcentral).grow runtime.(*mcentral).cacheSpan runtime.(*mcache).refill runtime.(*mcache).nextFree runtime.mallocgc | =20 |--2.27%--runtime.newobject | main.burn | main.main | runtime.main | runtime.goexit | =20 --0.64%--runtime.growslice crypto/sha512.(*digest).Sum main.burn main.main runtime.main runtime.goexit ...