public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jiri Olsa <jolsa@redhat.com>
To: Matija Glavinic Pecotic <matija.glavinic-pecotic.ext@nokia.com>
Cc: acme@redhat.com, linux-kernel@vger.kernel.org,
	Namhyung Kim <namhyung@kernel.org>,
	Masami Hiramatsu <mhiramat@kernel.org>
Subject: Re: [PATCH RFC RESEND] Perf: lookup dwarf unwind stack info in debug file pointed by .gnu_debuglink
Date: Wed, 24 Aug 2016 09:30:10 +0200	[thread overview]
Message-ID: <20160824073010.GA3202@krava> (raw)
In-Reply-To: <83fbb2b5-df77-220f-7157-6675560f7e72@nokia.com>

On Tue, Aug 23, 2016 at 06:18:10PM +0200, Matija Glavinic Pecotic wrote:

SNIP

> -		ret = filename__read_debuglink(filename, debuglink,
> -					       size - (debuglink - filename));
> +		ret = filename__read_debuglink(filename, symfile, PATH_MAX);
> +		if (ret)
> +			break;
> +
> +		/* Check predefined locations where debug file might reside:
> +		 *  - if debuglink is absolute path, check only that one
> +		 * If debuglink provides name w/o path, look for debug file:
> +		 *  - in the same directory as dso
> +		 *  - in the .debug subdirectory of dso directory
> +		 *  - in the /usr/lib/debug/[dso directory]
> +		 *  */
> +		ret = 0;
> +		if (symfile[0] == '/') {
> +			if (!is_regular_file(symfile))
> +				ret = -1;
> +			else
> +				strncpy(filename, symfile, size);
> +			break;
>  		}
> +
> +		snprintf(filename, size, "%s/%s", dso_dir, symfile);
> +		if(is_regular_file(filename))
> +			break;
> +
> +		snprintf(filename, size, "%s/.debug/%s", dso_dir, symfile);
> +		if(is_regular_file(filename))
> +			break;
> +
> +		snprintf(filename, size, "/usr/lib/debug/%s/%s",
> +				dso_dir, symfile);
> +		if(is_regular_file(filename))
> +			break;

it might be more clear to follow the same way we do for vmlinux search,
like array of possible paths and generic code to check.. search for
vmlinux_path in symbol.c

jirka

  reply	other threads:[~2016-08-24  7:30 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-22 12:32 [PATCH RFC RESEND] Perf: lookup dwarf unwind stack info in debug file pointed by .gnu_debuglink Matija Glavinic Pecotic
2016-08-22 15:19 ` Jiri Olsa
2016-08-23  5:09   ` Matija Glavinic Pecotic
2016-08-23 11:22     ` Jiri Olsa
2016-08-23 12:33       ` Matija Glavinic Pecotic
2016-08-23 16:18         ` Matija Glavinic Pecotic
2016-08-24  7:30           ` Jiri Olsa [this message]
2016-08-24  8:13             ` Matija Glavinic Pecotic
2016-08-26  6:12       ` Namhyung Kim
2016-08-26  7:00         ` Matija Glavinic Pecotic

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=20160824073010.GA3202@krava \
    --to=jolsa@redhat.com \
    --cc=acme@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matija.glavinic-pecotic.ext@nokia.com \
    --cc=mhiramat@kernel.org \
    --cc=namhyung@kernel.org \
    /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