From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753791AbbGXDUP (ORCPT ); Thu, 23 Jul 2015 23:20:15 -0400 Received: from mail-yk0-f182.google.com ([209.85.160.182]:35221 "EHLO mail-yk0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752218AbbGXDUL (ORCPT ); Thu, 23 Jul 2015 23:20:11 -0400 Subject: Re: llvm bpf debug info. Re: [RFC PATCH v4 3/3] bpf: Introduce function for outputing data to perf event To: He Kuang , "Wangnan (F)" , pi3orama References: <1436522587-136825-1-git-send-email-hekuang@huawei.com> <1436522587-136825-4-git-send-email-hekuang@huawei.com> <55A042DC.6030809@plumgrid.com> <55A3404B.6020904@huawei.com> <20150713135223.GB9917@danjae.kornet> <4D441676-21A7-46EE-AAB0-EB529D408082@163.com> <20150713140915.GD9917@danjae.kornet> <55A46928.9090708@plumgrid.com> <55A4F869.1020705@huawei.com> <55A88085.8090407@plumgrid.com> <55A88137.7020609@huawei.com> <55A88449.3030008@plumgrid.com> <55B0D5FC.6050406@huawei.com> <55B1535E.8090406@plumgrid.com> Cc: "linux-kernel@vger.kernel.org" From: Alexei Starovoitov Message-ID: <55B1AEE9.1080207@plumgrid.com> Date: Thu, 23 Jul 2015 20:20:09 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:38.0) Gecko/20100101 Thunderbird/38.0.1 MIME-Version: 1.0 In-Reply-To: <55B1535E.8090406@plumgrid.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/23/15 1:49 PM, Alexei Starovoitov wrote: > On 7/23/15 4:54 AM, He Kuang wrote: > > trimmed cc-list, since it's not related to kernel. > >> Thank you for your guidence, and by referencing your last mail >> and other llvm backends, I found setting >> BPFMCAsmInfo::SupportsDebugInformation = true in BPFMCAsmInfo.h > > thanks! yes. it was missing. > >> and fix some unhandeled switch can make llc output debug_info, > > what do you mean ? > >> but important information is missing in the result: > > hmm. I see slightly different picture. > With 'clang -O2 -target bpf -g -S a.c' > I see all the right info inside .s file. > with '-c a.c' for some reasons it produces bogus offset: > Abbrev Offset: 0xffff0000 > Pointer Size: 8 > /usr/local/bin/objdump: Warning: Debug info is corrupted, abbrev offset > (ffff0000) is larger than abbrev section size (4b) > > and objdump fails to parse .o > I'm using llvm trunk 3.8. Do you see this as well? there were few issues related to relocations. Fixed it up and pushed to llvm trunk r243087. Please pull and give it a try. AT_location should be correct, but AT_name still looks buggy.