From: sashiko-bot@kernel.org
To: "Yanbo Zhao" <yzhao62@ncsu.edu>
Cc: linux-perf-users@vger.kernel.org
Subject: Re: [PATCH v5 3/3] perf annotate: Resolve C++ virtual function calls in x86 insn tracking
Date: Thu, 05 Nov 2026 18:30:38 +0000 [thread overview]
Message-ID: <sashiko-outbox-199769@kernel.org> (raw)
In-Reply-To: <20261105181949.43198-4-yzhao62@ncsu.edu>
> A C++ virtual function call is an indirect call through the vtable.
> The instruction tracking of the data type profiling cannot resolve the
> callee name for it, so the return type is lost and the type of the
> register holding the returned value is unknown after the call. It
> matters when the returned value is used directly to access memory, like
> in 'p->next()->val', where no DWARF variable describes the temporary.
>
> The vtable pointer and the slot index are known statically from the
> type of the object pointer, so the callee can be found by DWARF. Track
> the two steps of a virtual call in update_insn_state_x86():
>
> 1. Loading the vtable pointer from the object. When a load from a
> register with a pointer type hits the '_vptr' member of the class
> (or one of its base classes), the destination register is marked as
> TSR_KIND_VTABLE_PTR with the class DIE returned by
> [ ... ]
> 1260: addq $1, %rbx
> 1264: callq *%rax
> 1266: addq 8(%rax), %r12 # data-type: struct Node +0x8 (val)
>
> 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=3
next prev parent reply other threads:[~2026-11-05 18:30 UTC|newest]
Thread overview: 9+ 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
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 [this message]
2026-11-06 21:32 ` [PATCH v5 0/3] perf annotate: Data type profiling support for C++ classes and virtual calls Namhyung Kim
2026-11-07 4:38 ` 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=sashiko-outbox-199769@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.