Received: by 2002:a89:48b:0:b0:1f5:f2ab:c469 with SMTP id a11csp1190829lqd; Thu, 25 Apr 2024 08:19:27 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXd7hKniqhN9VBG7Jlih/paBvoTaMz3c9SiZzm6fEglv2LptHyor9BQxTiyZN2LkJq4VTg9YbMmtleE9GMtZEABX5A5MmZIfAoaDDFU/g== X-Google-Smtp-Source: AGHT+IFA3lMqWju3UsiI+KacYp/aMZNcDYHNB4OV0GfndpGus6FBjX0lJf7H3obvq4REHy9w1V4q X-Received: by 2002:a05:6a00:174a:b0:6ed:435f:ec9b with SMTP id j10-20020a056a00174a00b006ed435fec9bmr69036pfc.20.1714058367610; Thu, 25 Apr 2024 08:19:27 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714058367; cv=pass; d=google.com; s=arc-20160816; b=sL3KAumi0wxImGEWATMMQa09wXYWP/Q8kwBFURZwmS5+WF2CiKB9Zb1f8fCMvYjDmK FZU4yQjLhml82D/zKPciJOHgQXwObHeEvxlsFyotWlpFFXp0HJ3uQ8SfdtcW0cFa5GyJ SbWwuCeTrS6bIXov2/eCFJ01UPCuk9TtVM0k1oYDnRw9cXM4TfbhnU93NNj6flWHRpk+ RIRBao9ge5oECzaDo+86Ku49e1wbD1H34RxuB+Tv4WW3TXxO1DMXS3iR3cUT8LQO8thy W/eVyteV0r6qaeBozDwgX3zNVNxWlZoHDDn2279SxsuqY0nrFlZyygjVQSihR4PymrRs X8eQ== 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=1yp9nTi4dcobr7S9eImtRUf8sVSl8cqmW4qV5O4wFEU=; fh=49GrrO/H3LiGmymuFnNd59pBYHHWBS2xk/6Ejg0rn8E=; b=UzD2QoHmoRjU89wTxuqKnCB+O3wQSOMONau7Xxr6xMXS0RrI4dkG3NU+LyDUuxoddU c/CG8yJ+pFD6Yr0ISmZaj1Qc4guW8Rii2le2TQBbEPbkD4zFTzTHkN9ttzf/2GHCp7xh 4XuArSyce6ST6hSdFzXSfTZapMLYl0qum6lv+fVbgBUCpRFwWUjyNFJouJip633Sim2O rkWnzu2uz6/T+Dq+x3wEQ63gO58/egjFQlMxO8Oq8HkWzmyAKhMVuknAx08PbNDk+/V8 tJ8ll55BRqFtkoAP1CQ/p40QVLkGCm6aeC6YnaRrn/6cwRzo2X9tl6pPv3Y9/Kg9Q3T4 B1mg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=aM7BzCKf; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-158740-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-158740-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id n22-20020a62e516000000b006efe040c57csi13132144pff.169.2024.04.25.08.19.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Apr 2024 08:19:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-158740-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=aM7BzCKf; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-158740-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-158740-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id E7499B24A20 for ; Thu, 25 Apr 2024 14:49:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 49AAC14A4EF; Thu, 25 Apr 2024 14:49:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="aM7BzCKf" 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 6A2EF13328D; Thu, 25 Apr 2024 14:49:48 +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=1714056590; cv=none; b=usIfTDapLq9j4014L09GOBg61yY43B3r6uckZyKqU7tBuSqbfnDZL7G7ZZ38cHYONJ78T3Ukh404OdXJXNQOYl8JZWB0tA/DT69VAP9pZP8S2THHSv+geqwtJ8rSCzDsY5WeChZ3lzNLYCFXMnFKWp4vGbEzEDU36/Bf/5A1g5E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714056590; c=relaxed/simple; bh=S4j43sOmzi/yE2O9yobieBlpo8nx80XmbizZ0kSyVEE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=WJ21ZygnP8Bs1yhQ4XqhmWPNrf1/mK4mZEo1GJMDt0grl4yFK5h5m6DY3xahuqZroV6BHAyT1LP1mnYOSQtxZ/Lo/BjnjkV2ykGqFV6TS26olH4J44A6x8ak7Z0QlbsDXJEM2iIlh9TlBDcoag8cTbGdniQDO6hshq8RO/ZWU40= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=aM7BzCKf; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id D8239C113CC; Thu, 25 Apr 2024 14:49:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1714056588; bh=S4j43sOmzi/yE2O9yobieBlpo8nx80XmbizZ0kSyVEE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=aM7BzCKfjR0vLKsgJSg0svPXtMy3Pfdi7JVPuSeESlO7X1u8UvC85RMAv7isI2AVA kf8uJfqQqj9/SxbOiQQiMMv+kzrYz6OTSUlrQl3+UDrxYVu/gFnfKgV9dEEvV3fywK N94r9EaGHGz4P0e+kUQl8hu/CCeGOuuThK5NAOPjlG7W1jfnBUtWF3gpPc+36CuPhN mVFnSjDC3h22DAKsfv/Ao2u2GJDex4z2sPO+8qYJ3mnrYDFZQw23wKUn5gVuijPrhe ENEay6Pu3D6WiYLECqRGmb4Eqv/UddLFxBp534VWCxl/lOEU7A+RntxqwBd42haSHl V93Ses6xb9VCQ== Date: Thu, 25 Apr 2024 11:49:44 -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: On Thu, Apr 25, 2024 at 11:12:40AM -0300, Arnaldo Carvalho de Melo wrote: > On Wed, Apr 24, 2024 at 05:51:57PM -0700, Namhyung Kim wrote: > > +++ 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; > > } > Fixed up to take into account a recent patch by Ian that turned that > &dso->lock into dso__lock(dso): > +++ 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; > } Nah, I forgot some more stuff, this is what I have now: diff --git a/tools/perf/util/disasm.c b/tools/perf/util/disasm.c index 2921b32357705a02..72aec8f61b944a7a 100644 --- a/tools/perf/util/disasm.c +++ b/tools/perf/util/disasm.c @@ -1156,8 +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; + } else if (dso__binary_type(dso) == DSO_BINARY_TYPE__NOT_FOUND) { + dso__set_binary_type(dso, DSO_BINARY_TYPE__BUILD_ID_CACHE); } free(build_id_path);