From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pa0-f42.google.com (mail-pa0-f42.google.com [209.85.220.42]) by dpdk.org (Postfix) with ESMTP id 715E9C5B8 for ; Fri, 24 Jun 2016 19:46:11 +0200 (CEST) Received: by mail-pa0-f42.google.com with SMTP id bz2so39400168pad.1 for ; Fri, 24 Jun 2016 10:46:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=d1GBHO0U7+OuAi13bG0CwDffCmkUWZR+gs/tUTuuyzw=; b=Nl97Xfb6g3gLl7TqCy7KANJWYhtYl9dhiuiV3NaFtYmK7iTROkRtTN7DI0k9922nDs UnnEhGpFGJPbbn2S/WF2KvkJ+ghgfM5iJzPC2V4FWOao4VK+pBh12HVd4SIymt9iFQrI mBmoXG3TPOj/PX3Oya4jqgbg0C871JQl6aJz2WQ7almkpyvlusZ8G1ZMZtiWNXDyAboz U9V6Jcu8mdxCe0zMD0s5ueaXWHCPHe/0pK/Iksy+a5wX5bf14om3IBxYr23ZSoOzJJkZ SGUtQZD4oAMcSW6dasfYeWhK3a4CbpPM6xBpVRUBQKWNlsKZU2mt1f+TWgb7mlI6Cqxx GttQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=d1GBHO0U7+OuAi13bG0CwDffCmkUWZR+gs/tUTuuyzw=; b=JdSN/ztFy/ytxX8UB24axGUmVPFYWE+dlfUT5y4ydPITXQgDmX+Xmj8HGLkTgWJJdn 5T9iI/+KeOWmGjBOkDEOLIVWZBnZ2QFRzkVId9MAHRQhIis89ThWN7OKaSpELmc73FWa pxzh0Xv/f00F0ecsd2NMuMtWcn/eVq7GZJAJQIuqsSpjY11vzmMdjjabPRTvVAT1tfi7 cNCxHVUkl8vM9tO1SzN+3cjHKtrg1qM0FrL/a9ektjqdEoeWijUvSzaRdFB8mxV4whFT /75TOy+Dj7zzXT8hwkI16NL4L2YIfrljJe2jCn8v79WIUIhhsBYeWtEjtOSIPOzuJ7ur 6jMw== X-Gm-Message-State: ALyK8tIx5ZdrAnKDKGdHIflcTL6HVJRshLF4QIKKCF2j/wYOmeLyLh5CgYwAShoWHQ+UVw== X-Received: by 10.66.191.138 with SMTP id gy10mr9635015pac.53.1466790370667; Fri, 24 Jun 2016 10:46:10 -0700 (PDT) Received: from samsung9 ([144.49.132.3]) by smtp.gmail.com with ESMTPSA id 7sm1572845pfa.28.2016.06.24.10.46.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 Jun 2016 10:46:10 -0700 (PDT) Date: Fri, 24 Jun 2016 10:46:07 -0700 From: Stephen Hemminger To: Thomas Monjalon Cc: Catalin Vasile , dev@dpdk.org, "Dumitrescu, Cristian" Message-ID: <20160624104607.3648e62f@samsung9> In-Reply-To: <1678929.kjLRgJKAHP@xps13> References: <3EB4FA525960D640B5BDFFD6A3D8912647A0C78F@IRSMSX108.ger.corp.intel.com> <1678929.kjLRgJKAHP@xps13> X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.25; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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: Fri, 24 Jun 2016 17:46:11 -0000 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 printing a > > > backtrace. > > > I tried using this[1] functions for printing, but it does not print more 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 looking for. > > 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]] > > Please tell us if you have some cases where rte_dump_stack() does not work. > 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.