DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Rosen, Rami" <rami.rosen@intel.com>
To: Stephen Hemminger <stephen@networkplumber.org>,
	Thomas Monjalon <thomas.monjalon@6wind.com>
Cc: Catalin Vasile <cata.vasile@nxp.com>,
	"dev@dpdk.org" <dev@dpdk.org>,
	"Dumitrescu, Cristian" <cristian.dumitrescu@intel.com>,
	"Rosen, Rami" <rami.rosen@intel.com>
Subject: Re: [dpdk-dev] backtracing from within the code
Date: Sat, 25 Jun 2016 14:07:03 +0000	[thread overview]
Message-ID: <9B0331B6EBBD0E4684FBFAEDA55776F92CD6F0DF@HASMSX110.ger.corp.intel.com> (raw)
In-Reply-To: <20160624104607.3648e62f@samsung9>

Hi,
If you are willing to skip static methods and use the GCC backtrace, you can 
try this example (it worked for me, but it was quite a time ago):
http://www.helicontech.co.il/?id=linuxbt

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 <thomas.monjalon@6wind.com>
Cc: Catalin Vasile <cata.vasile@nxp.com>; dev@dpdk.org; Dumitrescu, Cristian <cristian.dumitrescu@intel.com>
Subject: Re: [dpdk-dev] backtracing from within the code

On Fri, 24 Jun 2016 12:05:26 +0200
Thomas Monjalon <thomas.monjalon@6wind.com> 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.

  reply	other threads:[~2016-06-25 14:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-24  8:10 Catalin Vasile
2016-06-24  9:25 ` Dumitrescu, Cristian
2016-06-24 10:05   ` Thomas Monjalon
2016-06-24 17:46     ` Stephen Hemminger
2016-06-25 14:07       ` Rosen, Rami [this message]
2016-06-27 15:42         ` Matt Laswell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9B0331B6EBBD0E4684FBFAEDA55776F92CD6F0DF@HASMSX110.ger.corp.intel.com \
    --to=rami.rosen@intel.com \
    --cc=cata.vasile@nxp.com \
    --cc=cristian.dumitrescu@intel.com \
    --cc=dev@dpdk.org \
    --cc=stephen@networkplumber.org \
    --cc=thomas.monjalon@6wind.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).