Received: by 2002:ab2:60d1:0:b0:1f7:5705:b850 with SMTP id i17csp1467349lqm; Thu, 2 May 2024 16:28:21 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWdtNTZLe9nlwaaQfZeHJbyZA2PzWq+bm8jAWLGkAHN9KQFc7sSHQ34MNkLrIu/boJla1Bpb/W+x35rDIo9+dYNOXPdApe0kSINDtrXLQ== X-Google-Smtp-Source: AGHT+IH6G3Uw9PwlawSAOGluDb+LuBuUwUB08Gyl5/HyyQdq4kf8QooV1WSGOMWwCmxyBcTpTbKM X-Received: by 2002:a17:906:d146:b0:a59:3331:1b with SMTP id br6-20020a170906d14600b00a593331001bmr614128ejb.0.1714692501065; Thu, 02 May 2024 16:28:21 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714692501; cv=pass; d=google.com; s=arc-20160816; b=U02ITk8Ffokn7i90oKAMGupJ7BrMHwRWYe0g1X81FNpCfmeWXzuCk15r68hS5Oehwq jn+sJSKCY8Hh6Va2JMSV94hb2oVigTtxT2oXJ9CECYhCcP42ZgCAZtDG18H3p2Fx6pOq fUZr4G6WO/tJQ4AFoTr8qwKbZahw1/41YkwvdbfyLAgKAJ2w1ZtA6w8Eu0iQWdP79CNK ACUnHqAUATcafjF93HKhzTlr72FfhTLxAVnVAgmUxQE+NKh6QFJ0H8T2WC0E7wxZzSf5 9+sspCTzlo2hlFT3DuloMxJ271YQ76jPDME06/UBW3aPfZN+IIeqRNHUsfitrPPf0vir vgaw== 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; bh=HPejxyFKU1Zh3kN9Scg088bpLLbAnsYPfIC5g4m7D1E=; fh=uS7pJDfKmQCwHGGK5W9QDym497GRFFaynZyTt8W2qCI=; b=gmps9XIThshNs9w7cYCZ9NU/U/86obBG45LksmYG3L2d/zAcTuYzMsWebgs40GzGYx RVIjGuYZGec5i2T4dKBqRlrYF7zkbcFzM/0BeC91XWyux+RbaC2UiYkNPzzuX8MNXk5o kAShB/yaZVxhqljxfGB9w3Yp0+XfLWcR30+46IQTSt+jkhPNMwQYtOGs0vNm+n65P80B UqqpvFyhXcsHthIfMC+LptyaLIaqjC/a1B+aM9q3FK1i5irx03l06vnarMj7zRWHCB+3 smfAKAWSGUhAAXO0qAb1m1jMal4jE5NjjzI7Y7yt2jVWwGuLCUgDfGP4ukhXXv2qFQzq zdIw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-167059-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-167059-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. [147.75.80.249]) by mx.google.com with ESMTPS id qa41-20020a17090786a900b00a5970bb3845si883161ejc.63.2024.05.02.16.28.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 May 2024 16:28:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-167059-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-167059-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-167059-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 C152B1F22E6C for ; Thu, 2 May 2024 23:28:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BA24920B20; Thu, 2 May 2024 23:28:13 +0000 (UTC) Received: from mail-pj1-f51.google.com (mail-pj1-f51.google.com [209.85.216.51]) (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 0C2CF1CAA1; Thu, 2 May 2024 23:28:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.51 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714692493; cv=none; b=OKqubrttKE6xz/TW5otNEwxuCZ0n6CAhJy8yYc5pUBwNDXwyVIJCymhXLryUmQYl3rMZvhKKOnuz1oyD0B+wd5fhi7MV5JMZ3oq+2hfmtybqYH07TRA/gBuA/2qog5C+68E4PAc2+zkutIiRmYjKOr8ArsLccyfqp9Ng6NTf2mQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714692493; c=relaxed/simple; bh=b6o52TjdzdCt4jSSKwghb4/NyW7Kt0gS4Op5y8cytcc=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=dugvBm9HegTD1eOr+2GcN3W4iU7YUZKWR+jPDZvqE7HHTNDHUX/45NwA7GtdtDevXSuLNYLVHe4Uh0/m4m8oi/nTtzLv3UdgWrLdl/3VGzUrCwao6fNrcwMazjLYeamPAPLAsDUbw4lj9ykIk/0pH3Kd8poMa3pxJl/0kcROdQg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org; spf=pass smtp.mailfrom=gmail.com; arc=none smtp.client-ip=209.85.216.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pj1-f51.google.com with SMTP id 98e67ed59e1d1-2b43490e0e2so147894a91.2; Thu, 02 May 2024 16:28:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714692491; x=1715297291; 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=HPejxyFKU1Zh3kN9Scg088bpLLbAnsYPfIC5g4m7D1E=; b=Ep11gXlMojryXhsHIteQC9ZFW8BgNCeZ+Q3LMydryKQkCx9jY5COasOp61q6weITpe yddrP0lSR4bDv5w64y4QUJNXtSiZ3Lb7FhMU1kmk5uLVBI6Vpuqqgiv24rHHt7k6sO6q WY2qOKgI2UbimkSLaQl/KEuB7sSWYFqgM/CBqds8P40Z0F4oYibM+tZtpuYn8Mlb2VZ0 3BV/cqXB53cdhMp7NKeakJkO3veBNY8Z5sclpmZEzi9oBccAVoha1QKjr2Ryu6sDyA9v EdfGxTtX/SmZUza4f+1eEyV6OgSO8jnpmqjngpRMAbzDZkIQImsPs2rvVycikWD1giuT J6vA== X-Forwarded-Encrypted: i=1; AJvYcCW0KZ+BXR2aCNI56gzaVAj2oNC8DHq6XMmZVq1sk6rTXUlTbDWtaCLnz5SPysgGZGvhBS1crR02/7QMEeg/8ZPc4XMZX0KF/7Six1IyfoGzK1JQUAdkWf7yql9dR/zwWkT5yYYJHsAIK+VNW15ifg== X-Gm-Message-State: AOJu0YyY44FIpUSgZs52LLci6awqp5cS6IisDMdAs4Nz7M2QHGR4GKyS fVK2lIHBwI6DWg1E8hzMs2JaDzN7PlWMPdy016hAOeWyGcdcVwkVGm62tOwOcQsPfjZI2ivDfw6 RNwDS0DQWhHL1VutHUk4LXx3GRW4= X-Received: by 2002:a17:90a:ea08:b0:2ae:7f27:82cd with SMTP id w8-20020a17090aea0800b002ae7f2782cdmr1274067pjy.7.1714692491345; Thu, 02 May 2024 16:28:11 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240502060011.1838090-1-namhyung@kernel.org> <20240502060011.1838090-3-namhyung@kernel.org> In-Reply-To: From: Namhyung Kim Date: Thu, 2 May 2024 16:28:00 -0700 Message-ID: Subject: Re: [PATCH 2/6] perf annotate-data: Collect global variables in advance To: Arnaldo Carvalho de Melo Cc: Ian Rogers , 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, May 2, 2024 at 11:23=E2=80=AFAM Namhyung Kim = wrote: > > On Thu, May 2, 2024 at 6:50=E2=80=AFAM Arnaldo Carvalho de Melo wrote: > > > > On Wed, May 01, 2024 at 11:00:07PM -0700, Namhyung Kim wrote: > > > Currently it looks up global variables from the current CU using addr= ess > > > and name. But it sometimes fails to find a variable as the variable = can > > > come from a different CU - but it's still strange it failed to find a > > > declaration for some reason. > > > > > > Anyway, it can collect all global variables from all CU once and then > > > lookup them later on. This slightly improves the success rate of my > > > test data set. > > > > It would be interesting you could provide examples from your test data > > set, i.e. after this patch these extra global variables were considered > > in the test results, with some tool output, etc. Here's the example: Before ----------------------------------------------------------- find data type for 0x6014(PC) at entry_SYSCALL_64+0x7 CU for arch/x86/entry/entry_64.S (die:0x85e1d) no variable found After ----------------------------------------------------------- find data type for 0x6014(PC) at entry_SYSCALL_64+0x7 CU for arch/x86/entry/entry_64.S (die:0x85e1d) found by addr=3D0x6014 type_offset=3D0x14 type=3D'struct tss_struct' size=3D0x5000 (die:0x74dbe1) It was asm code so it doesn't have the type info in the CU. With this change it can see the type (from a different CU). It seems we have a per-cpu variable called cpu_tss_rw at address 0x6000. $ nm vmlinux | grep 6000 | grep tss 0000000000006000 D cpu_tss_rw Thanks, Namhyung