From nobody Sun Apr 5 16:31:35 2026 Received: from mail-yx1-f47.google.com (mail-yx1-f47.google.com [74.125.224.47]) (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 1EFBB3D410A for ; Mon, 9 Mar 2026 17:55:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.224.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773078962; cv=none; b=bFFUb3eFX/p27g7EKJMaADqu7ZAgwQZVCF6UnHiHEPj+qbntBbPaKzoKuKteiZg5ulxE1rBUJiHs6cZYPh34r12Dm8itCM263ccLEn6O0CpSoKsC4sPDTELDpNw60adt3OiTCDDBGl6Xf+t287wARoHwZsAy2SuWmizr5kuzchA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773078962; c=relaxed/simple; bh=pvxNnOKqeHa3u9P/BSdLX/F7/QbZo7WG8Lg+nWmEajQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=kh09Ary7shBkvllenAHLR4Sa+vqcJft4btjYv4/XssKeOamgdEd4XuAmkil6mZSe2apTnj0Hz0R/eHpNGIokouYZfLk/967lknzTeEgfTsVuDENZIGSYlrBROAahw5BdT5f3al04onoVWsf82RZEsw+J+tW7g3Kuhi6bJ1UV5yg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ncsu.edu; spf=pass smtp.mailfrom=ncsu.edu; dkim=pass (2048-bit key) header.d=ncsu.edu header.i=@ncsu.edu header.b=RczIOqwJ; arc=none smtp.client-ip=74.125.224.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ncsu.edu Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ncsu.edu Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ncsu.edu header.i=@ncsu.edu header.b="RczIOqwJ" Received: by mail-yx1-f47.google.com with SMTP id 956f58d0204a3-64c9a398bc7so10846678d50.2 for ; Mon, 09 Mar 2026 10:55:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ncsu.edu; s=google; t=1773078958; x=1773683758; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=KPYwqT1EEY7+NbPzds3BGnxWg5Bdt7m7QdEJl4nIWoA=; b=RczIOqwJ6ihTF8Imcou4a3eoOb2tlIuHjkjVLFXlQtfOqiM/rW0rDf4HLuikNpRVie Grrj7k7I/HvE7AJT5PGWi00bO86EVmqq0AAi/ehrWtp5/xMNg8jxyVjJteW4mnXfA2Fq SF3TaYbzETE0cqXsl56gpWHlOQiBM4NxMOsxDVHEYUhAOi4tU6O2jn/E21VnLfXPnyYq Zc5F2lXh/2dkE9tQRJRIogf655RTL9ZVUOsXpH055SMfRc5dXRXLTNmGy9AJ8n3GXvCp yk7a96Xq6fli1dlUelITRTTOX6iDWyd2Z73JNM5xAuhZtkAx4MxSH4lyEzcD2i5WF681 QLOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1773078958; x=1773683758; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=KPYwqT1EEY7+NbPzds3BGnxWg5Bdt7m7QdEJl4nIWoA=; b=F5WN60Rgt685OaqI47/QAf4py20VdmU+VessEtgb2/ERz1YR7b2xs6dsk3/gwZ5o08 8sJ6ZUaE98yA0SbowbcLuVk2bMHhJCwG2YQXwEabcYOIPbApUkEisdM5ILyXJZPUy8tK yoMqiloFO5IQNH917ED6z/+LSeG3A9WCucf+7aFXmx1tjv4Vx8Olj86OyTa5eg3AjI+a jDCr+qurUresbgoY2DWXh5q+BKaCX/Nmn32EVdOuehtOSwz8KFnSQ31GNgT37mCk1ozv 9Et0HHiKQQfcfjU1yCYHzB/KXFW0Xf8OYzdDlwsXjIHVruECpsQf7VwPL6wrOOE8SPvd q1fA== X-Forwarded-Encrypted: i=1; AJvYcCVo4ly9weqjs2g6Mg6KXloRKO3ylGVI2Ckm0p67zn8bKTXLI4xCyZ4zbUayGOJunuUsPMBdC91pFNIT9rQ=@vger.kernel.org X-Gm-Message-State: AOJu0YwpyC+iUxIxxrc61Mxz3iuEWH1X1X1xc5Q2arhGGI8ZHDBKu1Gf IltsdqgUi5QNDZm9f6kF1CjU9+IanZrX0gmdYXvbp8Pv8lUizvc3Er2zO8hmXq1oew== X-Gm-Gg: ATEYQzwTtbyDZf/Stgzs6ZAUBnIfoV9GPK4E9Wc6Jz5DFvXxyjr88p0QBSbIck6evTx VqyNDAuq8ZWd6b3pQg7B+v3InDqo4qdFvuK62zi7eV91/fHY11sGon0XugB6Zh0YWqDeOw1sWVH RMrcdE8lxjqbgTsLRhV8UqP0fULEpaw6qnjYXVgFtrOYXOOVTOYghdj6Wk25ZWgaP4/B2UQZ7o1 TxrqebyXb4YzBSi/Ao40ueB5kCAqS7sixI+ZjfKay0f1S2H7fdTCjJKHhPceV37gQr+SUyhBFf7 XwHWV3Y9XTnXK3A8bmb2892SraeGVtuwrEHxeVyOOAI27ItHDquyj3nlNWEOEFTtv9Eqws59NZH JAsjYsvG+7PqG7OZEEs9+DmyHQ5OClJz03aPRrwkZuEFGOFLqkTRyE/ld9mzUGL62IPhYNnCrNE UfyndHK4hI8LoMYbpw+Q79/KBNUxSuGql/RX6Rq1DDJ3s5Qr98CDu7anmk X-Received: by 2002:a05:690e:c44:b0:649:ca5c:5990 with SMTP id 956f58d0204a3-64d14316d3dmr11274047d50.66.1773078957901; Mon, 09 Mar 2026 10:55:57 -0700 (PDT) Received: from um773-cachyos.sd.ncsu.edu ([152.7.255.206]) by smtp.gmail.com with ESMTPSA id 956f58d0204a3-64d176e70e7sm4992535d50.20.2026.03.09.10.55.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Mar 2026 10:55:57 -0700 (PDT) From: Zecheng Li To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim Cc: Mark Rutland , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , James Clark , Zecheng Li , xliuprof@google.com, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 06/11] perf annotate-data: Collect global variables without name Date: Mon, 9 Mar 2026 13:55:19 -0400 Message-ID: <20260309175546.916039-7-zli94@ncsu.edu> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260309175546.916039-1-zli94@ncsu.edu> References: <20260309175546.916039-1-zli94@ncsu.edu> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Previously, global_var__collect() required get_global_var_info() to succeed (i.e., the variable must have a symbol name) before caching a global variable. This prevented variables that exist in DWARF but lack symbol table coverage from being cached. Remove the symbol table requirement since DW_OP_addr already provides the variable's address directly from DWARF. The symbol table lookup is now optional to obtain the variable name when available. Also remove the var_offset !=3D 0 check, which was intended to skip variables where the access address doesn't match the symbol start. The symbol table lookup is now optional and I found removing this check has no effect on the annotation results for both kernel and userspace programs. Test results show improved annotation coverage especially for userspace programs with RIP-relative addressing instructions. Signed-off-by: Zecheng Li --- tools/perf/util/annotate-data.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/tools/perf/util/annotate-data.c b/tools/perf/util/annotate-dat= a.c index 6fe2efd48a83..301f73ea8275 100644 --- a/tools/perf/util/annotate-data.c +++ b/tools/perf/util/annotate-data.c @@ -774,12 +774,7 @@ static void global_var__collect(struct data_loc_info *= dloc) if (!dwarf_offdie(dwarf, pos->die_off, &type_die)) continue; =20 - if (!get_global_var_info(dloc, pos->addr, &var_name, - &var_offset)) - continue; - - if (var_offset !=3D 0) - continue; + get_global_var_info(dloc, pos->addr, &var_name, &var_offset); =20 global_var__add(dloc, pos->addr, var_name, &type_die); } --=20 2.53.0