All of lore.kernel.org
 help / color / mirror / Atom feed
From: Namhyung Kim <namhyung@kernel.org>
To: Arnaldo Carvalho de Melo <acme@kernel.org>,
	Ian Rogers <irogers@google.com>,
	Kan Liang <kan.liang@linux.intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>,
	Adrian Hunter <adrian.hunter@intel.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	linux-perf-users@vger.kernel.org
Subject: [PATCH 2/2] perf annotate: Update dso binary type when try build-id
Date: Wed, 24 Apr 2024 17:51:57 -0700	[thread overview]
Message-ID: <20240425005157.1104789-2-namhyung@kernel.org> (raw)
In-Reply-To: <20240425005157.1104789-1-namhyung@kernel.org>

dso__disassemble_filename() tries to get the filename for objdump (or
capstone) using build-id.  But I found sometimes it didn't disassemble
some functions.  It turned out that those functions belong to a dso
which has no binary type set.  It seems it sets the binary type for some
special files only - like kernel (kallsyms or kcore) or BPF images.  And
there's a logic to skip dso with DSO_BINARY_TYPE__NOT_FOUND.

As it's checked the build-id cache linke, it should set the binary type
as DSO_BINARY_TYPE__BUILD_ID_CACHE.

Fixes: 873a83731f1c ("perf annotate: Skip DSOs not found")
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
 tools/perf/util/disasm.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/perf/util/disasm.c b/tools/perf/util/disasm.c
index 412101f2cf2a..6d1125e687b7 100644
--- a/tools/perf/util/disasm.c
+++ b/tools/perf/util/disasm.c
@@ -1156,6 +1156,8 @@ static int dso__disassemble_filename(struct dso *dso, char *filename, size_t fil
 			}
 		}
 		mutex_unlock(&dso->lock);
+	} else if (dso->binary_type == DSO_BINARY_TYPE__NOT_FOUND) {
+		dso->binary_type = DSO_BINARY_TYPE__BUILD_ID_CACHE;
 	}
 
 	free(build_id_path);
-- 
2.44.0.769.g3c40516874-goog


  reply	other threads:[~2024-04-25  0:51 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-25  0:51 [PATCH 1/2] perf annotate: Fallback to objdump when capstone fails Namhyung Kim
2024-04-25  0:51 ` Namhyung Kim [this message]
2024-04-25 14:12   ` [PATCH 2/2] perf annotate: Update dso binary type when try build-id Arnaldo Carvalho de Melo
2024-04-25 14:49     ` Arnaldo Carvalho de Melo
2024-04-27  1:09       ` Arnaldo Carvalho de Melo
2024-04-25 14:50     ` Ian Rogers
2024-04-25 14:02 ` [PATCH 1/2] perf annotate: Fallback to objdump when capstone fails Arnaldo Carvalho de Melo
2024-04-25 14:02 ` Arnaldo Carvalho de Melo

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=20240425005157.1104789-2-namhyung@kernel.org \
    --to=namhyung@kernel.org \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=irogers@google.com \
    --cc=jolsa@kernel.org \
    --cc=kan.liang@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.