From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1763052AbbA3Sd6 (ORCPT ); Fri, 30 Jan 2015 13:33:58 -0500 Received: from terminus.zytor.com ([198.137.202.10]:35841 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1763029AbbA3Sd5 (ORCPT ); Fri, 30 Jan 2015 13:33:57 -0500 Date: Fri, 30 Jan 2015 10:33:37 -0800 From: tip-bot for Namhyung Kim Message-ID: Cc: adrian.hunter@intel.com, namhyung@kernel.org, mingo@kernel.org, dsahern@gmail.com, hpa@zytor.com, eranian@google.com, acme@redhat.com, fweisbec@gmail.com, jolsa@redhat.com, linux-kernel@vger.kernel.org, tglx@linutronix.de, a.p.zijlstra@chello.nl, andi@firstfloor.org Reply-To: andi@firstfloor.org, tglx@linutronix.de, a.p.zijlstra@chello.nl, linux-kernel@vger.kernel.org, jolsa@redhat.com, acme@redhat.com, fweisbec@gmail.com, eranian@google.com, hpa@zytor.com, namhyung@kernel.org, mingo@kernel.org, adrian.hunter@intel.com, dsahern@gmail.com In-Reply-To: <1422518843-25818-2-git-send-email-namhyung@kernel.org> References: <1422518843-25818-2-git-send-email-namhyung@kernel.org> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf symbols: Support to read compressed module from build-id cache Git-Commit-ID: 0b064f43001fc2627ff8c3020647b85db040235f X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 0b064f43001fc2627ff8c3020647b85db040235f Gitweb: http://git.kernel.org/tip/0b064f43001fc2627ff8c3020647b85db040235f Author: Namhyung Kim AuthorDate: Thu, 29 Jan 2015 17:06:42 +0900 Committer: Arnaldo Carvalho de Melo CommitDate: Thu, 29 Jan 2015 16:56:54 -0300 perf symbols: Support to read compressed module from build-id cache The commit c00c48fc6e6e ("perf symbols: Preparation for compressed kernel module support") added support for compressed kernel modules but it only supports system path DSOs. When a dso is read from build-id cache, its filename doesn't end with ".gz" but has build-id. In this case, we should fallback to the original dso->name. Signed-off-by: Namhyung Kim Cc: Adrian Hunter Cc: Andi Kleen Cc: David Ahern Cc: Frederic Weisbecker Cc: Jiri Olsa Cc: Peter Zijlstra Cc: Stephane Eranian Link: http://lkml.kernel.org/r/1422518843-25818-2-git-send-email-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/symbol-elf.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/tools/perf/util/symbol-elf.c b/tools/perf/util/symbol-elf.c index 06fcd1b..b24f9d8 100644 --- a/tools/perf/util/symbol-elf.c +++ b/tools/perf/util/symbol-elf.c @@ -574,13 +574,16 @@ static int decompress_kmodule(struct dso *dso, const char *name, const char *ext = strrchr(name, '.'); char tmpbuf[] = "/tmp/perf-kmod-XXXXXX"; - if ((type != DSO_BINARY_TYPE__SYSTEM_PATH_KMODULE_COMP && - type != DSO_BINARY_TYPE__GUEST_KMODULE_COMP) || - type != dso->symtab_type) + if (type != DSO_BINARY_TYPE__SYSTEM_PATH_KMODULE_COMP && + type != DSO_BINARY_TYPE__GUEST_KMODULE_COMP && + type != DSO_BINARY_TYPE__BUILD_ID_CACHE) return -1; - if (!ext || !is_supported_compression(ext + 1)) - return -1; + if (!ext || !is_supported_compression(ext + 1)) { + ext = strrchr(dso->name, '.'); + if (!ext || !is_supported_compression(ext + 1)) + return -1; + } fd = mkstemp(tmpbuf); if (fd < 0)