From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B607F1C694 for ; Thu, 25 Jul 2024 02:16:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.188 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721873786; cv=none; b=QCLvB+Bf6UxDckphXwJHE1jVKhIdcekTEY/Q1/qOfPv3vUeWWEg5YrM/HAELzG5hoU93D2s6wNoE1PRP2miZd1nKAE6NCNVpS4QqR8M23zwSxAPOW+MSRn4hjNWsAoJKoyWgNw4esv3B+RjrKkJVmzqVzgcle1xYWxW/Uoo/s10= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721873786; c=relaxed/simple; bh=sisKOpu/Vo7sGSxHa6dVdjlQnbQ+gt2LsAJ8FkZo7YY=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=VTs60EF32dBddXgd0Zovf8yfX+SBj9ccNaFCV4+m4AkSTyrukaS0qCrCVeeuWzPvBoIYRxJ9Ra2jex+V/hXE4X5b3ZiNCcI+p8RpyBFBZVNq17mbyx1Jm+8RxXgqBohf/t6BKiVA1z8ULvgwtug9wI2Tr504KsvsY7XCM7hrHPQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.188 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.88.194]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4WTvbG1PTwzMr5Q; Thu, 25 Jul 2024 10:14:34 +0800 (CST) Received: from kwepemd100011.china.huawei.com (unknown [7.221.188.204]) by mail.maildlp.com (Postfix) with ESMTPS id 9A9EC1402CB; Thu, 25 Jul 2024 10:16:21 +0800 (CST) Received: from M910t.huawei.com (10.110.54.157) by kwepemd100011.china.huawei.com (7.221.188.204) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.34; Thu, 25 Jul 2024 10:16:20 +0800 From: Changbin Du To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Nathan Chancellor CC: Mark Rutland , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , "Liang, Kan" , Nick Desaulniers , Bill Wendling , Justin Stitt , , , , Hui Wang , Changbin Du Subject: [PATCH v6 5/8] perf: build-id: add support for build-id cache vdso debug Date: Thu, 25 Jul 2024 10:15:46 +0800 Message-ID: <20240725021549.880167-6-changbin.du@huawei.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240725021549.880167-1-changbin.du@huawei.com> References: <20240725021549.880167-1-changbin.du@huawei.com> Precedence: bulk X-Mailing-List: llvm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To kwepemd100011.china.huawei.com (7.221.188.204) 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 Signed-off-by: Changbin Du --- 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