The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Rabin Vincent <rabin.vincent@axis.com>
Cc: linux-kernel@vger.kernel.org, Rabin Vincent <rabinv@axis.com>,
	Jiri Olsa <jolsa@kernel.org>, He Kuang <hekuang@huawei.com>
Subject: Re: [PATCH] perf unwind: check symsrc ELF for .debug_frame
Date: Wed, 10 Aug 2016 11:00:26 -0300	[thread overview]
Message-ID: <20160810140026.GF4249@kernel.org> (raw)
In-Reply-To: <1470836176-29418-1-git-send-email-rabin.vincent@axis.com>

Em Wed, Aug 10, 2016 at 03:36:16PM +0200, Rabin Vincent escreveu:
> From: Rabin Vincent <rabinv@axis.com>
> 
> When using split debug info, the file without debug info may not have a
> .debug_frame section, so we need to check the symsrc ELF also, since
> that's the file we actually read the unwind information from.

Thanks for your work, next time please also copy the persons that did
work on this file recently, like:

He Kuang <hekuang@huawei.com>

And people who acked or reviewed their patches, like:

Jiri Olsa <jolsa@kernel.org>

Guys, are you ok with these changes? 2/2 seems trivial enough.

- Arnaldo
 
> Signed-off-by: Rabin Vincent <rabinv@axis.com>
> ---
>  tools/perf/util/unwind-libunwind-local.c | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
> 
> diff --git a/tools/perf/util/unwind-libunwind-local.c b/tools/perf/util/unwind-libunwind-local.c
> index 97c0f8f..d492192 100644
> --- a/tools/perf/util/unwind-libunwind-local.c
> +++ b/tools/perf/util/unwind-libunwind-local.c
> @@ -308,6 +308,20 @@ static int read_unwind_spec_debug_frame(struct dso *dso,
>  		dso__data_put_fd(dso);
>  	}
>  
> +	/*
> +	 * With split debug info, the file without debug info may not have a
> +	 * .debug_frame, so check the symsrc too.
> +	 */
> +	if (ofs == 0 && dso->symsrc_filename) {
> +		fd = open(dso->symsrc_filename, O_RDONLY);
> +		if (fd < 0)
> +			return -EINVAL;
> +
> +		ofs = elf_section_offset(fd, ".debug_frame");
> +		dso->data.debug_frame_offset = ofs;
> +		close(fd);
> +	}
> +
>  	*offset = ofs;
>  	if (*offset)
>  		return 0;
> -- 
> 2.1.4

      reply	other threads:[~2016-08-10 18:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-10 13:36 [PATCH] perf unwind: check symsrc ELF for .debug_frame Rabin Vincent
2016-08-10 14:00 ` Arnaldo Carvalho de Melo [this message]

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=20160810140026.GF4249@kernel.org \
    --to=acme@kernel.org \
    --cc=hekuang@huawei.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rabin.vincent@axis.com \
    --cc=rabinv@axis.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