[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9b2b5b0e-727c-4e74-8337-875498941de2@intel.com>
Date: Wed, 11 Sep 2024 11:04:10 +0300
From: Adrian Hunter <adrian.hunter@...el.com>
To: Changbin Du <changbin.du@...wei.com>,
Peter Zijlstra <peterz@...radead.org>, Ingo Molnar <mingo@...hat.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
Namhyung Kim <namhyung@...nel.org>, Nathan Chancellor <nathan@...nel.org>
Cc: Mark Rutland <mark.rutland@....com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Jiri Olsa <jolsa@...nel.org>, Ian Rogers <irogers@...gle.com>,
"Liang, Kan" <kan.liang@...ux.intel.com>,
Nick Desaulniers <ndesaulniers@...gle.com>, Bill Wendling
<morbo@...gle.com>, Justin Stitt <justinstitt@...gle.com>,
linux-perf-users@...r.kernel.org, linux-kernel@...r.kernel.org,
llvm@...ts.linux.dev, Hui Wang <hw.huiwang@...wei.com>
Subject: Re: [PATCH v6 5/8] perf: build-id: add support for build-id cache
vdso debug
On 25/07/24 05:15, Changbin Du wrote:
> This try to add debugging vdso elf to build-id cache the same as normal
> objects. Later we will extend this to find local debugging vdso from
> special paths.
>
> Cc: Adrian Hunter <adrian.hunter@...el.com>
> Signed-off-by: Changbin Du <changbin.du@...wei.com>
Reviewed-by: Adrian Hunter <adrian.hunter@...el.com>
> ---
> tools/perf/util/build-id.c | 9 ++++-----
> 1 file changed, 4 insertions(+), 5 deletions(-)
>
> diff --git a/tools/perf/util/build-id.c b/tools/perf/util/build-id.c
> index 83a1581e8cf1..5bda47de5cf2 100644
> --- a/tools/perf/util/build-id.c
> +++ b/tools/perf/util/build-id.c
> @@ -259,8 +259,8 @@ static bool build_id_cache__valid_id(char *sbuild_id)
> static const char *build_id_cache__basename(bool is_kallsyms, bool is_vdso,
> bool is_debug)
> {
> - return is_kallsyms ? "kallsyms" : (is_vdso ? "vdso" : (is_debug ?
> - "debug" : "elf"));
> + return is_kallsyms ? "kallsyms" : (is_debug ? "debug" : (is_vdso ?
> + "vdso" : "elf"));
> }
>
> char *__dso__build_id_filename(const struct dso *dso, char *bf, size_t size,
> @@ -701,13 +701,12 @@ build_id_cache__add(const char *sbuild_id, const char *name, const char *realnam
> * file itself may not be very useful to users of our tools without a
> * symtab.
> */
> - if (!is_kallsyms && !is_vdso &&
> - strncmp(".ko", name + strlen(name) - 3, 3)) {
> + if (!is_kallsyms && strncmp(".ko", name + strlen(name) - 3, 3)) {
> debugfile = build_id_cache__find_debug(sbuild_id, nsi, root_dir);
> if (debugfile) {
> zfree(&filename);
> if (asprintf(&filename, "%s/%s", dir_name,
> - build_id_cache__basename(false, false, true)) < 0) {
> + build_id_cache__basename(false, is_vdso, true)) < 0) {
> filename = NULL;
> goto out_free;
> }
Powered by blists - more mailing lists