[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160824073010.GA3202@krava>
Date: Wed, 24 Aug 2016 09:30:10 +0200
From: Jiri Olsa <jolsa@...hat.com>
To: Matija Glavinic Pecotic <matija.glavinic-pecotic.ext@...ia.com>
Cc: acme@...hat.com, linux-kernel@...r.kernel.org,
Namhyung Kim <namhyung@...nel.org>,
Masami Hiramatsu <mhiramat@...nel.org>
Subject: Re: [PATCH RFC RESEND] Perf: lookup dwarf unwind stack info in debug
file pointed by .gnu_debuglink
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
Powered by blists - more mailing lists