Add Debug.profiling_runtime_config consumer for aie_dtrace#55
Open
jyothees99 wants to merge 3 commits intoXilinx:masterfrom
Open
Add Debug.profiling_runtime_config consumer for aie_dtrace#55jyothees99 wants to merge 3 commits intoXilinx:masterfrom
jyothees99 wants to merge 3 commits intoXilinx:masterfrom
Conversation
IshitaGhosh
requested changes
May 1, 2026
| xrt_core::message::send(severity_level::info, "XRT", "AIE dtrace: update device."); | ||
|
|
||
| if (!xrt_core::config::get_aie_dtrace()) | ||
| if (!profiling_runtime_config::aie_dtrace_enabled()) |
Collaborator
There was a problem hiding this comment.
@jyothees99 We want to keep supporting enabling dtrace with xrt.ini for non-VAIML flow. So, we need to include the xrt ini config check too.
Collaborator
Author
There was a problem hiding this comment.
@IshitaGhosh I am using xrt.ini value also to determine aie_dtrace_enabled. It's OR of xrt.ini and profile_runtime_config.
IshitaGhosh
reviewed
May 5, 2026
a290d71 to
c63602d
Compare
Introduce a shared XDP utility under plugin/vp_base/profiling_runtime_config.{h,cpp}
that parses the inline JSON blob carried by the new xrt.ini option
Debug.profiling_runtime_config exactly once and exposes its
control_instrumentation section. The schema currently recognized is
control_instrumentation = { aie_tile, mem_tile, interface_tile }; any
other top-level keys (e.g. event_trace) are accepted but ignored and
can be wired up in a follow-up. Parse failures and unknown keys produce
one-shot warnings; recognized keys produce one info line each.
The aie_dtrace plugin (aie_dtrace_plugin.cpp, aie_dtrace_ve2.cpp) now
guards its hooks on profiling_runtime_config::aie_dtrace_enabled(),
which returns true when either Debug.aie_dtrace is set in xrt.ini or
the blob carries control_instrumentation. The corresponding load gate
in xrt_coreutil (core/common/xdp/profile.cpp, in the XRT repo) uses
the same auto-enable rule.
AieProfileMetadata's aie_dtrace_ini_metadata_tag constructor now
prefers the blob: control_instrumentation.interface_tile is synthesized
into "all:<metric>" and forwarded to getConfigMetricsForInterfaceTiles
(unblocks the ddr_bandwidth use case today). aie_tile and mem_tile
entries are logged for a follow-up. When the blob is empty, missing or
malformed, behavior is identical to before (legacy
AIE_dtrace_settings.* xrt.ini reads).
aie_trace, aie_profile, and ml_timeline are intentionally untouched and
keep using their existing xrt.ini settings.
Made-with: Cursor
Add xdp::profiling_runtime_config::xdp_mode_effective() that derives
the effective Debug.xdp_mode value with the following precedence:
1. Explicit [Debug] xdp_mode in xrt.ini (or set via xrt::ini::set
before the first read) wins, whatever its value.
2. Otherwise, when has_control_instrumentation() is true, promote
to "xdna" so the XDNA loader/device gates pick the right variant
without the user also having to set xdp_mode explicitly.
3. Otherwise fall through to xrt_core::config::get_xdp_mode().
The probe for "did the user explicitly set xdp_mode" reads the [Debug]
section ptree directly via detail::get_ptree_value("Debug") so we can
distinguish "key was not in xrt.ini" from "user set the same string
as the default", matching the existing usage pattern in
aie_profile_metadata.cpp / aie_trace_metadata.cpp.
Route both per-device gates in aie_dtrace_plugin.cpp through the new
helper so the dtrace plugin attaches to the right device when the
runtime config blob alone is supplied. Other plugins still call
xrt_core::config::get_xdp_mode() directly because they are not
gated by profiling_runtime_config today; they can migrate when they
start consuming the blob.
Made-with: Cursor
…time_config
The latest VAIML profiling_runtime_config plan keeps FlexmlRT responsible
for setting Debug.aie_dtrace / Debug.aie_trace and Debug.xdp_mode in
xrt.ini via its existing enhancedProfilingXrtSettings presets ("trace"
and "ddr_bandwidth"). The blob's only role is to override the per-plugin
metric settings the legacy AIE_*_settings.* xrt.ini sections normally
carry.
That makes the blob-driven helpers added earlier on this branch redundant:
- aie_dtrace_enabled() auto-loaded the plugin when the blob carried
control_instrumentation, even with Debug.aie_dtrace unset.
- xdp_mode_effective() promoted Debug.xdp_mode to "xdna" under the same
condition.
FlexmlRT (or any user setting the blob) is expected to set the legacy
ini keys explicitly, so both helpers and their callers are reverted to
direct xrt_core::config::get_aie_dtrace() / get_xdp_mode() calls. The
profiling_runtime_config.h include is dropped from the dtrace plugin
and ve2 sources where it is no longer needed.
What stays: the blob parser (is_set / has_control_instrumentation /
control_instrumentation()) and the AieProfileMetadata
aie_dtrace_ini_metadata_tag constructor's blob-driven interface_tile
metric override -- this is the path through which the blob actually
drives aie_dtrace metric settings today.
Signed-off-by: Jyotheeswar Ganne <Jyotheeswar.Ganne@amd.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
c63602d to
27d8364
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Introduce a shared XDP utility under plugin/vp_base/profiling_runtime_config.{h,cpp} that parses the inline JSON blob carried by the new xrt.ini option Debug.profiling_runtime_config exactly once and exposes its control_instrumentation section. The schema currently recognized is control_instrumentation = { aie_tile, mem_tile, interface_tile }; any other top-level keys (e.g. event_trace) are accepted but ignored and can be wired up in a follow-up. Parse failures and unknown keys produce one-shot warnings; recognized keys produce one info line each.
The aie_dtrace plugin (aie_dtrace_plugin.cpp, aie_dtrace_ve2.cpp) now guards its hooks on profiling_runtime_config::aie_dtrace_enabled(), which returns true when either Debug.aie_dtrace is set in xrt.ini or the blob carries control_instrumentation. The corresponding load gate in xrt_coreutil (core/common/xdp/profile.cpp, in the XRT repo) uses the same auto-enable rule.
AieProfileMetadata's aie_dtrace_ini_metadata_tag constructor now prefers the blob: control_instrumentation.interface_tile is synthesized into "all:" and forwarded to getConfigMetricsForInterfaceTiles (unblocks the ddr_bandwidth use case today). aie_tile and mem_tile entries are logged for a follow-up. When the blob is empty, missing or malformed, behavior is identical to before (legacy AIE_dtrace_settings.* xrt.ini reads).
aie_trace, aie_profile, and ml_timeline are intentionally untouched and keep using their existing xrt.ini settings.
Made-with: Cursor