Re: [PATCH v1] perf test type profiling: Remote typedef on struct
From: Dmitry Dolgov
Date: Tue Apr 14 2026 - 12:09:31 EST
> On Tue, Apr 14, 2026 at 03:42:19PM +0100, Gary Guo wrote:
> > Indeed, I didn't finish the analysis, fooled that the diff was solving
> > the issue. Adding DW_TAG_typedef into __die_get_real_type still fixes
> > the problem, but due to different reasons:
> >
> > * check_variable calls __die_get_real_type directly at the beginning and
> > stores the result in type_die, which is the result of the function.
> >
> > * if it doesn't resolve DW_TAG_typedef, the flow goes into the
> > die_get_real_type, which stores the result in the local variable
> > sized_type. But it never copied into the type_die, and never returned
> > as a result of the check_variable.
> >
> > Hence we either need to add DW_TAG_typedef into __die_get_real_type, or
> > copy sized_type into type_die. After some testing both seems to be
> > achieving the goal.
>
> Why is the code in `check_variable` resolving typedefs itself instead of using
> `die_get_real_type` instead?
Looks like it was done in 90d78e7b8e5 ("perf annotate-data: Show typedef
names properly") for the purposes of resolving structs without a name
slightly better.