mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jiri Olsa <jolsa@redhat.com>
To: Wang Nan <wangnan0@huawei.com>
Cc: jolsa@kernel.org, namhyung@kernel.org, a.p.zijlstra@chello.nl,
	paulus@samba.org, mingo@redhat.com, acme@kernel.org,
	masami.hiramatsu.pt@hitachi.com, jean.pihet@linaro.org,
	linux-kernel@vger.kernel.org, lizefan@huawei.com
Subject: Re: [PATCH] perf: fix dwarf unwind using libunwind.
Date: Tue, 13 Jan 2015 10:19:28 +0100	[thread overview]
Message-ID: <20150113091928.GA2160@krava.brq.redhat.com> (raw)
In-Reply-To: <54B4D925.3020906@huawei.com>

On Tue, Jan 13, 2015 at 04:36:53PM +0800, Wang Nan wrote:
> On 2015/1/13 15:10, Jiri Olsa wrote:
> > On Tue, Jan 13, 2015 at 10:54:37AM +0800, Wang Nan wrote:
> > 
> > SNIP
> > 
> >>  
> >> +static int elf_is_exec(int fd, const char *name)
> >> +{
> >> +	Elf *elf;
> >> +	GElf_Ehdr ehdr;
> >> +	int retval = 0;
> >> +
> >> +	elf = elf_begin(fd, PERF_ELF_C_READ_MMAP, NULL);
> >> +	if (elf == NULL)
> >> +		return 0;
> >> +	if (gelf_getehdr(elf, &ehdr) == NULL)
> >> +		goto out;
> >> +
> >> +	retval = (ehdr.e_type == ET_EXEC);
> >> +
> >> +out:
> >> +	elf_end(elf);
> >> +	pr_debug("unwind: elf_is_exec(%s): %d\n", name, retval);
> >> +	return retval;
> >> +
> >> +}
> > 
> > yuou need to add stub for 'NO_LIBUNWIND_DEBUG_FRAME=1', otherwise:
> > 
> >   CC       util/dwarf-aux.o
> >   CC       util/unwind-libunwind.o
> > util/unwind-libunwind.c:188:12: error: ‘elf_is_exec’ defined but not used [-Werror=unused-function]
> >  static int elf_is_exec(int fd, const char *name)
> >             ^
> > cc1: all warnings being treated as errors
> > make[1]: *** [util/unwind-libunwind.o] Error 1
> > make[1]: *** Waiting for unfinished jobs....
> > make: *** [all] Error 2
> > 
> > jirka
> > 
> 
> Thanks. I haven't test NO_LIBUNWIND_DEBUG_FRAME=1 case.
> 
> I found that it is possible to utilize map->dso->adjust_symbols for this propose so
> we don't need to introduce another function to check ehdr.e_type. However
> map->dso->adjust_symbols checks not only ET_EXEC but also ET_REL. What do you think?
> 
> I'd like to check it and post another patch.

please also update tests/mate

thanks,
jirka

  reply	other threads:[~2015-01-13  9:24 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-13  2:54 Wang Nan
2015-01-13  7:10 ` Jiri Olsa
2015-01-13  8:36   ` Wang Nan
2015-01-13  9:19     ` Jiri Olsa [this message]
2015-01-14  2:36       ` [PATCH v2] " Wang Nan
2015-01-14 11:57         ` Jiri Olsa
2015-01-14 12:50           ` Arnaldo Carvalho de Melo
2015-01-17 10:12         ` [tip:perf/urgent] perf test: Fix " tip-bot for Wang Nan

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=20150113091928.GA2160@krava.brq.redhat.com \
    --to=jolsa@redhat.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@kernel.org \
    --cc=jean.pihet@linaro.org \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizefan@huawei.com \
    --cc=masami.hiramatsu.pt@hitachi.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=paulus@samba.org \
    --cc=wangnan0@huawei.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

Powered by JetHome