Skip to content

xdp: skip run-lifecycle hooks for XDP-internal runs#78

Merged
jvillarre merged 1 commit into
Xilinx:masterfrom
jyothees99:xdp-skip-internal-runs
Jun 1, 2026
Merged

xdp: skip run-lifecycle hooks for XDP-internal runs#78
jvillarre merged 1 commit into
Xilinx:masterfrom
jyothees99:xdp-skip-internal-runs

Conversation

@jyothees99
Copy link
Copy Markdown
Collaborator

Runs created by XDP plugins themselves (e.g. xrt::ext::kernel "XDP_KERNEL:{IPUV1CNN}") must not re-enter the XDP run-lifecycle hooks. Enforce this once in the shared XDPPlugin base class so every present and future plugin inherits the skip automatically with no per-plugin code.

  • Add public non-virtual XDPPlugin::run{Constructor,Start,Wait}Hook wrappers and protected virtual run*Impl methods (default no-ops). The wrappers prefix-match the kernel name against "XDP_KERNEL" and return on match; otherwise delegate to the *Impl. Plugin _cb.cpp glue continues to call the *Hook wrappers; plugins override the *Impl methods. The wrappers are non-virtual so derived plugins cannot accidentally bypass the filter.
  • Single source of truth: the "XDP_KERNEL" prefix constant and the helper live file-local in vp_base_plugin.cpp. The helper is also exposed as xdp::isXdpInternalKernel via vp_base/utility.h for any non-hook XDP code path that needs the same check.
  • Convert AieDtracePlugin (the only current consumer): rename runConstructorHook/Start/Wait to runConstructorImpl/StartImpl/ WaitImpl as protected overrides; bodies unchanged. aie_dtrace_cb.cpp is unchanged - aieDtracePluginInstance.runConstructorHook(...) now resolves to the new base-class filtered wrapper and dispatches through the virtual *Impl override.
  • core/common/xdp/profile.cpp and profile.h are NOT modified. The no-plugin overhead is unchanged - the existing xrt_core::config::get_aie_dtrace() (and friends) config gate in profile.cpp's dispatchers remains the first and only check on the no-plugin path.

Runs created by XDP plugins themselves (e.g. xrt::ext::kernel
"XDP_KERNEL:{IPUV1CNN}") must not re-enter the XDP run-lifecycle
hooks. Enforce this once in the shared XDPPlugin base class so every
present and future plugin inherits the skip automatically with no
per-plugin code.

* Add public non-virtual XDPPlugin::run{Constructor,Start,Wait}Hook
  wrappers and protected virtual run*Impl methods (default no-ops).
  The wrappers prefix-match the kernel name against "XDP_KERNEL" and
  return on match; otherwise delegate to the *Impl. Plugin _cb.cpp
  glue continues to call the *Hook wrappers; plugins override the
  *Impl methods. The wrappers are non-virtual so derived plugins
  cannot accidentally bypass the filter.
* Single source of truth: the "XDP_KERNEL" prefix constant and the
  helper live file-local in vp_base_plugin.cpp. The helper is also
  exposed as xdp::isXdpInternalKernel via vp_base/utility.h for any
  non-hook XDP code path that needs the same check.
* Convert AieDtracePlugin (the only current consumer): rename
  runConstructorHook/Start/Wait to runConstructorImpl/StartImpl/
  WaitImpl as protected overrides; bodies unchanged. aie_dtrace_cb.cpp
  is unchanged - aieDtracePluginInstance.runConstructorHook(...) now
  resolves to the new base-class filtered wrapper and dispatches
  through the virtual *Impl override.
* core/common/xdp/profile.cpp and profile.h are NOT modified. The
  no-plugin overhead is unchanged - the existing
  xrt_core::config::get_aie_dtrace() (and friends) config gate in
  profile.cpp's dispatchers remains the first and only check on the
  no-plugin path.

Signed-off-by: Jyotheeswar Ganne <Jyotheeswar.Ganne@amd.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@jvillarre jvillarre merged commit 7f934fe into Xilinx:master Jun 1, 2026
4 checks passed
snigdha-gupta added a commit to snigdha-gupta/XDP that referenced this pull request Jun 2, 2026
xdp: skip run-lifecycle hooks for XDP-internal runs (Xilinx#78)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants