From nobody Tue Feb 10 01:15:57 2026 Received: from mail-yx1-f52.google.com (mail-yx1-f52.google.com [74.125.224.52]) (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 AFF972D46BD for ; Tue, 27 Jan 2026 02:06:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.224.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769479604; cv=none; b=Xo6BLNzl+cyPsfiU7NGj7a+M2/EVdG7snO8HXvB0d5410zdnHkbo4/uxwETmvtwKN+5HIpA4MSkgeEuQuIC21FD4eqyQSpFBe2MewpQyfBQXB5Wokh79IJcnj2I+mhaOH1pv4tv3MVslOcR6VYpw94BGnl8ijTdDl27bnJKlQ/8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769479604; c=relaxed/simple; bh=/ewm3WATBiT0DnxOwn8y9wg14IR21nssXLkB3T2qWfM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=uGUzm3Uk6FY13O40T1DWiJwIdoKa8aScklAJoclZ+rgVo1L6Pt4lVuoGUBJDlqixm1FPw5g/MfFqgIK0yPWp35MWMvrcsGNvLLtwJF0QYdtYN6J+lTt/VelvkxFzWYAPPwLEVoyK1s1G6TDVPireRfBRIhF/Ywiwsw4C/UiTNPc= 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=Co/0hxmy; arc=none smtp.client-ip=74.125.224.52 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="Co/0hxmy" Received: by mail-yx1-f52.google.com with SMTP id 956f58d0204a3-6494a3d92f5so5511333d50.2 for ; Mon, 26 Jan 2026 18:06:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ncsu.edu; s=google; t=1769479601; x=1770084401; 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=RUTDEas+pFI9zxM7B/p19P+ipqufAuvebaix0EtFBQY=; b=Co/0hxmyI3nuwg11HZBvmBXiAVQYX35HSgWpBEIcPcmWFd8ljQ6ylnQY0Mx4DzxOeI DV0T53ZinfTM2FUnJs6l5FJl9SR1ASzrqmIi1WwNOo5YDqvBkqMhL3K3pbmyOogP2ETn 1Sx895o693ic1fyUV7X9L8xTqGxxCqicGtoTlVsp7mlcFg5aCR+STHNtf/3vfulozxw9 neiL2mPjMoS9QoXihdKSHUGBlBm7RGhKX/6jdmbKJf8IHvaqHL5JKtocTNNX94d9gNmr g/tl8Evyr0ingYEifNZU894ex6ZIeqa5IeoLKx3DrGKSSAtuBQwgWvFSFkucJDP6pSkQ v99Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769479601; x=1770084401; 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=RUTDEas+pFI9zxM7B/p19P+ipqufAuvebaix0EtFBQY=; b=N0Q2Zve5pacuJSJgPG31bQP5MWc7MebkrBwY3CzaLHJPSgYL6WTS6iq67bPFUzartG mv+4QZZzKdNKQnqkQrjaUmXvEmTm1+h4Xa/Foht3rZXuMzwkCPK6zhn3fwoHLk7LJl2m MbvdrIj6Oc7T06qQOJi8HkALT7N0E0h3cDyQ2f/higD65qOszRHND9UT0zIDn2Z4SMuU wnb7VFSwAhw0RiiFYVus9re3AxFcH6gnYePmhJQCrLJpy26EVbOVZqo49zwr2x1uKJ2J k5ctVLiyHDkKcOODovYu3r6GtM/+ULHYI9ZaMrFG4hP7UA06q5KNZ3YijyN+X+MXMSDh rCcA== X-Forwarded-Encrypted: i=1; AJvYcCUYO+5s3v5tFhYI2EZgo1020li1Ft1aWOvol5HiDOd/zrxNPaRHpEjrXZfzfhn48yATM+3a+gPFrAyLa3E=@vger.kernel.org X-Gm-Message-State: AOJu0Yz2KQQPB7bFuhMk0+sa2bS1n36mqZUvvaSbQADhg6kgtlpBsThb bG4ZeLFxoXg6WfVms07E31KUOVy6Ja4mSzb3rQU4t9NiQJpGkatjBHd/O6UHbJGf6A== X-Gm-Gg: AZuq6aLFlFkP9KZWb2v2elm+OC/qwZELfLeMHv6B1S3nrFjvsTf59+sREVy1NMEzqJ/ q+9yeZGDkGVjjlnGYdjSph9EtQT07cBN46HRufIOhhCoxQvuiIAbcbTj/tjTWkyeCPC7nYOJys/ XPXr8h9nDTkzHXx5WXgzo/YTAu7ndCqzqdiQ1TA/pHblwqxcabQ3sjW4G+sr2/zK1ge4CS2+uW5 5+AYe2xlNv0TXXAbETS+wFO1TXydhS3dAlFprd1Ki4nwfiJCJtFQzicXGMnsF7IydEKC6/jUuoW VhRGsceB+eu5Piyx02egMffDQzqWqX/6ToWPKTAo/noLFAEuD6ajOADdMO/j3DAGWWDgwx9qs4i e325QToLV1d1BgIUIkSTSuGeA16QFScHZOOr7w5MQ1WeI6Wnmi1YKbkidccdYkbVRx0FZ1nxqgh MOejpU0Bgrxg== X-Received: by 2002:a05:690e:4088:b0:63f:9c70:84ed with SMTP id 956f58d0204a3-6498fc46089mr694d50.58.1769479601298; Mon, 26 Jan 2026 18:06:41 -0800 (PST) Received: from um773-cachyos ([2600:1700:cc0:94af:eca6:9ff9:6f3c:5de9]) by smtp.gmail.com with ESMTPSA id 956f58d0204a3-6496855d65esm4217415d50.12.2026.01.26.18.06.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Jan 2026 18:06:40 -0800 (PST) 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 v1 07/11] perf annotate-data: Handle global variable access with const register Date: Mon, 26 Jan 2026 21:05:00 -0500 Message-ID: <20260127020617.2804780-8-zli94@ncsu.edu> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260127020617.2804780-1-zli94@ncsu.edu> References: <20260127020617.2804780-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" When a register holds a constant value (TSR_KIND_CONST) and is used with a negative offset, treat it as a potential global variable access instead of falling through to CFA (frame) handling. This fixes cases like array indexing with computed offsets: movzbl -0x7d72725a(%rax), %eax # array[%rax] Where %rax contains a computed index and the negative offset points to a global array. Previously this fell through to the CFA path which doesn't handle global variables, resulting in "no type information". The fix redirects such accesses to check_kernel which calls get_global_var_type() to resolve the type from the global variable cache. We could also treat registers with integer types to the global variable path, but this requires more changes. Signed-off-by: Zecheng Li --- tools/perf/util/annotate-data.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/perf/util/annotate-data.c b/tools/perf/util/annotate-dat= a.c index 970238bc81b7..177aa6634504 100644 --- a/tools/perf/util/annotate-data.c +++ b/tools/perf/util/annotate-data.c @@ -1230,6 +1230,10 @@ static enum type_match_result check_matching_type(st= ruct type_state *state, return PERF_TMR_BAIL_OUT; } =20 + if (state->regs[reg].kind =3D=3D TSR_KIND_CONST) { + if (dloc->op->offset < 0 && reg !=3D state->stack_reg && reg !=3D dloc->= fbreg) + goto check_kernel; + } check_non_register: if (reg =3D=3D dloc->fbreg || reg =3D=3D state->stack_reg) { struct type_state_stack *stack; --=20 2.52.0