[PATCH v1 0/6] perf tools: Some improvements on data type profiler

From: Zecheng Li
Date: Fri Jul 25 2025 - 16:28:48 EST


Hi all,

I've identified several missing data type annotations within the perf
tools when annotating the Linux kernel. This patch series improves the
coverage and correctness of data type annotations.

Here's a breakdown of the changes:

Patches 1 and 2 fixes direct type matching from DWARF. They fix cases
with intrusive linked lists (e.g, sched_balance_update_blocked_averages)
where type information was previously missed.

Patch 3 utilizes this to better determine the types of stack
variables for instruction tracking.

Patch 4 skips annotations for lea instructions, as these do not involve
memory access.

Patches 5 and 6 implement a basic idea for register offset tracking
based on arithmetic operations. While this feature has known limitations
and may regress in rare cases compared to the original, it generally
improves offset tracking in most scenarios.

Note: I will be communicating from a new email address, zli94@xxxxxxxx,
as I will soon lose access to my current email account.

Thanks,
Zecheng

Zecheng Li (6):
perf dwarf-aux: Use signed comparison in match_var_offset
perf dwarf-aux: More accurate variable type match for breg
perf dwarf-aux: Better type matching for stack variables
perf annotate: Skip annotating data types to lea instructions
perf dwarf-aux: Find pointer type to a type
perf annotate: Track arithmetic instructions on pointers

tools/perf/arch/x86/annotate/instructions.c | 109 ++++++++++++++++-
tools/perf/util/annotate-data.c | 14 ++-
tools/perf/util/annotate-data.h | 6 +
tools/perf/util/annotate.c | 5 +
tools/perf/util/dwarf-aux.c | 125 ++++++++++++++++++--
tools/perf/util/dwarf-aux.h | 4 +
6 files changed, 247 insertions(+), 16 deletions(-)

--
2.50.1.470.g6ba607880d-goog