[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240725021549.880167-6-changbin.du@huawei.com>
Date: Thu, 25 Jul 2024 10:15:46 +0800
From: Changbin Du <changbin.du@...wei.com>
To: 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>, Adrian Hunter <adrian.hunter@...el.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>, Changbin Du
<changbin.du@...wei.com>
Subject: [PATCH v6 5/8] perf: build-id: add support for build-id cache vdso debug
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>
---
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;
}
--
2.34.1
Powered by blists - more mailing lists