From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id CEE3D9AB8 for ; Sat, 25 Jun 2016 16:07:07 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga104.fm.intel.com with ESMTP; 25 Jun 2016 07:07:06 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,527,1459839600"; d="scan'208";a="1009502091" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by fmsmga002.fm.intel.com with ESMTP; 25 Jun 2016 07:07:06 -0700 Received: from FMSMSX109.amr.corp.intel.com (10.18.116.9) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.248.2; Sat, 25 Jun 2016 07:07:06 -0700 Received: from lcsmsx152.ger.corp.intel.com (10.186.165.231) by fmsmsx109.amr.corp.intel.com (10.18.116.9) with Microsoft SMTP Server (TLS) id 14.3.248.2; Sat, 25 Jun 2016 07:07:06 -0700 Received: from HASMSX110.ger.corp.intel.com ([169.254.11.140]) by LCSMSX152.ger.corp.intel.com ([169.254.4.184]) with mapi id 14.03.0248.002; Sat, 25 Jun 2016 17:07:03 +0300 From: "Rosen, Rami" To: Stephen Hemminger , Thomas Monjalon CC: Catalin Vasile , "dev@dpdk.org" , "Dumitrescu, Cristian" , "Rosen, Rami" Thread-Topic: [dpdk-dev] backtracing from within the code Thread-Index: AQHRze/LR30tfteT7kCt+NqkdjD4R5/4V2mw///aSACAAIC2gIABhr+Q Date: Sat, 25 Jun 2016 14:07:03 +0000 Message-ID: <9B0331B6EBBD0E4684FBFAEDA55776F92CD6F0DF@HASMSX110.ger.corp.intel.com> References: <3EB4FA525960D640B5BDFFD6A3D8912647A0C78F@IRSMSX108.ger.corp.intel.com> <1678929.kjLRgJKAHP@xps13> <20160624104607.3648e62f@samsung9> In-Reply-To: <20160624104607.3648e62f@samsung9> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYWJiZTE1ODItMjhhOS00ODBlLTg5MTctZjlkYTdjM2Q2YWY2IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6Ino2d3pBR2hcL3JaRk5ZMmpld0JMbEJEK1d1bk45T2MzdWVcLzJONjBJZmZlWT0ifQ== x-ctpclassification: CTP_IC x-originating-ip: [10.184.70.11] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] backtracing from within the code X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jun 2016 14:07:08 -0000 Hi, If you are willing to skip static methods and use the GCC backtrace, you ca= n=20 try this example (it worked for me, but it was quite a time ago): http://www.helicontech.co.il/?id=3Dlinuxbt Regards, Rami Rosen Intel Corporation -----Original Message----- From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Stephen Hemminger Sent: Friday, June 24, 2016 8:46 PM To: Thomas Monjalon Cc: Catalin Vasile ; dev@dpdk.org; Dumitrescu, Cristia= n Subject: Re: [dpdk-dev] backtracing from within the code On Fri, 24 Jun 2016 12:05:26 +0200 Thomas Monjalon wrote: > 2016-06-24 09:25, Dumitrescu, Cristian: > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Catalin Vasile > > > I'm trying to add a feature to DPDK and I'm having a hard time printi= ng a > > > backtrace. > > > I tried using this[1] functions for printing, but it does not print m= ore than one > > > function. Maybe it lacks the symbols it needs. > [...] > > It eventually calls rte_dump_stack() in file lib/lirte_eal/linuxapp/eal= /eal_debug.c, which calls backtrace(), which is probably what you are looki= ng for.=20 >=20 > Example: > 5: [build/app/testpmd(_start+0x29) [0x416f69]] > 4: [/usr/lib/libc.so.6(__libc_start_main+0xf0) [0x7eff3b757610]] > 3: [build/app/testpmd(main+0x2ff) [0x416b3f]] > 2: [build/app/testpmd(init_port_config+0x88) [0x419a78]] > 1: [build/lib/librte_eal.so.2.1(rte_dump_stack+0x18) [0x7eff3c126488]] >=20 > Please tell us if you have some cases where rte_dump_stack() does not wor= k. > I do not remember what are the constraints to have it working. > Your binary is not stripped? The GCC backtrace doesn't work well because it can't find static functions. I ended up using libunwind to get a better back trace.