Received: by 2002:a89:48b:0:b0:1f5:f2ab:c469 with SMTP id a11csp1143409lqd; Thu, 25 Apr 2024 07:13:13 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXNXCDngdRZnta5Ibcy604nejIsVrKRwtr37JgQmw1CzMibE01WPEVO9Yo1CUd+2BfuP4FG4Dw8uE/undfCL1e7ATbIiCAN0pFGBskyhw== X-Google-Smtp-Source: AGHT+IGbjVC2yqYPR+SrwYPl/JYByVRsMi2l6AdMhVYanF+LXhXBDQCwLKZoO6O26TQkB4Ia1ZyL X-Received: by 2002:a17:906:7195:b0:a58:7ea5:c49b with SMTP id h21-20020a170906719500b00a587ea5c49bmr5726278ejk.42.1714054393279; Thu, 25 Apr 2024 07:13:13 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714054393; cv=pass; d=google.com; s=arc-20160816; b=fJRbsBAjaTau6prQ8TDqGVolorCg3UU9zRAoM89NGX/6wKvnOre25Qe7nMt+N0RhVt AzxkhnmuFEfyt200uIeHTu+lgRpVmg0raiYasRYHcqTpbTT0w5PRpbLpcxnOYDazcBZ3 Vo7mEUuCLOHbXVql0GlpGpcYRC0gYpor50n1pupF/hmuFEF1u5e3lZKRZo01GSOOgDY9 64asnLkry1qSGIgvM4IC4OwzEI6LOQKG3APCI2o+vWFuwZqZw2zROjWnDtyhDnTgljG8 DOAvUi2EbEcJyCjUdyN2eXuAZUIdt8/HcxchGdxFQ/AUcKGyrF5lDh1o21CaicLlnn9k iAXw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=64LFJVEan34BcmbmX1prTOzPHnDStN8Uq3P3sIwbVW4=; fh=49GrrO/H3LiGmymuFnNd59pBYHHWBS2xk/6Ejg0rn8E=; b=dLGMuxyXCgElgbv1Wc4ESkpBiFq0Cmsra5M8Tgutqgx80QHegNW/fKsYnQ6Lkd6cQt 6Lxa9McqIq0DvRHfK3fwY710jtH5wEiKaBtuLhPg/Csw1Uyp01pB6ZuXtsz4WLZhPhPm U3YtYLEA6uRknHerwP0Kor1JSPIr8jte0tfGXignWvfapZ3JUhEjadoCIUHd0AtbHyYI poJ6OrvtJso5vYZA9Gq8fJnfKZwqXYnhJugdvsvM2xjYn16CzK40vpT1ICLzmEf5BGxc rE7b36wns9sOoD1S7/QmDQqaPbQJKu8nl5vdGjHZKTy/4uyrCfZXJU9bCOPC0pDdT29L oSGQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rea49bX5; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-158668-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-158668-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id sa40-20020a1709076d2800b00a588cfff2bdsi2930694ejc.163.2024.04.25.07.13.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Apr 2024 07:13:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-158668-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rea49bX5; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-158668-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-158668-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 22C711F22728 for ; Thu, 25 Apr 2024 14:13:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 325C314A4C8; Thu, 25 Apr 2024 14:12:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="rea49bX5" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 5982A14A08A; Thu, 25 Apr 2024 14:12:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714054360; cv=none; b=NzoZ6BpixfD+ZRR8v1CeLpp5+NWEXijE8Qm+qOJkEcOdBmjzSpU5qplSJIxNGgtBi6QTzWsS+t/V63z5XhwtWDh12/6FJfU9QGKy+4CL0w8/cXMA9suXOQz7JJfejELQVAb0PvJ2GLq1ZiX9N7LIBpZO9Eze4J5kVVKCTQTBCnU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714054360; c=relaxed/simple; bh=9cICcM8ZQlXyY6PN93HTqQikUXtMY8paiV5smzFHaps=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=nL/CRbcjdXw//K6gt/kDv7a2T4ftgViheLOqdmpmuMovl2UEqS8dvYev4S/98rTdAlc/Uo692ZIg+c1DpCSVUmk075urHJeUhg/7Td3tiIYcS/URvHMXGrrrsTlzzYWrGxcLQATEqwIdcYTAAvt3RiFmTlebJHcsLx3p8gLepZI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=rea49bX5; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1DFE9C113CE; Thu, 25 Apr 2024 14:12:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1714054359; bh=9cICcM8ZQlXyY6PN93HTqQikUXtMY8paiV5smzFHaps=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=rea49bX5nph7NYR/01w0KxxTo8BJ8bTnw+Pdr3YLJRP3J8ZMr642uTwRKv/A1ITuK +irwwpQjSuC6pVao+lAFp1f3dib0FCzhZ6k8Rb2sC12D8ujlnxvjgA0iV4TmXvMnOD 2yC0YAB9yVjewnyEWkYDVPSseVR3vxBnhGCZV5T+5UiW9MbzBDYMCxeGCymdyyPJck NICeSVqhbCC+GEXFqkQQlYQNHPgsckwCrAtwm+m+0bqwB6C3WuIsDHvb9Auy76qTBe GDx8QNT7ZnJPConRIOoZUxqJWSuQ1IqTjfgIeO/GEJH7DS8F5LE6C6zBv2Ui1vadqM LAroS/7iTRtog== Date: Thu, 25 Apr 2024 11:12:34 -0300 From: Arnaldo Carvalho de Melo To: Namhyung Kim Cc: Ian Rogers , Kan Liang , Jiri Olsa , Adrian Hunter , Peter Zijlstra , Ingo Molnar , LKML , linux-perf-users@vger.kernel.org Subject: Re: [PATCH 2/2] perf annotate: Update dso binary type when try build-id Message-ID: References: <20240425005157.1104789-1-namhyung@kernel.org> <20240425005157.1104789-2-namhyung@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240425005157.1104789-2-namhyung@kernel.org> On Wed, Apr 24, 2024 at 05:51:57PM -0700, Namhyung Kim wrote: > 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 > --- > 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); Fixed up to take into account a recent patch by Ian that turned that &dso->lock into dso__lock(dso): diff --git a/tools/perf/util/disasm.c b/tools/perf/util/disasm.c index 70650808e2e7bf88..2921b32357705a02 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(dso)); + } else if (dso->binary_type == DSO_BINARY_TYPE__NOT_FOUND) { + dso->binary_type = DSO_BINARY_TYPE__BUILD_ID_CACHE; } free(build_id_path);