From: sashiko-bot@kernel.org
To: "Yanbo Zhao" <yzhao62@ncsu.edu>
Cc: linux-perf-users@vger.kernel.org
Subject: Re: [PATCH v5 2/3] perf dwarf-aux: Add C++ vtable helpers
Date: Thu, 05 Nov 2026 18:33:04 +0000 [thread overview]
Message-ID: <sashiko-outbox-199775@kernel.org> (raw)
In-Reply-To: <20261105181949.43198-3-yzhao62@ncsu.edu>
> Add DWARF helper functions needed to resolve C++ virtual function calls
> statically in the data type profiling:
>
> - die_get_vtable_index() returns the vtable slot index of a virtual
> function DIE from DW_AT_vtable_elem_location. DWARF defines the
> attribute as a location description of the slot but GCC and Clang
> both emit the slot index as a single DW_OP_constu, which is also how
> debuggers interpret it.
>
> - die_find_virtual_func() finds the virtual function DIE at a given
> vtable slot index of a class. The (primary) vtable of a class starts
> with the vtable of its primary base class, i.e. the first non-virtual
> base class at offset 0 which has a vtable, and the slots for virtual
> functions introduced by the class come after that. So it looks at
> the class first and then follows the primary base class chain.
> [ ... ]
> finds Base::set() through the primary base. The vtable pointer at
> offset 16 belongs to the Other subobject, so it's looked up with Other
> where slot 0 finds Other::hi().
>
> Signed-off-by: Yanbo Zhao <yzhao62@ncsu.edu>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261105181949.43198-1-yzhao62@ncsu.edu?part=2
next prev parent reply other threads:[~2026-11-05 18:33 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-05 18:19 [PATCH v5 0/3] perf annotate: Data type profiling support for C++ classes and virtual calls Yanbo Zhao
2026-11-05 18:19 ` [PATCH v5 1/3] perf dwarf-aux: Add die_is_compound_type() to handle C++ class types Yanbo Zhao
2026-11-05 18:31 ` sashiko-bot
2026-11-05 18:19 ` [PATCH v5 2/3] perf dwarf-aux: Add C++ vtable helpers Yanbo Zhao
2026-11-05 18:33 ` sashiko-bot [this message]
2026-11-05 18:19 ` [PATCH v5 3/3] perf annotate: Resolve C++ virtual function calls in x86 insn tracking Yanbo Zhao
2026-11-05 18:30 ` sashiko-bot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=sashiko-outbox-199775@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=yzhao62@ncsu.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox