All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Yanbo Zhao" <yzhao62@ncsu.edu>
Cc: linux-perf-users@vger.kernel.org
Subject: Re: [PATCH v3 2/3] perf dwarf-aux: Add C++ vtable helpers
Date: Mon, 05 Oct 2026 20:17:27 +0000	[thread overview]
Message-ID: <20261005201727.F34551F00898@smtp.kernel.org> (raw)
In-Reply-To: <20261005201010.36493-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. It looks great!

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261005201010.36493-1-yzhao62@ncsu.edu?part=2


  reply	other threads:[~2026-10-05 20:17 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-05 20:10 [PATCH v3 0/3] perf annotate: Data type profiling support for C++ classes and virtual calls Yanbo Zhao
2026-10-05 20:10 ` [PATCH v3 1/3] perf dwarf-aux: Add die_is_compound_type() to handle C++ class types Yanbo Zhao
2026-10-05 20:16   ` sashiko-bot
2026-10-05 20:10 ` [PATCH v3 2/3] perf dwarf-aux: Add C++ vtable helpers Yanbo Zhao
2026-10-05 20:17   ` sashiko-bot [this message]
2026-10-05 20:10 ` [PATCH v3 3/3] perf annotate: Resolve C++ virtual function calls in x86 insn tracking Yanbo Zhao
2026-10-05 20:18   ` sashiko-bot
2026-10-07 16:02 ` [PATCH v3 0/3] perf annotate: Data type profiling support for C++ classes and virtual calls Namhyung Kim
2026-10-07 16:13   ` Yanbo Zhao

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=20261005201727.F34551F00898@smtp.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.