Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp2001895pxm; Fri, 4 Mar 2022 07:37:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJzQDZa2K/rcZQERpXTuLanZaDuxVHP3USBQdE/mxpTP5spQROsxFdf8fUvm8VhojOlqgr25 X-Received: by 2002:a05:6402:4409:b0:412:aac5:4e48 with SMTP id y9-20020a056402440900b00412aac54e48mr39485021eda.75.1646408253761; Fri, 04 Mar 2022 07:37:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646408253; cv=none; d=google.com; s=arc-20160816; b=Cexn82eFOtz8gO2d3nBk4qNJLBmEhagqUUbiwRj1gi2CaKObVAxrklwEDNApKK2KoY n/LKIgmiEpdLrb4zIT1lXQnV78FsDTn4kBpsC2kldl1yXBnaldokVsKoQydU/rQ/hhQo uv+LMaQxMbMXtOY9ExGwiRxj66yi7HSpChQHcMMteqGl7xvrwCHMuG2hdE84pHwkr8vR qymRqiOagdRx5dYZacdI/fKfuDDJNOtwjSbXxcxckbrCMAHlSPTc7BhAcYuXrsY1fqY4 SC5mrsNpkkoHlBGcF5m69l6ghIOIr5kxctp9FkrOtJN202IFn1CXO7ukgftFHHNJd+BE GFyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=3L5g0eWsM2mBd9sAZegVyPtLbYiuaeHK/drolAWgFaY=; b=VZdEZc0OsT0vm+s9dl/sjzA90dJ495+XSLZ+KiRO+TPIKsMHq+MN3Wl10xpF8rGNqw 5v503wSBRhDui2K6h0XicwbpbbODrbUHErCRR7cR1FFWMRIybKOZbhCaOvZqF/KNeVlO M0LJsDT+1mQXcJye//uGikt7bTOUsX4JcCbDFnV2AB7ze5UkDN0WzbX49zas19FwErjg lLTnL3PezzCL+QguOGJ8SISTSHdujgw3qNGlRLmlRDLIENBAOlKUAf84Nw3N+CRSzu6/ tM2yV+g+c5vB/RIT7gL/2GZP/OSa9XQZKvPKNFvMXFMU+FlUgvMsWS/3XVhDOQOtbtq/ zsiA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id el8-20020a170907284800b006ae709825c7si3006962ejc.41.2022.03.04.07.37.10; Fri, 04 Mar 2022 07:37:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236579AbiCDJKz (ORCPT + 99 others); Fri, 4 Mar 2022 04:10:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44836 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236595AbiCDJKw (ORCPT ); Fri, 4 Mar 2022 04:10:52 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 7261C151C78; Fri, 4 Mar 2022 01:10:03 -0800 (PST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id EC3CF1424; Fri, 4 Mar 2022 01:10:02 -0800 (PST) Received: from e121896.arm.com (unknown [10.57.42.166]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 4F57E3F73D; Fri, 4 Mar 2022 01:10:01 -0800 (PST) From: James Clark To: acme@kernel.org, linux-perf-users@vger.kernel.org, coresight@lists.linaro.org, olsajiri@gmail.com Cc: James Clark , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , linux-kernel@vger.kernel.org Subject: [PATCH v2 0/1] perf: Set build-id using build-id header on new mmap records Date: Fri, 4 Mar 2022 09:09:55 +0000 Message-Id: <20220304090956.2048712-1-james.clark@arm.com> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Changes since v1: * Add read lock around dso find * Bracket style fix Hi, We are seeing an issue with doing Coresight decode off target where initially the correct dso from ~/.debug is used, but after a new thread in the perf.data file is passed with its mmap record, the local version of the dso is picked up instead. This happens if the binary exists in the same path on both devices, for example /bin/ls. Initially when parsing the build-ids in the header, the dso for /bin/ls will be created, and the file will correctly point to ~/.debug/bin/ls/2f15ad836be3339dec0e2e6a3c637e08e48aacbd/elf, but for any new threads or mmaps that are also for /bin/ls, they will not have a build-id set so they point to /bin/ls on the local machine rather than the debug folder. To fix this I made it possible to look up which existing dsos have build id's set that originate from the header and then copy that build-id onto the new dso if the name matches. Another way to do it would be to stop comparing the mmap id so it matches on filename only, but I think we do want to differentiate between different mmaps, even if they have the same name, which is how it works in this version. Applies to perf/core 56dce8681 James Clark (1): perf: Set build-id using build-id header on new mmap records tools/perf/util/dso.h | 1 + tools/perf/util/header.c | 1 + tools/perf/util/map.c | 20 +++++++++++++++++--- 3 files changed, 19 insertions(+), 3 deletions(-) -- 2.28.0