Received: by 2002:a89:48b:0:b0:1f5:f2ab:c469 with SMTP id a11csp1168339lqd; Thu, 25 Apr 2024 07:50:29 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUbPRpT4yCDX6g+zbZxzmp6AF+GrJuNB78fJ+5s8ruhl90OvdFyjWn7/TvvGWwIQ5xJKVtx8amF+l/b1QcUW0oEpq1GDeXoKSEFol78Kw== X-Google-Smtp-Source: AGHT+IGpfxjzdHj1zw7d6V4TT+q/gkTJgFuXJv/WQCg6K3+TdEqqCoM78Gu1q96lEwd07u6UoC+G X-Received: by 2002:a17:906:f58c:b0:a58:c0c7:d7cb with SMTP id cm12-20020a170906f58c00b00a58c0c7d7cbmr760223ejd.45.1714056629746; Thu, 25 Apr 2024 07:50:29 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714056629; cv=pass; d=google.com; s=arc-20160816; b=F1P5I9RV3ukwFNfbYzYo6+tCTH+mflgncycR9JRaZPdFfZMsLRT+AqIl/N1EyeuvId 7M1v38pI4H2p8FP+wFUwqA1dfNIKyZQBHnAI5NLTWS3sFsB7XnEjqPDsYklHXlh5QKZG kGkF7J9VW80yHqRsGMxflD+TBV3an+UuuedMtwaFMVqZB+kF0nDBGq+xZtAhmznDkIo1 oNxgso4DLW3n74b1F5Xr7zg5YYCWYmUOEwI7B0meKsvfuBF0pLdNzCeGJ6S5ju2+mLzr dPyn8WCSJfkhbJ/X0IR6lHTjcWhKS/Zq7qkSG1S5pTYwXL5R5pUZi6KoKAPpLc3kN/Bu kx+g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=J2s/tnVUk7RhbjTUQ58lGklT1XmTBfjSiMBuxZZqOek=; fh=eTZXs+iq20n9Wi1ZIx2/Oeelh29Ok9V8Mt7nCYSbIts=; b=nAnIVHRAsyjiUF5tVS5uNC9G2/MNEl5rjlBLy0ma1L+rgeJpPRQtlhWT68ROOuEvLY WLGjLff5uQH0QaNFqaKaYG0ah/gU26olanXx6IlcLIJ3aefL1rpBEWQLxBetMspOb9Fb XOCrSFgsI+cxOGBJsiHKvS7pAZIntg549IXce54dDTMWNT5tz4FBwCW/bxTERGUXYZ5B tSHFuYlXxd5AWkfLsTnfehcPNSsf2JFdMCm466g0mrGibSrIyubDcx4z8VYo0pGlEbto TNJEEXyG5SlPEN3GBC4XaBWCtR6XVJn7CFfLQHs4eYR3Ge8yzyhsi+p3YFcOUcytcATj Uigg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=SKQ3HHDh; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-158741-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-158741-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id f17-20020a17090624d100b00a5251002ff5si10117793ejb.771.2024.04.25.07.50.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Apr 2024 07:50:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-158741-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=@google.com header.s=20230601 header.b=SKQ3HHDh; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-158741-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-158741-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com 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 77EB11F2153B for ; Thu, 25 Apr 2024 14:50:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 330C014A4F3; Thu, 25 Apr 2024 14:50:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="SKQ3HHDh" Received: from mail-il1-f179.google.com (mail-il1-f179.google.com [209.85.166.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0B67F14A4E0 for ; Thu, 25 Apr 2024 14:50:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.179 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714056620; cv=none; b=GSS0IDjmeVxvHUnoKbyx3rJ+SOL+Vq93ZM4lCt/kCc2Xm2U4lcEpVfcnQvRAuS31zD9tAvO56LmowcNzdusGxSBZOJwwCEG56R65kv0B2AtYDwX1Mm4VW0L87/URfFS2eZedT2gZfkXz5zxQ7H61Yfl1FlVabBqGF9OM/5pvdqc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714056620; c=relaxed/simple; bh=Ycf9a2j2RJtUdhdofXQYYbRhrCc3ymXuWyYAmriuaf4=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=lmPMKUAEyx4f4/rD221n5U6LQLR/SV3ABjpv2cjVYUGtUxkA6sKfkmJPptzUagV1VTcM9DwsfDwhqgI7qXWpiYs86XMpgt0XOnCPQuI/kdxA6iJkZU58GCDgrv4tq7yHvm8UrcmzUbgXQpy6pj7n1r98pgBidertW4hiNlA5xvE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=SKQ3HHDh; arc=none smtp.client-ip=209.85.166.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Received: by mail-il1-f179.google.com with SMTP id e9e14a558f8ab-36b3738f01cso133995ab.0 for ; Thu, 25 Apr 2024 07:50:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1714056618; x=1714661418; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=J2s/tnVUk7RhbjTUQ58lGklT1XmTBfjSiMBuxZZqOek=; b=SKQ3HHDhXgXx/cOsc8X5IV9OnKEaftdAsl2Em2tjq7lRhM75s7DGK4vT2MmVlUPXzq y1+sif2QKUTZWRor9CN8N0rTyki9XuJSVa//5zvEWSVE/gnfP/KQRFIyt6isM6+h5P0V 6KzJDw9LkXLhApS/yyqR1MYXJIobbOiNBnOcgVwhqd/yuyA8njieP1cgWs0J3C9ysO79 jLffgQvhA4elpWZpfTn7c+E24aKndshHHzcL565QAez6Du/qhfzNjnF1w/ZtSas1Y/yh 7C+jEy+3e9bsXnbDBMXaaeKv0nHVIAiFVAKVsj6GNQz9DIYd1XSabl7kzkG5tyKHrrSg ccsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714056618; x=1714661418; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=J2s/tnVUk7RhbjTUQ58lGklT1XmTBfjSiMBuxZZqOek=; b=dbR1b9ID1tYmPZJkUzeK6WoUZYB3bJu+A6aUED6HrZn12hcSlP1eqfwfF+SB5L5Mv7 rOu+Xump52PmBvJMhvG7PFqBjWPC3WdoqOzC6ECk636oHhPT0xXxZYRDV+T8QMC4QwbI +/zd2GO2GYn0YYKsS3XnD9X+hdSG6R+q+TRRuBS5U5Q/PdP3J9o0x9WKKe+VxTpZUHep VUqwXjz/+aprYpxsippF3TYaNSXbETnp0mleZAnz4Y8cf32q0B6L3Lp1GGR7y9NuHUAT X6milrApw3+fqj4beHqz1au0gJvUSRDTuYW/sILRu/YykYdKeaHPT5l+ixzJr05nqqAe cURg== X-Forwarded-Encrypted: i=1; AJvYcCViZjTNM8McZ3Rji0KKdxxeE6QX89xHlbO/0zzfogkDeDeu0qRVbsqbBaArwybHFEmN4yIILUqOnpDmx9rdhOuGVohH9yUvnalhtWYB X-Gm-Message-State: AOJu0YwWL/jLQu6pbxJ/0I87aDX6qlKfkVrKWiyIk5/tGrOV28pEViN2 VwHXHo1Bjmc0Izqgzsv6D8JkzncpDSi8RHHJvDWZJofyxjX/r5qZzMpMOkdvfEsYINZlEVmq7w3 /OR43PP5UFki2fFRbop1sRu9+/6PHye/T4djb X-Received: by 2002:a92:da4a:0:b0:36b:f9c1:7ae3 with SMTP id p10-20020a92da4a000000b0036bf9c17ae3mr188764ilq.19.1714056617895; Thu, 25 Apr 2024 07:50:17 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240425005157.1104789-1-namhyung@kernel.org> <20240425005157.1104789-2-namhyung@kernel.org> In-Reply-To: From: Ian Rogers Date: Thu, 25 Apr 2024 07:50:03 -0700 Message-ID: Subject: Re: [PATCH 2/2] perf annotate: Update dso binary type when try build-id To: Arnaldo Carvalho de Melo Cc: Namhyung Kim , Kan Liang , Jiri Olsa , Adrian Hunter , Peter Zijlstra , Ingo Molnar , LKML , linux-perf-users@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Apr 25, 2024 at 7:12=E2=80=AFAM Arnaldo Carvalho de Melo wrote: > > 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 som= e > > special files only - like kernel (kallsyms or kcore) or BPF images. An= d > > 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 =3D=3D DSO_BINARY_TYPE__NOT_FOUND) { > > + dso->binary_type =3D 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 *ds= o, char *filename, size_t fil > } > } > mutex_unlock(dso__lock(dso)); > + } else if (dso->binary_type =3D=3D DSO_BINARY_TYPE__NOT_FOUND) { With reference count checking on dsos, this will need to be: dso__binary_type(dso) too. Thanks, Ian > + dso->binary_type =3D DSO_BINARY_TYPE__BUILD_ID_CACHE; > } > > free(build_id_path);