├── documentation
├── source
│ ├── _static
│ │ ├── style.css
│ │ └── theme_overrides.css
│ ├── media
│ │ ├── zoom_in.png
│ │ ├── zoom_out.png
│ │ ├── rgp_interop.png
│ │ ├── timeline_1.png
│ │ ├── welcome_1.png
│ │ ├── zoom_reset.png
│ │ ├── open_file_rgd.png
│ │ ├── system_info_1.png
│ │ ├── recent_traces_1.png
│ │ ├── timeline_empty.png
│ │ ├── zoom_to_selection.png
│ │ ├── driver_experiments_1.png
│ │ ├── settings
│ │ │ ├── dark_theme_1.png
│ │ │ ├── dark_theme_prompt.png
│ │ │ ├── themes_and_colors_1.png
│ │ │ └── keyboard_shortcuts_1.png
│ │ ├── vk_resource_naming_1.png
│ │ ├── compare
│ │ │ ├── snapshot_delta_1.png
│ │ │ └── memory_leak_finder_1.png
│ │ ├── snapshot
│ │ │ ├── heap_overview_1.png
│ │ │ ├── heap_overview_2.png
│ │ │ ├── resource_list_1.png
│ │ │ ├── resource_details_1.png
│ │ │ ├── resource_details_2.png
│ │ │ ├── resource_overview_1.png
│ │ │ ├── resource_overview_2.png
│ │ │ ├── resource_overview_3.png
│ │ │ ├── resource_overview_4.png
│ │ │ ├── allocation_explorer_1.png
│ │ │ ├── allocation_explorer_2.png
│ │ │ ├── allocation_overview_1.png
│ │ │ ├── allocation_overview_2.png
│ │ │ ├── allocation_overview_3.png
│ │ │ ├── allocation_overview_4.png
│ │ │ ├── carousel_resource_types.png
│ │ │ ├── carousel_virtual_memory.png
│ │ │ ├── carousel_allocation_sizes.png
│ │ │ ├── carousel_committed_memory.png
│ │ │ └── carousel_requested_virtual_memory.png
│ │ └── timeline_resource_usage_filter.png
│ ├── _templates
│ │ └── layout.html
│ ├── resource_naming.rst
│ └── compare_windows.rst
└── requirements.txt
├── Buildinfo.properties.in
├── samples
└── sample_trace.rmv
├── source
├── assets
│ ├── rmv_icon_32x32.png
│ ├── rmv_icon_48x48.png
│ ├── stop_128x128.png
│ ├── third_party
│ │ └── ionicons
│ │ │ ├── link.png
│ │ │ ├── search_icon.png
│ │ │ ├── warning.svg
│ │ │ ├── LICENSE
│ │ │ └── warning_white.svg
│ ├── browse_back_normal.svg
│ ├── browse_back_pressed.svg
│ ├── browse_fwd_normal.svg
│ ├── browse_fwd_pressed.svg
│ ├── browse_back_disabled.svg
│ ├── browse_fwd_disabled.svg
│ ├── arrow_gray_left.svg
│ ├── arrow_gray_right.svg
│ ├── pulldown_off_gray.svg
│ ├── pulldown_on_gray.svg
│ ├── checkbox_on.svg
│ ├── checkbox_on_gray.svg
│ ├── checkbox_off.svg
│ ├── checkbox_off_gray.svg
│ ├── zoom_out.svg
│ ├── zoom_out_disabled.svg
│ ├── zoom_to_selection.svg
│ ├── zoom_to_selection_disabled.svg
│ ├── amd_logo.svg
│ ├── zoom_in.svg
│ ├── zoom_in_disabled.svg
│ ├── zoom_reset.svg
│ └── zoom_reset_disabled.svg
├── frontend
│ ├── MacOSX
│ │ ├── rmv.icns
│ │ └── MacOSXBundleInfo.plist.in
│ ├── windows
│ │ ├── rmv_icon.ico
│ │ ├── resource.h
│ │ └── rmv.rc
│ ├── util
│ │ ├── version.cpp
│ │ ├── definitions.h
│ │ ├── time_util.h
│ │ ├── version.h.in
│ │ ├── log_file_writer.h
│ │ └── time_util.cpp
│ ├── views
│ │ ├── compare_pane.cpp
│ │ ├── settings
│ │ │ ├── keyboard_shortcuts_pane.cpp
│ │ │ ├── keyboard_shortcuts_pane.h
│ │ │ └── settings_pane.h
│ │ ├── base_pane.cpp
│ │ ├── debug_window.ui
│ │ ├── compare_pane.h
│ │ ├── custom_widgets
│ │ │ ├── rmv_fixed_width_label.cpp
│ │ │ ├── rmv_snapshot_table_view.cpp
│ │ │ ├── rmv_fixed_width_label.h
│ │ │ ├── rmv_carousel_memory_footprint.cpp
│ │ │ ├── themes_and_colors_item_button.h
│ │ │ ├── rmv_snapshot_table_view.h
│ │ │ ├── rmv_carousel_memory_footprint.h
│ │ │ ├── rmv_cancellable_loading_widget.h
│ │ │ ├── rmv_color_swatch_tooltip_item.h
│ │ │ ├── rmv_carousel_memory_types.h
│ │ │ ├── rmv_range_slider.h
│ │ │ ├── rmv_color_picker_button.h
│ │ │ ├── themes_and_colors_item_button.cpp
│ │ │ ├── rmv_carousel_resource_types.h
│ │ │ ├── rmv_color_swatch_tooltip_item.cpp
│ │ │ └── rmv_tooltip.h
│ │ ├── base_pane.h
│ │ ├── delegates
│ │ │ ├── rmv_regular_expression_validator.cpp
│ │ │ ├── rmv_snapshot_name_delegate.h
│ │ │ ├── rmv_regular_expression_validator.h
│ │ │ └── rmv_snapshot_name_delegate.cpp
│ │ ├── timeline
│ │ │ └── device_configuration_pane.h
│ │ ├── snapshot
│ │ │ ├── heap_overview_pane.h
│ │ │ └── snapshot_start_pane.h
│ │ ├── debug_window.h
│ │ ├── compare
│ │ │ └── compare_start_pane.h
│ │ └── start
│ │ │ ├── recent_traces_pane.h
│ │ │ └── recent_traces_pane.ui
│ ├── managers
│ │ └── message_manager.cpp
│ ├── settings
│ │ ├── rmv_geometry_settings.h
│ │ ├── settings_reader.h
│ │ └── settings_writer.h
│ ├── models
│ │ ├── proxy_models
│ │ │ ├── memory_leak_finder_proxy_model.cpp
│ │ │ ├── memory_leak_finder_proxy_model.h
│ │ │ ├── snapshot_timeline_proxy_model.h
│ │ │ ├── allocation_proxy_model.h
│ │ │ └── resource_details_proxy_model.h
│ │ ├── colorizer.h
│ │ ├── heap_combo_box_model.h
│ │ ├── resource_sorter.cpp
│ │ ├── combo_box_model.h
│ │ └── snapshot
│ │ │ └── allocation_overview_model.cpp
│ └── resources.qrc
├── backend
│ ├── rmt_snapshot_writer.cpp
│ ├── rmt_include_pevents.cpp
│ ├── rmt_process_start_info.h
│ ├── rmt_segment_info.h
│ ├── rmt_warnings.h
│ ├── rmt_configuration.h
│ ├── rmt_adapter_info.cpp
│ ├── rmt_linear_buffer.cpp
│ ├── rmt_data_profile.h
│ ├── rmt_adapter_info.h
│ ├── rmt_trace_loader.h
│ ├── rmt_rdf_file_parser.h
│ ├── rmt_thread.h
│ ├── rmt_snapshot_writer.h
│ └── rmt_legacy_snapshot_writer.h
├── parser
│ ├── rmt_constants.h
│ ├── rmt_rdf_dd_event_info.h
│ ├── rmt_profile.h
│ ├── rmt_platform.h
│ ├── rmt_platform.cpp
│ ├── rmt_util.h
│ ├── rmt_rdf_adapter_info.cpp
│ ├── rmt_address_helper.h
│ ├── rmt_assert.cpp
│ ├── rmt_address_helper.cpp
│ ├── rmt_string_memory_pool.cpp
│ ├── CMakeLists.txt
│ └── rmt_string_memory_pool.h
└── third_party
│ └── pevents
│ ├── LICENSE
│ └── src
│ └── pevents.h
├── .gitignore
├── .readthedocs.yaml
├── test
└── source
│ └── backend_test
│ ├── windows
│ ├── resource.h
│ └── backend_test.rc
│ ├── tests.cpp
│ ├── log.h
│ ├── rmv_test_segment_info.h
│ └── rmv_test_timestamps.h
├── LICENSE.txt
├── .clang-format
└── .clang-tidy
/documentation/source/_static/style.css:
--------------------------------------------------------------------------------
1 | .wy-nav-content {
2 | max-width: none;
3 | }
4 |
--------------------------------------------------------------------------------
/Buildinfo.properties.in:
--------------------------------------------------------------------------------
1 | BUILD_NUMBER=@RMV_BUILD_NUMBER@
2 | VERSION_NUMBER=@RMV_MAJOR_VERSION@.@RMV_MINOR_VERSION@
--------------------------------------------------------------------------------
/samples/sample_trace.rmv:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-Tools/radeon_memory_visualizer/HEAD/samples/sample_trace.rmv
--------------------------------------------------------------------------------
/source/assets/rmv_icon_32x32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-Tools/radeon_memory_visualizer/HEAD/source/assets/rmv_icon_32x32.png
--------------------------------------------------------------------------------
/source/assets/rmv_icon_48x48.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-Tools/radeon_memory_visualizer/HEAD/source/assets/rmv_icon_48x48.png
--------------------------------------------------------------------------------
/source/assets/stop_128x128.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-Tools/radeon_memory_visualizer/HEAD/source/assets/stop_128x128.png
--------------------------------------------------------------------------------
/source/frontend/MacOSX/rmv.icns:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-Tools/radeon_memory_visualizer/HEAD/source/frontend/MacOSX/rmv.icns
--------------------------------------------------------------------------------
/documentation/requirements.txt:
--------------------------------------------------------------------------------
1 | # Defining requirements for docs
2 | sphinx==5.3.0
3 | sphinx_rtd_theme==1.1.1
4 | readthedocs-sphinx-search==0.3.2
--------------------------------------------------------------------------------
/source/frontend/windows/rmv_icon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-Tools/radeon_memory_visualizer/HEAD/source/frontend/windows/rmv_icon.ico
--------------------------------------------------------------------------------
/documentation/source/media/zoom_in.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-Tools/radeon_memory_visualizer/HEAD/documentation/source/media/zoom_in.png
--------------------------------------------------------------------------------
/documentation/source/media/zoom_out.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-Tools/radeon_memory_visualizer/HEAD/documentation/source/media/zoom_out.png
--------------------------------------------------------------------------------
/documentation/source/media/rgp_interop.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-Tools/radeon_memory_visualizer/HEAD/documentation/source/media/rgp_interop.png
--------------------------------------------------------------------------------
/documentation/source/media/timeline_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-Tools/radeon_memory_visualizer/HEAD/documentation/source/media/timeline_1.png
--------------------------------------------------------------------------------
/documentation/source/media/welcome_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-Tools/radeon_memory_visualizer/HEAD/documentation/source/media/welcome_1.png
--------------------------------------------------------------------------------
/documentation/source/media/zoom_reset.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-Tools/radeon_memory_visualizer/HEAD/documentation/source/media/zoom_reset.png
--------------------------------------------------------------------------------
/documentation/source/media/open_file_rgd.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-Tools/radeon_memory_visualizer/HEAD/documentation/source/media/open_file_rgd.png
--------------------------------------------------------------------------------
/documentation/source/media/system_info_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-Tools/radeon_memory_visualizer/HEAD/documentation/source/media/system_info_1.png
--------------------------------------------------------------------------------
/source/assets/third_party/ionicons/link.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-Tools/radeon_memory_visualizer/HEAD/source/assets/third_party/ionicons/link.png
--------------------------------------------------------------------------------
/documentation/source/media/recent_traces_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-Tools/radeon_memory_visualizer/HEAD/documentation/source/media/recent_traces_1.png
--------------------------------------------------------------------------------
/documentation/source/media/timeline_empty.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-Tools/radeon_memory_visualizer/HEAD/documentation/source/media/timeline_empty.png
--------------------------------------------------------------------------------
/documentation/source/media/zoom_to_selection.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-Tools/radeon_memory_visualizer/HEAD/documentation/source/media/zoom_to_selection.png
--------------------------------------------------------------------------------
/documentation/source/media/driver_experiments_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-Tools/radeon_memory_visualizer/HEAD/documentation/source/media/driver_experiments_1.png
--------------------------------------------------------------------------------
/documentation/source/media/settings/dark_theme_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-Tools/radeon_memory_visualizer/HEAD/documentation/source/media/settings/dark_theme_1.png
--------------------------------------------------------------------------------
/documentation/source/media/vk_resource_naming_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-Tools/radeon_memory_visualizer/HEAD/documentation/source/media/vk_resource_naming_1.png
--------------------------------------------------------------------------------
/source/assets/third_party/ionicons/search_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-Tools/radeon_memory_visualizer/HEAD/source/assets/third_party/ionicons/search_icon.png
--------------------------------------------------------------------------------
/documentation/source/media/compare/snapshot_delta_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-Tools/radeon_memory_visualizer/HEAD/documentation/source/media/compare/snapshot_delta_1.png
--------------------------------------------------------------------------------
/documentation/source/media/settings/dark_theme_prompt.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-Tools/radeon_memory_visualizer/HEAD/documentation/source/media/settings/dark_theme_prompt.png
--------------------------------------------------------------------------------
/documentation/source/media/snapshot/heap_overview_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-Tools/radeon_memory_visualizer/HEAD/documentation/source/media/snapshot/heap_overview_1.png
--------------------------------------------------------------------------------
/documentation/source/media/snapshot/heap_overview_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-Tools/radeon_memory_visualizer/HEAD/documentation/source/media/snapshot/heap_overview_2.png
--------------------------------------------------------------------------------
/documentation/source/media/snapshot/resource_list_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-Tools/radeon_memory_visualizer/HEAD/documentation/source/media/snapshot/resource_list_1.png
--------------------------------------------------------------------------------
/documentation/source/media/compare/memory_leak_finder_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-Tools/radeon_memory_visualizer/HEAD/documentation/source/media/compare/memory_leak_finder_1.png
--------------------------------------------------------------------------------
/documentation/source/media/settings/themes_and_colors_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-Tools/radeon_memory_visualizer/HEAD/documentation/source/media/settings/themes_and_colors_1.png
--------------------------------------------------------------------------------
/documentation/source/media/snapshot/resource_details_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-Tools/radeon_memory_visualizer/HEAD/documentation/source/media/snapshot/resource_details_1.png
--------------------------------------------------------------------------------
/documentation/source/media/snapshot/resource_details_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-Tools/radeon_memory_visualizer/HEAD/documentation/source/media/snapshot/resource_details_2.png
--------------------------------------------------------------------------------
/documentation/source/media/snapshot/resource_overview_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-Tools/radeon_memory_visualizer/HEAD/documentation/source/media/snapshot/resource_overview_1.png
--------------------------------------------------------------------------------
/documentation/source/media/snapshot/resource_overview_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-Tools/radeon_memory_visualizer/HEAD/documentation/source/media/snapshot/resource_overview_2.png
--------------------------------------------------------------------------------
/documentation/source/media/snapshot/resource_overview_3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-Tools/radeon_memory_visualizer/HEAD/documentation/source/media/snapshot/resource_overview_3.png
--------------------------------------------------------------------------------
/documentation/source/media/snapshot/resource_overview_4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-Tools/radeon_memory_visualizer/HEAD/documentation/source/media/snapshot/resource_overview_4.png
--------------------------------------------------------------------------------
/documentation/source/media/settings/keyboard_shortcuts_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-Tools/radeon_memory_visualizer/HEAD/documentation/source/media/settings/keyboard_shortcuts_1.png
--------------------------------------------------------------------------------
/documentation/source/media/snapshot/allocation_explorer_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-Tools/radeon_memory_visualizer/HEAD/documentation/source/media/snapshot/allocation_explorer_1.png
--------------------------------------------------------------------------------
/documentation/source/media/snapshot/allocation_explorer_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-Tools/radeon_memory_visualizer/HEAD/documentation/source/media/snapshot/allocation_explorer_2.png
--------------------------------------------------------------------------------
/documentation/source/media/snapshot/allocation_overview_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-Tools/radeon_memory_visualizer/HEAD/documentation/source/media/snapshot/allocation_overview_1.png
--------------------------------------------------------------------------------
/documentation/source/media/snapshot/allocation_overview_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-Tools/radeon_memory_visualizer/HEAD/documentation/source/media/snapshot/allocation_overview_2.png
--------------------------------------------------------------------------------
/documentation/source/media/snapshot/allocation_overview_3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-Tools/radeon_memory_visualizer/HEAD/documentation/source/media/snapshot/allocation_overview_3.png
--------------------------------------------------------------------------------
/documentation/source/media/snapshot/allocation_overview_4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-Tools/radeon_memory_visualizer/HEAD/documentation/source/media/snapshot/allocation_overview_4.png
--------------------------------------------------------------------------------
/documentation/source/media/timeline_resource_usage_filter.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-Tools/radeon_memory_visualizer/HEAD/documentation/source/media/timeline_resource_usage_filter.png
--------------------------------------------------------------------------------
/documentation/source/media/snapshot/carousel_resource_types.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-Tools/radeon_memory_visualizer/HEAD/documentation/source/media/snapshot/carousel_resource_types.png
--------------------------------------------------------------------------------
/documentation/source/media/snapshot/carousel_virtual_memory.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-Tools/radeon_memory_visualizer/HEAD/documentation/source/media/snapshot/carousel_virtual_memory.png
--------------------------------------------------------------------------------
/documentation/source/media/snapshot/carousel_allocation_sizes.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-Tools/radeon_memory_visualizer/HEAD/documentation/source/media/snapshot/carousel_allocation_sizes.png
--------------------------------------------------------------------------------
/documentation/source/media/snapshot/carousel_committed_memory.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-Tools/radeon_memory_visualizer/HEAD/documentation/source/media/snapshot/carousel_committed_memory.png
--------------------------------------------------------------------------------
/documentation/source/_templates/layout.html:
--------------------------------------------------------------------------------
1 | {% extends "!layout.html" %}
2 | {% block extrahead %}
3 |
4 | {% endblock %}
5 |
--------------------------------------------------------------------------------
/documentation/source/media/snapshot/carousel_requested_virtual_memory.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GPUOpen-Tools/radeon_memory_visualizer/HEAD/documentation/source/media/snapshot/carousel_requested_virtual_memory.png
--------------------------------------------------------------------------------
/documentation/source/_static/theme_overrides.css:
--------------------------------------------------------------------------------
1 |
2 |
3 | img {
4 | max-width: 100%;
5 | max-height: auto;
6 | box-shadow: 6px 6px #eee;
7 | -ms-interpolation-mode: bicubic;
8 | border: 1px solid #ccc;
9 | }
10 |
11 | table {
12 | font-size: 12px;
13 | }
--------------------------------------------------------------------------------
/source/assets/browse_back_normal.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/source/assets/browse_back_pressed.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/source/assets/browse_fwd_normal.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/source/assets/browse_fwd_pressed.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/source/assets/browse_back_disabled.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/source/assets/browse_fwd_disabled.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/source/assets/arrow_gray_left.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/source/assets/arrow_gray_right.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/source/assets/pulldown_off_gray.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/source/assets/pulldown_on_gray.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | *~
2 | *.pyc
3 | *.orig
4 | __pycache__/
5 | build/linux
6 | build/mac
7 | build/win
8 | cmake-build*/
9 | .idea/
10 | documentation/build
11 | documentation/source/_build
12 | source/frontend/util/version.h
13 | Buildinfo.properties
14 | external
15 | .vscode
16 | *.aps
17 | .vs/
18 | out/
19 |
--------------------------------------------------------------------------------
/source/assets/checkbox_on.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/source/assets/checkbox_on_gray.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/source/assets/third_party/ionicons/warning.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/source/assets/checkbox_off.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/source/assets/checkbox_off_gray.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/source/frontend/util/version.cpp:
--------------------------------------------------------------------------------
1 | //=============================================================================
2 | // Copyright (c) 2018-2025 Advanced Micro Devices, Inc. All rights reserved.
3 | /// @author AMD Developer Tools Team
4 | /// @file
5 | /// @brief Version number info for RMV
6 | //=============================================================================
7 |
8 | #include "util/version.h"
9 |
10 | const char* version_string = "RmvVersion=" RMV_VERSION_STRING;
11 |
--------------------------------------------------------------------------------
/source/frontend/views/compare_pane.cpp:
--------------------------------------------------------------------------------
1 | //=============================================================================
2 | // Copyright (c) 2021-2025 Advanced Micro Devices, Inc. All rights reserved.
3 | /// @author AMD Developer Tools Team
4 | /// @file
5 | /// @brief Implementation for the compare pane base class.
6 | //=============================================================================
7 |
8 | #include "compare_pane.h"
9 |
10 | ComparePane::ComparePane(QWidget* parent)
11 | : BasePane(parent)
12 | {
13 | }
14 |
15 | ComparePane::~ComparePane()
16 | {
17 | }
18 |
--------------------------------------------------------------------------------
/.readthedocs.yaml:
--------------------------------------------------------------------------------
1 | # .readthedocs.yaml
2 | # Read the Docs configuration file
3 | # See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
4 |
5 | # Required
6 | version: 2
7 |
8 | # Set the version of Python and other tools you might need
9 | build:
10 | os: ubuntu-22.04
11 | tools:
12 | python: "3.11"
13 |
14 | # Build documentation in the docs/source directory with Sphinx
15 | sphinx:
16 | configuration: documentation/source/conf.py
17 |
18 | # Explicitly set the version of Python and its requirements
19 | python:
20 | install:
21 | - requirements: documentation/requirements.txt
22 |
--------------------------------------------------------------------------------
/source/backend/rmt_snapshot_writer.cpp:
--------------------------------------------------------------------------------
1 | //=============================================================================
2 | // Copyright (c) 2023-2025 Advanced Micro Devices, Inc. All rights reserved.
3 | /// @author AMD Developer Tools Team
4 | /// @file
5 | /// @brief Implementation of the base class that handles writing snapshot data.
6 | //=============================================================================
7 |
8 | #include "rmt_rdf_snapshot_writer.h"
9 |
10 | #include "rmt_data_set.h"
11 |
12 | RmtSnapshotWriter::RmtSnapshotWriter(RmtDataSet* data_set)
13 | : data_set_(data_set)
14 | {
15 | }
16 |
17 | RmtSnapshotWriter::~RmtSnapshotWriter()
18 | {
19 | }
20 |
--------------------------------------------------------------------------------
/source/backend/rmt_include_pevents.cpp:
--------------------------------------------------------------------------------
1 | //=============================================================================
2 | // Copyright (c) 2023-2025 Advanced Micro Devices, Inc. All rights reserved.
3 | /// @author AMD Developer Tools Team
4 | /// @file
5 | /// @brief Include the pevents source file the required pragmas.
6 | ///
7 | /// Switch off anything that will fail due to warnings as errors.
8 | //=============================================================================
9 |
10 | #ifndef _WIN32
11 | #pragma GCC diagnostic push
12 | #pragma GCC diagnostic ignored "-Wunused-but-set-variable"
13 | #include "pevents/src/pevents.cpp"
14 | #pragma GCC diagnostic pop
15 | #endif
16 |
--------------------------------------------------------------------------------
/source/frontend/windows/resource.h:
--------------------------------------------------------------------------------
1 | //{{NO_DEPENDENCIES}}
2 | //=============================================================================
3 | // Copyright (c) 2021-2025 Advanced Micro Devices, Inc. All rights reserved.
4 | /// @author AMD Developer Tools Team
5 | /// @file
6 | /// @brief Microsoft Visual C++ generated include file used by RMV.rc.
7 | //=============================================================================
8 | // Microsoft Visual C++ generated include file.
9 | // Used by RMV.rc
10 | //
11 | #define IDI_ICON1 101
12 |
13 | // Next default values for new objects
14 | //
15 | #ifdef APSTUDIO_INVOKED
16 | #ifndef APSTUDIO_READONLY_SYMBOLS
17 | #endif
18 | #endif
19 |
--------------------------------------------------------------------------------
/test/source/backend_test/windows/resource.h:
--------------------------------------------------------------------------------
1 | //{{NO_DEPENDENCIES}}
2 | // Microsoft Visual C++ generated include file.
3 | //=============================================================================
4 | // Copyright (c) 2021-2025 Advanced Micro Devices, Inc. All rights reserved.
5 | /// @author AMD Developer Tools Team
6 | /// @file
7 | /// @brief Microsoft Visual C++ generated include file used by backend_test.rc.
8 | //=============================================================================
9 | // Used by RMV.rc
10 | //
11 | #define IDI_ICON1 101
12 |
13 | // Next default values for new objects
14 | //
15 | #ifdef APSTUDIO_INVOKED
16 | #ifndef APSTUDIO_READONLY_SYMBOLS
17 | #endif
18 | #endif
19 |
--------------------------------------------------------------------------------
/source/frontend/util/definitions.h:
--------------------------------------------------------------------------------
1 | //=============================================================================
2 | // Copyright (c) 2018-2025 Advanced Micro Devices, Inc. All rights reserved.
3 | /// @author AMD Developer Tools Team
4 | /// @file
5 | /// @brief Intended to hold globally-known definitions.
6 | //=============================================================================
7 |
8 | #ifndef RMV_UTIL_DEFINITIONS_H_
9 | #define RMV_UTIL_DEFINITIONS_H_
10 |
11 | #ifdef _WIN32
12 | #pragma warning(disable : 4189)
13 | #endif
14 |
15 | #ifdef _DEBUG
16 | #define RMV_DEBUG_WINDOW 1
17 | #else
18 | #define RMV_DEBUG_WINDOW 0
19 | #endif
20 |
21 | #include "util/constants.h"
22 |
23 | #endif // RMV_UTIL_DEFINITIONS_H_
24 |
--------------------------------------------------------------------------------
/source/frontend/managers/message_manager.cpp:
--------------------------------------------------------------------------------
1 | //=============================================================================
2 | // Copyright (c) 2018-2025 Advanced Micro Devices, Inc. All rights reserved.
3 | /// @author AMD Developer Tools Team
4 | /// @file
5 | /// @brief Implementation of the MessageManager class.
6 | ///
7 | /// Basically a bunch of signals that other UI elements can observe and react
8 | /// to.
9 | ///
10 | //=============================================================================
11 |
12 | #include "managers/message_manager.h"
13 |
14 | namespace rmv
15 | {
16 | // Single instance of the Message Manager.
17 | static MessageManager message_manager;
18 |
19 | MessageManager& MessageManager::Get()
20 | {
21 | return message_manager;
22 | }
23 | } // namespace rmv
24 |
--------------------------------------------------------------------------------
/source/frontend/views/settings/keyboard_shortcuts_pane.cpp:
--------------------------------------------------------------------------------
1 | //=============================================================================
2 | // Copyright (c) 2018-2025 Advanced Micro Devices, Inc. All rights reserved.
3 | /// @author AMD Developer Tools Team
4 | /// @file
5 | /// @brief Implementation of Keyboard Shortcuts pane.
6 | //=============================================================================
7 |
8 | #include "views/settings/keyboard_shortcuts_pane.h"
9 |
10 | #include "util/widget_util.h"
11 |
12 | KeyboardShortcutsPane::KeyboardShortcutsPane(QWidget* parent)
13 | : BasePane(parent)
14 | , ui_(new Ui::KeyboardShortcutsPane)
15 | {
16 | ui_->setupUi(this);
17 |
18 | rmv::widget_util::ApplyStandardPaneStyle(ui_->main_scroll_area_);
19 | }
20 |
21 | KeyboardShortcutsPane::~KeyboardShortcutsPane()
22 | {
23 | }
24 |
--------------------------------------------------------------------------------
/source/frontend/views/base_pane.cpp:
--------------------------------------------------------------------------------
1 | //=============================================================================
2 | // Copyright (c) 2018-2025 Advanced Micro Devices, Inc. All rights reserved.
3 | /// @author AMD Developer Tools Team
4 | /// @file
5 | /// @brief Implementation for a base pane class.
6 | //=============================================================================
7 |
8 | #include "base_pane.h"
9 |
10 | BasePane::BasePane(QWidget* parent)
11 | : QWidget(parent)
12 | {
13 | }
14 |
15 | BasePane::~BasePane()
16 | {
17 | }
18 |
19 | void BasePane::OpenSnapshot(RmtDataSnapshot* snapshot)
20 | {
21 | Q_UNUSED(snapshot);
22 | }
23 |
24 | void BasePane::SwitchTimeUnits()
25 | {
26 | }
27 |
28 | void BasePane::OnTraceClose()
29 | {
30 | }
31 |
32 | void BasePane::Reset()
33 | {
34 | }
35 |
36 | void BasePane::ChangeColoring()
37 | {
38 | }
39 |
--------------------------------------------------------------------------------
/source/parser/rmt_constants.h:
--------------------------------------------------------------------------------
1 | //=============================================================================
2 | // Copyright (c) 2023-2025 Advanced Micro Devices, Inc. All rights reserved.
3 | /// @author AMD Developer Tools Team
4 | /// @file
5 | /// @brief Intended to hold globally-known definitions.
6 | //=============================================================================
7 |
8 | #ifndef RMV_PARSER_RMT_CONSTANTS_H_
9 | #define RMV_PARSER_RMT_CONSTANTS_H_
10 |
11 | #include
12 |
13 | #ifdef __cplusplus
14 | extern "C" {
15 | #endif // #ifdef __cplusplus
16 |
17 | // The file extensions for trace files.
18 | static const char* kRMVTraceFileExtension = ".rmv";
19 | static const char* kRGDTraceFileExtension = ".rgd";
20 |
21 | static constexpr uint32_t kFamilyNavi = 0x8F;
22 | static constexpr uint32_t kFamilyNavi4 = 0x98;
23 |
24 | #ifdef __cplusplus
25 | }
26 | #endif // __cplusplus
27 | #endif // RMV_PARSER_RMT_CONSTANTS_H_
28 |
--------------------------------------------------------------------------------
/source/frontend/views/debug_window.ui:
--------------------------------------------------------------------------------
1 |
2 |
3 | DebugWindow
4 |
5 |
6 |
7 | 0
8 | 0
9 | 720
10 | 150
11 |
12 |
13 |
14 | RMV Debug Output - use DbgMsg() or qDebug()
15 |
16 |
17 |
18 | :/Resources/assets/rmv_icon_48x48.png:/Resources/assets/rmv_icon_48x48.png
19 |
20 |
21 | -
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/source/assets/zoom_out.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/source/assets/zoom_out_disabled.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/source/assets/zoom_to_selection.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/source/backend/rmt_process_start_info.h:
--------------------------------------------------------------------------------
1 | //=============================================================================
2 | // Copyright (c) 2019-2025 Advanced Micro Devices, Inc. All rights reserved.
3 | /// @author AMD Developer Tools Team
4 | /// @file
5 | /// @brief Definition of the process start info structures and helper functions.
6 | //=============================================================================
7 |
8 | #ifndef RMV_BACKEND_RMT_PROCESS_START_INFO_H_
9 | #define RMV_BACKEND_RMT_PROCESS_START_INFO_H_
10 |
11 | #ifdef __cplusplus
12 | extern "C" {
13 | #endif // #ifdef __cplusplus
14 |
15 | /// A structure encapsulating the process start info.
16 | typedef struct RmtProcessStartInfo
17 | {
18 | uint64_t process_id; ///< The process ID.
19 | uint64_t physical_memory_allocated; ///< The amount of physical memory allocated (in bytes).
20 | } RmtProcessStartInfo;
21 |
22 | #ifdef __cplusplus
23 | }
24 | #endif // #ifdef __cplusplus
25 | #endif // #ifndef RMV_BACKEND_RMT_PROCESS_START_INFO_H_
26 |
--------------------------------------------------------------------------------
/source/assets/zoom_to_selection_disabled.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/source/frontend/views/compare_pane.h:
--------------------------------------------------------------------------------
1 | //=============================================================================
2 | // Copyright (c) 2021-2025 Advanced Micro Devices, Inc. All rights reserved.
3 | /// @author AMD Developer Tools Team
4 | /// @file
5 | /// @brief Header for the compare pane base class.
6 | //=============================================================================
7 |
8 | #ifndef RMV_VIEWS_COMPARE_PANE_H_
9 | #define RMV_VIEWS_COMPARE_PANE_H_
10 |
11 | #include
12 |
13 | #include "views/base_pane.h"
14 |
15 | /// @brief Base class for a compare pane in the UI.
16 | class ComparePane : public BasePane
17 | {
18 | Q_OBJECT
19 |
20 | public:
21 | /// @brief Constructor.
22 | ///
23 | /// @param [in] parent The parent widget.
24 | explicit ComparePane(QWidget* parent = nullptr);
25 |
26 | /// @brief Destructor.
27 | virtual ~ComparePane();
28 |
29 | /// @brief Update the UI when a new comparison is done.
30 | virtual void Refresh() = 0;
31 | };
32 |
33 | #endif // RMV_VIEWS_COMPARE_PANE_H_
34 |
--------------------------------------------------------------------------------
/source/assets/amd_logo.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/source/assets/zoom_in.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/source/assets/zoom_in_disabled.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/source/frontend/views/settings/keyboard_shortcuts_pane.h:
--------------------------------------------------------------------------------
1 | //=============================================================================
2 | // Copyright (c) 2018-2025 Advanced Micro Devices, Inc. All rights reserved.
3 | /// @author AMD Developer Tools Team
4 | /// @file
5 | /// @brief Header for the Keyboard Shortcuts pane.
6 | //=============================================================================
7 |
8 | #ifndef RMV_VIEWS_SETTINGS_KEYBOARD_SHORTCUTS_PANE_H_
9 | #define RMV_VIEWS_SETTINGS_KEYBOARD_SHORTCUTS_PANE_H_
10 |
11 | #include "ui_keyboard_shortcuts_pane.h"
12 |
13 | #include "views/base_pane.h"
14 |
15 | /// @brief Class declaration.
16 | class KeyboardShortcutsPane : public BasePane
17 | {
18 | Q_OBJECT
19 |
20 | public:
21 | /// @brief Constructor.
22 | ///
23 | /// @param [in] parent The parent widget.
24 | explicit KeyboardShortcutsPane(QWidget* parent = nullptr);
25 |
26 | /// @brief Destructor.
27 | virtual ~KeyboardShortcutsPane();
28 |
29 | private:
30 | Ui::KeyboardShortcutsPane* ui_; ///< Pointer to the Qt UI design.
31 | };
32 |
33 | #endif // RMV_VIEWS_SETTINGS_KEYBOARD_SHORTCUTS_PANE_H_
34 |
--------------------------------------------------------------------------------
/source/frontend/views/custom_widgets/rmv_fixed_width_label.cpp:
--------------------------------------------------------------------------------
1 | //=============================================================================
2 | /// Copyright (c) 2024-2025 Advanced Micro Devices, Inc. All rights reserved.
3 | /// \author AMD Developer Tools Team
4 | /// \file
5 | /// \brief Implementation for the fixed width label widget.
6 | //=============================================================================
7 |
8 | #include "views/custom_widgets/rmv_fixed_width_label.h"
9 |
10 | RmvFixedWidthLabel::RmvFixedWidthLabel(QWidget* parent)
11 | : ScaledLabel(parent)
12 | {
13 | setSizePolicy(QSizePolicy::Policy::Fixed, QSizePolicy::Policy::Fixed);
14 | }
15 |
16 | RmvFixedWidthLabel::~RmvFixedWidthLabel()
17 | {
18 | }
19 |
20 | void RmvFixedWidthLabel::SetWidestTextString(const QString& string)
21 | {
22 | widest_text_string_ = string;
23 | }
24 |
25 | QSize RmvFixedWidthLabel::sizeHint() const
26 | {
27 | QSize size = ScaledLabel::sizeHint();
28 | const QFontMetrics fm(font());
29 | const int width = fm.horizontalAdvance(widest_text_string_);
30 | size.setWidth(width);
31 |
32 | return size;
33 | }
34 |
--------------------------------------------------------------------------------
/LICENSE.txt:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2017-2025 Advanced Micro Devices, Inc.
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in
13 | all copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | THE SOFTWARE.
22 |
--------------------------------------------------------------------------------
/source/backend/rmt_segment_info.h:
--------------------------------------------------------------------------------
1 | //=============================================================================
2 | // Copyright (c) 2019-2025 Advanced Micro Devices, Inc. All rights reserved.
3 | /// @author AMD Developer Tools Team
4 | /// @file
5 | /// @brief The segment information captured for the target process.
6 | //=============================================================================
7 |
8 | #ifndef RMV_BACKEND_RMT_SEGMENT_INFO_H_
9 | #define RMV_BACKEND_RMT_SEGMENT_INFO_H_
10 |
11 | #include
12 |
13 | #ifdef __cplusplus
14 | extern "C" {
15 | #endif // #ifdef __cplusplus
16 |
17 | /// A structure encapsulating the information about a segment.
18 | typedef struct RmtSegmentInfo
19 | {
20 | RmtGpuAddress base_address; ///< The base address of the segment.
21 | uint64_t size; ///< The size of the segment (in bytes).
22 | RmtHeapType heap_type; ///< The heap type where the segment resides.
23 | int32_t index; ///< The index of the segment.
24 | } RmtSegmentInfo;
25 |
26 | #ifdef __cplusplus
27 | }
28 | #endif // #ifdef __cplusplus
29 | #endif // #ifndef RMV_BACKEND_RMT_SEGMENT_INFO_H_
30 |
--------------------------------------------------------------------------------
/source/third_party/pevents/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (C) 2011 - 2022 by NeoSmart Technologies
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy
4 | of this software and associated documentation files (the "Software"), to deal
5 | in the Software without restriction, including without limitation the rights
6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 | copies of the Software, and to permit persons to whom the Software is
8 | furnished to do so, subject to the following conditions:
9 |
10 | The above copyright notice and this permission notice shall be included in
11 | all copies or substantial portions of the Software.
12 |
13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19 | THE SOFTWARE.
20 |
--------------------------------------------------------------------------------
/source/assets/zoom_reset.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/source/assets/third_party/ionicons/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2014 Drifty (http://drifty.com/)
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in
13 | all copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | THE SOFTWARE.
22 |
--------------------------------------------------------------------------------
/source/frontend/util/time_util.h:
--------------------------------------------------------------------------------
1 | //=============================================================================
2 | // Copyright (c) 2019-2025 Advanced Micro Devices, Inc. All rights reserved.
3 | /// @author AMD Developer Tools Team
4 | /// @file
5 | /// @brief Definition of a number of time-related utilities.
6 | //=============================================================================
7 |
8 | #ifndef RMV_UTIL_TIME_UTIL_H_
9 | #define RMV_UTIL_TIME_UTIL_H_
10 |
11 | #include
12 |
13 | namespace rmv
14 | {
15 | namespace time_util
16 | {
17 | /// @brief Convert a clock to a time unit and output as string.
18 | ///
19 | /// @param [in] clk input clock to convert.
20 | ///
21 | /// @return A string representing a clock value.
22 | QString ClockToTimeUnit(uint64_t clk);
23 |
24 | /// @brief Get the ratio of time units to clock units.
25 | ///
26 | /// Used to convert from time to clocks and vice versa.
27 | ///
28 | /// @return The ratio of clock to time.
29 | double TimeToClockRatio();
30 | } // namespace time_util
31 | } // namespace rmv
32 |
33 | #endif // RMV_UTIL_TIME_UTIL_H_
34 |
--------------------------------------------------------------------------------
/source/assets/zoom_reset_disabled.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/source/parser/rmt_rdf_dd_event_info.h:
--------------------------------------------------------------------------------
1 | //=============================================================================
2 | // Copyright (c) 2023-2025 Advanced Micro Devices, Inc. All rights reserved.
3 | /// @author AMD Developer Tools Team
4 | /// @file
5 | /// @brief Definition of the RDF DD Event Information chunk parser.
6 | //=============================================================================
7 |
8 | #ifndef RMV_PARSER_RMT_RDF_DD_EVENT_INFO_H_
9 | #define RMV_PARSER_RMT_RDF_DD_EVENT_INFO_H_
10 |
11 | #include "rdf/rdf/inc/amdrdf.h"
12 |
13 | /// Load timestamp info from the DD Event chunk header.
14 | /// @param [in] chunk_file The rdfChunkFile object pointer to load from.
15 | /// @param [out] out_timestamp The timestamp from the DDEvent chunk header.
16 | /// @param [out] out_frequency The frequency from the DDEvent chunk header.
17 | ///
18 | /// @retval If successful, returns true. Otherwise returns false.
19 | ///
20 | bool RmtRdfLoadTimestampData(rdfChunkFile* chunk_file, uint64_t& out_timestamp, uint32_t& out_frequency);
21 |
22 | #endif // #ifndef RMV_PARSER_RMT_RDF_DD_EVENT_INFO_H_
23 |
--------------------------------------------------------------------------------
/source/frontend/views/custom_widgets/rmv_snapshot_table_view.cpp:
--------------------------------------------------------------------------------
1 | //=============================================================================
2 | // Copyright (c) 2020-2025 Advanced Micro Devices, Inc. All rights reserved.
3 | /// @author AMD Developer Tools Team
4 | /// @file
5 | /// @brief Implementation for the snapshot table view.
6 | ///
7 | /// Emit a signal whenever the table selection is changed so external objects
8 | /// can respond to it.
9 | ///
10 | //=============================================================================
11 |
12 | #include "views/custom_widgets/rmv_snapshot_table_view.h"
13 |
14 | #include "models/timeline/snapshot_item_model.h"
15 |
16 | RMVSnapshotTableView::RMVSnapshotTableView(QWidget* parent)
17 | : ScaledTableView(parent)
18 | , snapshot_name_delegate_(this)
19 | {
20 | setItemDelegateForColumn(rmv::kSnapshotTimelineColumnName, &snapshot_name_delegate_);
21 | }
22 |
23 | RMVSnapshotTableView::~RMVSnapshotTableView()
24 | {
25 | }
26 |
27 | void RMVSnapshotTableView::selectionChanged(const QItemSelection& selected, const QItemSelection& deselected)
28 | {
29 | ScaledTableView::selectionChanged(selected, deselected);
30 | emit SelectionChanged();
31 | }
32 |
--------------------------------------------------------------------------------
/test/source/backend_test/tests.cpp:
--------------------------------------------------------------------------------
1 | //=============================================================================
2 | // Copyright (c) 2020-2025 Advanced Micro Devices, Inc. All rights reserved.
3 | /// @author AMD Developer Tools Team
4 | /// @file
5 | /// @brief Backend catch2 test cases.
6 | //=============================================================================
7 |
8 | #include
9 |
10 | #include "rmv_test_cases.h"
11 |
12 | TEST_CASE("TestSystemInfo", "RMVTest")
13 | {
14 | bool result = RMVTestCases::Get()->TestSystemInfo();
15 | REQUIRE(result == true);
16 | }
17 |
18 | TEST_CASE("TestSegmentInfo", "RMVTest")
19 | {
20 | bool result = RMVTestCases::Get()->TestSegmentInfo();
21 | REQUIRE(result == true);
22 | }
23 |
24 | TEST_CASE("TestAllocations", "RMVTest")
25 | {
26 | bool result = RMVTestCases::Get()->TestAllocations();
27 | REQUIRE(result == true);
28 | }
29 |
30 | TEST_CASE("TestResources", "RMVTest")
31 | {
32 | bool result = RMVTestCases::Get()->TestResources();
33 | REQUIRE(result == true);
34 | }
35 |
36 | TEST_CASE("TestTimestamps", "RMVTest")
37 | {
38 | bool result = RMVTestCases::Get()->TestTimestamps();
39 | REQUIRE(result == true);
40 | }
41 |
--------------------------------------------------------------------------------
/source/frontend/MacOSX/MacOSXBundleInfo.plist.in:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | English
7 | CFBundleExecutable
8 | ${MACOSX_BUNDLE_EXECUTABLE_NAME}
9 | CFBundleIconFile
10 | ${MACOSX_BUNDLE_ICON_FILE}
11 | CFBundleIdentifier
12 | com.AMD.RGP
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleLongVersionString
16 | RGP V1.0.XXXX
17 | CFBundleName
18 | RGP
19 | CFBundlePackageType
20 | APPL
21 | CFBundleShortVersionString
22 | 1.0.0
23 | CFBundleSignature
24 | ????
25 | CFBundleVersion
26 | 000000
27 | CSResourcesFileMapped
28 |
29 | NSHumanReadableCopyright
30 | Copyright © 2017 AMD. All rights reserved
31 | NSPrincipalClass
32 | NsApplication
33 |
34 |
35 |
--------------------------------------------------------------------------------
/source/backend/rmt_warnings.h:
--------------------------------------------------------------------------------
1 | //=============================================================================
2 | // Copyright (c) 2019-2025 Advanced Micro Devices, Inc. All rights reserved.
3 | /// @author AMD Developer Tools Team
4 | /// @file
5 | /// @brief Definition of structures and functions for RMT warnings.
6 | //=============================================================================
7 |
8 | #ifndef RMV_BACKEND_RMT_WARNINGS_H_
9 | #define RMV_BACKEND_RMT_WARNINGS_H_
10 |
11 | #ifdef __cplusplus
12 | extern "C" {
13 | #endif // #ifdef __cplusplus
14 |
15 | /// An enumeration of all warnings.
16 | typedef enum RmtWarningType
17 | {
18 | kRmtWarningTypeVirtualAllocationHighDedicatedResourceCount = 0,
19 | kRmtWarningTypeVirtualAllocationHighFragmentationAllocation = 1,
20 | kRmtWarningTypeHeapOversubscribed = 2,
21 | kRmtWarningTypeResourceCriticalInNonlocal = 3,
22 | kRmtWarningTypeResourceInNonPreferredHeap = 4,
23 | kRmtWarningTypeResourceOrphaned = 5,
24 |
25 | // add above this
26 | kRmtWarningTypeCount
27 | } RmtWarningType;
28 |
29 | #ifdef __cplusplus
30 | }
31 | #endif // #ifdef __cplusplus
32 | #endif // #ifndef RMV_BACKEND_RMT_WARNINGS_H_
33 |
--------------------------------------------------------------------------------
/source/frontend/views/custom_widgets/rmv_fixed_width_label.h:
--------------------------------------------------------------------------------
1 | //=============================================================================
2 | /// Copyright (c) 2024-2025 Advanced Micro Devices, Inc. All rights reserved.
3 | /// \author AMD Developer Tools Team
4 | /// \file
5 | /// \brief Header for the fixed width label widget.
6 | //=============================================================================
7 |
8 | #ifndef RMV_VIEWS_CUSTOM_WIDGETS_RMV_FIXED_WIDTH_LABEL_H_
9 | #define RMV_VIEWS_CUSTOM_WIDGETS_RMV_FIXED_WIDTH_LABEL_H_
10 |
11 | #include "qt_common/custom_widgets/scaled_label.h"
12 |
13 | /// Reimplements the scaled label to have a fixed width.
14 | class RmvFixedWidthLabel : public ScaledLabel
15 | {
16 | Q_OBJECT
17 |
18 | public:
19 | /// Constructor
20 | /// \param parent The parent widget
21 | RmvFixedWidthLabel(QWidget* parent);
22 |
23 | /// Virtual destructor
24 | virtual ~RmvFixedWidthLabel();
25 |
26 | void SetWidestTextString(const QString& string);
27 |
28 | /// @brief Provide a sizeHint with a fixed width to match the size of the longest expected string.
29 | ///
30 | /// @return The desired size of the widget.
31 | QSize sizeHint() const Q_DECL_OVERRIDE;
32 |
33 | private:
34 | QString widest_text_string_; ///< A string representing the longest expected width.
35 | };
36 |
37 | #endif // RMV_VIEWS_CUSTOM_WIDGETS_RMV_FIXED_WIDTH_LABEL_H_
38 |
--------------------------------------------------------------------------------
/source/frontend/views/base_pane.h:
--------------------------------------------------------------------------------
1 | //=============================================================================
2 | // Copyright (c) 2018-2025 Advanced Micro Devices, Inc. All rights reserved.
3 | /// @author AMD Developer Tools Team
4 | /// @file
5 | /// @brief Header for the base pane class.
6 | //=============================================================================
7 |
8 | #ifndef RMV_VIEWS_BASE_PANE_H_
9 | #define RMV_VIEWS_BASE_PANE_H_
10 |
11 | #include
12 |
13 | typedef struct RmtDataSnapshot RmtDataSnapshot;
14 |
15 | /// @brief Base class for a pane in the UI.
16 | class BasePane : public QWidget
17 | {
18 | Q_OBJECT
19 |
20 | public:
21 | /// @brief Constructor.
22 | ///
23 | /// @param [in] parent The parent widget.
24 | explicit BasePane(QWidget* parent = nullptr);
25 |
26 | /// @brief Destructor.
27 | virtual ~BasePane();
28 |
29 | /// Open a snapshot.
30 | ///
31 | /// @param [in] snapshot The snapshot to open.
32 | virtual void OpenSnapshot(RmtDataSnapshot* snapshot);
33 |
34 | /// @brief Switch the time units.
35 | virtual void SwitchTimeUnits();
36 |
37 | /// @brief Trace closed.
38 | virtual void OnTraceClose();
39 |
40 | /// @brief Reset the UI.
41 | virtual void Reset();
42 |
43 | /// @brief Change the UI coloring based on the settings.
44 | virtual void ChangeColoring();
45 | };
46 |
47 | #endif // RMV_VIEWS_BASE_PANE_H_
48 |
--------------------------------------------------------------------------------
/.clang-format:
--------------------------------------------------------------------------------
1 | BasedOnStyle: Google
2 | IndentWidth: 4
3 | UseTab: Never
4 | ColumnLimit: 160
5 |
6 | Language: Cpp
7 | AccessModifierOffset: -4
8 | BreakBeforeBraces: Custom
9 | BraceWrapping:
10 | AfterCaseLabel: true
11 | AfterClass: true
12 | AfterControlStatement: true
13 | AfterEnum: true
14 | AfterFunction: true
15 | AfterNamespace: true
16 | AfterObjCDeclaration: true
17 | AfterStruct: true
18 | AfterUnion: true
19 | AfterExternBlock: false
20 | BeforeCatch: true
21 | BeforeElse: true
22 | IndentBraces: false
23 | SplitEmptyFunction: true
24 | SplitEmptyRecord: true
25 | SplitEmptyNamespace: true
26 | ConstructorInitializerAllOnOneLineOrOnePerLine: false
27 | BreakConstructorInitializers: BeforeComma
28 | DerivePointerAlignment: false
29 | IndentCaseLabels: false
30 | NamespaceIndentation: All
31 | AlignConsecutiveAssignments: true
32 | AlignConsecutiveDeclarations: true
33 | AlignEscapedNewlines: Left
34 | AlignTrailingComments: true
35 | AlignOperands: true
36 | AllowShortFunctionsOnASingleLine: None
37 | AllowShortIfStatementsOnASingleLine: false
38 | AllowShortLoopsOnASingleLine: false
39 | AllowShortBlocksOnASingleLine: Never
40 | ReflowComments: false
41 | SortIncludes: CaseSensitive
42 | IncludeBlocks: Preserve
43 | SortUsingDeclarations: false
44 | BinPackArguments: false
45 | BinPackParameters: false
46 | ExperimentalAutoDetectBinPacking: false
47 | AllowAllParametersOfDeclarationOnNextLine: false
48 |
49 |
--------------------------------------------------------------------------------
/source/assets/third_party/ionicons/warning_white.svg:
--------------------------------------------------------------------------------
1 |
2 |
37 |
--------------------------------------------------------------------------------
/source/backend/rmt_configuration.h:
--------------------------------------------------------------------------------
1 | //=============================================================================
2 | // Copyright (c) 2019-2025 Advanced Micro Devices, Inc. All rights reserved.
3 | /// @author AMD Developer Tools Team
4 | /// @file
5 | /// @brief Global configuration values for the RMT backend.
6 | //=============================================================================
7 |
8 | #ifndef RMV_BACKEND_RMT_CONFIGURATION_H_
9 | #define RMV_BACKEND_RMT_CONFIGURATION_H_
10 |
11 | /// The maximum length of a name.
12 | #define RMT_MAXIMUM_NAME_LENGTH (1024)
13 |
14 | /// The maximum number of segments per process.
15 | #define RMT_MAXIMUM_SEGMENTS (8)
16 |
17 | /// The maximum number of entries for a 64GiB memory map at 4KiB page size.
18 | #define RMT_PAGE_TABLE_MAX_SIZE (16777216)
19 |
20 | /// The maximum number of processes that a single RMT file will contain.
21 | #define RMT_MAXIMUM_PROCESS_COUNT (1024)
22 |
23 | /// The maximum number of snapshot points a single RMT file will contain.
24 | #define RMT_MAXIMUM_SNAPSHOT_POINTS (1024)
25 |
26 | /// The maximum nubmer of file path.
27 | #define RMT_MAXIMUM_FILE_PATH (8192)
28 |
29 | /// The maximum number of resource history events that can be analyzed.
30 | #define RMT_MAXIMUM_RESOURCE_HISTORY_EVENTS (32768)
31 |
32 | /// The maximum number of physical addresses that can be associated with a single resource history.
33 | #define RMT_MAXIMUM_RESOURCE_PHYSICAL_ADDRESSES (32768)
34 |
35 | #endif // #ifndef RMV_BACKEND_RMT_CONFIGURATION_H_
36 |
--------------------------------------------------------------------------------
/source/third_party/pevents/src/pevents.h:
--------------------------------------------------------------------------------
1 | /*
2 | * WIN32 Events for POSIX
3 | * Author: Mahmoud Al-Qudsi
4 | * Copyright (C) 2011 - 2022 by NeoSmart Technologies
5 | * SPDX-License-Identifier: MIT
6 | */
7 |
8 | #pragma once
9 |
10 | #if defined(_WIN32) && !defined(CreateEvent)
11 | #error Must include Windows.h prior to including pevents.h!
12 | #endif
13 | #ifndef WAIT_TIMEOUT
14 | #include
15 | #define WAIT_TIMEOUT ETIMEDOUT
16 | #endif
17 |
18 | #include
19 |
20 | namespace neosmart {
21 | // Type declarations
22 | struct neosmart_event_t_;
23 | typedef neosmart_event_t_ *neosmart_event_t;
24 |
25 | // Constant declarations
26 | const uint64_t WAIT_INFINITE = ~((uint64_t)0);
27 |
28 | // Function declarations
29 | neosmart_event_t CreateEvent(bool manualReset = false, bool initialState = false);
30 | int DestroyEvent(neosmart_event_t event);
31 | int WaitForEvent(neosmart_event_t event, uint64_t milliseconds = WAIT_INFINITE);
32 | int SetEvent(neosmart_event_t event);
33 | int ResetEvent(neosmart_event_t event);
34 | #ifdef WFMO
35 | int WaitForMultipleEvents(neosmart_event_t *events, int count, bool waitAll,
36 | uint64_t milliseconds);
37 | int WaitForMultipleEvents(neosmart_event_t *events, int count, bool waitAll,
38 | uint64_t milliseconds, int &index);
39 | #endif
40 | #ifdef PULSE
41 | int PulseEvent(neosmart_event_t event);
42 | #endif
43 | } // namespace neosmart
44 |
--------------------------------------------------------------------------------
/source/parser/rmt_profile.h:
--------------------------------------------------------------------------------
1 | //=============================================================================
2 | // Copyright (c) 2019-2025 Advanced Micro Devices, Inc. All rights reserved.
3 | /// @author AMD Developer Tools Team
4 | /// @file
5 | /// @brief Profile utils.
6 | //=============================================================================
7 |
8 | #ifndef RMV_PARSER_RMT_PROFILE_H_
9 | #define RMV_PARSER_RMT_PROFILE_H_
10 |
11 | #include
12 |
13 | #include "rmt_platform.h"
14 |
15 | #define RMT_PROFILE_START(name) \
16 | const uint64_t name##___freq_value = rmtGetClockFrequency(); \
17 | const uint64_t name##___strt_value = rmtGetCurrentTimestamp();
18 |
19 | #define RMT_PROFILE_STOP(name) \
20 | do \
21 | { \
22 | const uint64_t name##___stop_value = rmtGetCurrentTimestamp(); \
23 | const uint64_t name##___delta = name##___stop_value - name##___strt_value; \
24 | const uint64_t name##___micro = name##___delta * 1000000; \
25 | const uint64_t name##___final = name##___micro / name##___freq_value; \
26 | printf("%" PRIu64 "ms\n", (name##___final / 1000)); \
27 | } while (0)
28 |
29 | #endif // #ifndef RMV_PARSER_RMT_PROFILE_H_
30 |
--------------------------------------------------------------------------------
/source/backend/rmt_adapter_info.cpp:
--------------------------------------------------------------------------------
1 | //=============================================================================
2 | // Copyright (c) 2020-2025 Advanced Micro Devices, Inc. All rights reserved.
3 | /// @author AMD Developer Tools Team
4 | /// @file
5 | /// @brief Helper function for legacy adapter information captured for the target process.
6 | //=============================================================================
7 |
8 | #include "rmt_adapter_info.h"
9 | #include "rmt_assert.h"
10 |
11 | const char* RmtAdapterInfoGetVideoMemoryType(const RmtAdapterInfoMemoryType memory_type)
12 | {
13 | switch (memory_type)
14 | {
15 | case kRmtAdapterInfoMemoryTypeUnknown:
16 | return "Unknown";
17 | case kRmtAdapterInfoMemoryTypeDdr2:
18 | return "DDR2";
19 | case kRmtAdapterInfoMemoryTypeDdr3:
20 | return "DDR3";
21 | case kRmtAdapterInfoMemoryTypeDdr4:
22 | return "DDR4";
23 | case kRmtAdapterInfoMemoryTypeDdr5:
24 | return "DDR5";
25 | case kRmtAdapterInfoMemoryTypeGddr5:
26 | return "GDDR5";
27 | case kRmtAdapterInfoMemoryTypeGddr6:
28 | return "GDDR6";
29 | case kRmtAdapterInfoMemoryTypeHbm:
30 | return "HBM";
31 | case kRmtAdapterInfoMemoryTypeHbm2:
32 | return "HBM2";
33 | case kRmtAdapterInfoMemoryTypeHbm3:
34 | return "HBM3";
35 | case kRmtAdapterInfoMemoryTypeLpddr4:
36 | return "LPDDR4";
37 | case kRmtAdapterInfoMemoryTypeLpddr5:
38 | return "LPDDR5";
39 |
40 | default:
41 | return "";
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/source/parser/rmt_platform.h:
--------------------------------------------------------------------------------
1 | //=============================================================================
2 | // Copyright (c) 2019-2025 Advanced Micro Devices, Inc. All rights reserved.
3 | /// @author AMD Developer Tools Team
4 | /// @file
5 | /// @brief Platform specific utilities.
6 | //=============================================================================
7 |
8 | #ifndef RMV_PARSER_RMT_PLATFORM_H_
9 | #define RMV_PARSER_RMT_PLATFORM_H_
10 |
11 | #include
12 |
13 | #ifdef _WIN32
14 | #define RMT_FORCEINLINE __forceinline
15 | #else
16 | #define RMT_FORCEINLINE __attribute__((always_inline)) inline
17 | #endif // #ifdef _WIN32
18 |
19 | #ifdef _WIN32
20 | #define RMT_UNUSED_FUNC
21 | #else
22 | #define RMT_UNUSED_FUNC __attribute__((unused))
23 | #endif
24 |
25 | #ifdef __cplusplus
26 | extern "C" {
27 | #endif // #ifdef __cplusplus
28 |
29 | /// Utility function to get the clock frequency.
30 | ///
31 | /// @returns
32 | /// The current clock frquency of the CPU.
33 | ///
34 | uint64_t RmtGetClockFrequency();
35 |
36 | /// Utility function to get the current timestamp.
37 | ///
38 | /// @returns
39 | /// The current clock frquency of the CPU.
40 | ///
41 | uint64_t RmtGetCurrentTimestamp();
42 |
43 | /// Utility function to sleep.
44 | ///
45 | /// @param [in] timeout The sleep time, in milliseconds.
46 | ///
47 | /// @returns
48 | /// The current clock frquency of the CPU.
49 | ///
50 | void RmtSleep(uint32_t timeout);
51 |
52 | #ifdef __cplusplus
53 | }
54 | #endif // #ifdef __cplusplus
55 | #endif // #ifndef RMV_PARSER_RMT_PLATFORM_H_
56 |
--------------------------------------------------------------------------------
/source/frontend/util/version.h.in:
--------------------------------------------------------------------------------
1 | //=============================================================================
2 | // Copyright (c) 2018-@YEAR@ Advanced Micro Devices, Inc. All rights reserved.
3 | /// @author AMD Developer Tools Team
4 | /// @file
5 | /// @brief Version number info for RMV
6 | //=============================================================================
7 |
8 | #ifndef RMV_VERSION_H
9 | #define RMV_VERSION_H
10 |
11 | #define STRINGIFY_MACRO_(a) #a
12 | #define STRINGIFY_MACRO(a) STRINGIFY_MACRO_(a)
13 | #define STRINGIFY_VERSION(major, minor, patch, build) \
14 | STRINGIFY_MACRO(major) "." STRINGIFY_MACRO(minor) "." STRINGIFY_MACRO(patch) "." STRINGIFY_MACRO(build)
15 |
16 | #define RMV_APP_NAME "Radeon Memory Visualizer" ///< Application name.
17 | #define RMV_BUILD_SUFFIX "" ///< The build suffix to apply to the product name.(alpha, beta etc.)
18 | #define RMV_MAJOR_VERSION @RMV_MAJOR_VERSION@ ///< The major version number.
19 | #define RMV_MINOR_VERSION @RMV_MINOR_VERSION@ ///< The minor version number.
20 | #define RMV_BUGFIX_NUMBER @RMV_BUGFIX_NUMBER@ ///< The bugfix number.
21 | #define RMV_BUILD_NUMBER @RMV_BUILD_NUMBER@ ///< The build number.
22 | #define RMV_BUILD_DATE_STRING @DATE@ ///< The build date string.
23 | #define RMV_BUILD_CURRENT_YEAR @YEAR_STRING@ ///< The current year.
24 |
25 | #define RMV_VERSION_STRING STRINGIFY_VERSION(RMV_MAJOR_VERSION, RMV_MINOR_VERSION, RMV_BUGFIX_NUMBER, RMV_BUILD_NUMBER)
26 | #define RMV_COPYRIGHT_STRING "Copyright (C) 2018-" RMV_BUILD_CURRENT_YEAR " Advanced Micro Devices, Inc. All rights reserved."
27 |
28 | #endif // RMV_VERSION_H
29 |
--------------------------------------------------------------------------------
/source/frontend/settings/rmv_geometry_settings.h:
--------------------------------------------------------------------------------
1 | //=============================================================================
2 | // Copyright (c) 2017-2025 Advanced Micro Devices, Inc. All rights reserved.
3 | /// @author AMD Developer Tools Team
4 | /// @file
5 | /// @brief Define the window geometry settings.
6 | //=============================================================================
7 |
8 | #ifndef RMV_SETTINGS_RMV_GEOMETRY_SETTINGS_H_
9 | #define RMV_SETTINGS_RMV_GEOMETRY_SETTINGS_H_
10 |
11 | #include
12 |
13 | #include "settings/rmv_settings.h"
14 |
15 | namespace rmv
16 | {
17 | class RMVGeometrySettings
18 | {
19 | public:
20 | /// @brief Constructor.
21 | RMVGeometrySettings();
22 |
23 | /// @brief Destructor.
24 | ~RMVGeometrySettings();
25 |
26 | /// @brief Saves a widget's position, size and state in the settings file as a hex string.
27 | ///
28 | /// @param [in] widget Pointer to the widget who's geometry is to be saved.
29 | static void Save(QWidget* widget);
30 |
31 | /// @brief Updates a widget's position, size and state from the settings file.
32 | ///
33 | /// @param [in] widget Pointer to the widget who's geometry is to be restored.
34 | static bool Restore(QWidget* widget);
35 |
36 | /// @brief Adjust a widget's geometry so that it fits on a single monitor.
37 | ///
38 | /// @param [in] widget Pointer to the widget who's geometry is to be adjusted.
39 | static void Adjust(QWidget* widget);
40 | };
41 | } // namespace rmv
42 |
43 | #endif // RMV_SETTINGS_RMV_GEOMETRY_SETTINGS_H_
44 |
--------------------------------------------------------------------------------
/source/frontend/views/custom_widgets/rmv_carousel_memory_footprint.cpp:
--------------------------------------------------------------------------------
1 | //=============================================================================
2 | // Copyright (c) 2018-2025 Advanced Micro Devices, Inc. All rights reserved.
3 | /// @author AMD Developer Tools Team
4 | /// @file
5 | /// @brief Implementation of the carousel memory footprint widget.
6 | //=============================================================================
7 |
8 | #include "views/custom_widgets/rmv_carousel_memory_footprint.h"
9 |
10 | #include
11 |
12 | static const int kBarWidth = 20;
13 | static const int kEdgeMargin = 10;
14 |
15 | RMVCarouselMemoryFootprint::RMVCarouselMemoryFootprint(const RMVCarouselConfig& config)
16 | : RMVCarouselItem(config)
17 | , data_{}
18 | {
19 | }
20 |
21 | RMVCarouselMemoryFootprint::~RMVCarouselMemoryFootprint()
22 | {
23 | }
24 |
25 | void RMVCarouselMemoryFootprint::paint(QPainter* painter, const QStyleOptionGraphicsItem* item, QWidget* widget)
26 | {
27 | Q_UNUSED(item);
28 | Q_UNUSED(widget);
29 |
30 | DrawCarouselBaseComponents(painter, "Virtual memory");
31 |
32 | int bar_length = config_.width - (2 * kEdgeMargin);
33 | DrawHorizontalBarComponent(painter, "Bound virtual memory", kEdgeMargin, 80, bar_length, kBarWidth, data_.total_allocated_memory, data_.max_memory, true);
34 | DrawHorizontalBarComponent(painter, "Unbound virtual memory", kEdgeMargin, 170, bar_length, kBarWidth, data_.total_unused_memory, data_.max_memory, true);
35 | }
36 |
37 | void RMVCarouselMemoryFootprint::SetData(const rmv::RMVCarouselData& data)
38 | {
39 | data_ = data.memory_footprint_data;
40 | update();
41 | }
42 |
--------------------------------------------------------------------------------
/source/parser/rmt_platform.cpp:
--------------------------------------------------------------------------------
1 | //=============================================================================
2 | // Copyright (c) 2019-2025 Advanced Micro Devices, Inc. All rights reserved.
3 | /// @author AMD Developer Tools Team
4 | /// @file
5 | /// @brief Implementation of platform-specific utils.
6 | //=============================================================================
7 |
8 | #include "rmt_platform.h"
9 |
10 | #ifdef _WIN32
11 | #define WIN32_LEAN_AND_MEAN
12 | #include
13 | #else
14 | #include
15 | #endif /* #ifdef _WIN32 */
16 |
17 | static const uint64_t kOneBillion = 1000000000;
18 |
19 | uint64_t RmtGetClockFrequency()
20 | {
21 | #ifdef _WIN32
22 | LARGE_INTEGER freq = {0};
23 | QueryPerformanceFrequency(&freq);
24 | return (uint64_t)freq.QuadPart;
25 | #else
26 | // clock_gettime on Linux is always in nanoseconds
27 | return kOneBillion;
28 | #endif /* #ifdef _WIN32 */
29 | }
30 |
31 | uint64_t RmtGetCurrentTimestamp()
32 | {
33 | #ifdef _WIN32
34 | LARGE_INTEGER clock_value = {0};
35 | QueryPerformanceCounter(&clock_value);
36 | return (uint64_t)clock_value.QuadPart;
37 | #else
38 | struct timespec clock_value;
39 | clock_gettime(CLOCK_REALTIME, &clock_value);
40 | return (clock_value.tv_sec * kOneBillion) + clock_value.tv_nsec;
41 | #endif /* #ifdef _WIN32 */
42 | }
43 |
44 | void RmtSleep(uint32_t timeout)
45 | {
46 | #ifdef WIN32
47 | Sleep(timeout);
48 | #else
49 | timespec time;
50 | const time_t sec = static_cast(timeout / 1000);
51 | time.tv_sec = sec;
52 | time.tv_nsec = (timeout - (sec * 1000)) * 1000000;
53 | nanosleep(&time, nullptr);
54 | #endif
55 | }
56 |
--------------------------------------------------------------------------------
/source/backend/rmt_linear_buffer.cpp:
--------------------------------------------------------------------------------
1 | //=============================================================================
2 | // Copyright (c) 2019-2025 Advanced Micro Devices, Inc. All rights reserved.
3 | /// @author AMD Developer Tools Team
4 | /// @file
5 | /// @brief Implementation of the linear allocator helper functions.
6 | //=============================================================================
7 |
8 | #include "rmt_linear_buffer.h"
9 | #include "rmt_assert.h"
10 |
11 | RmtErrorCode RmtAllocLinearBufferInitialize(RmtAllocLinearBuffer* linear_buffer, void* buffer, size_t buffer_size)
12 | {
13 | RMT_RETURN_ON_ERROR(linear_buffer && buffer, kRmtErrorInvalidPointer);
14 |
15 | linear_buffer->buffer_base = buffer;
16 | linear_buffer->buffer_size = buffer_size;
17 | linear_buffer->offset = 0;
18 | return kRmtOk;
19 | }
20 |
21 | void* RmtAllocLinearBufferAllocate(RmtAllocLinearBuffer* linear_buffer, size_t size)
22 | {
23 | RMT_ASSERT_MESSAGE(linear_buffer, "Parameter linearBuffer is NULL.");
24 | RMT_RETURN_ON_ERROR(linear_buffer, NULL);
25 | // check there is enough space in the buffer for the allocation.
26 | RMT_RETURN_ON_ERROR((linear_buffer->offset + size) <= linear_buffer->buffer_size, NULL);
27 |
28 | const uintptr_t address = (uintptr_t)linear_buffer->buffer_base + linear_buffer->offset;
29 | linear_buffer->offset += size;
30 | return (void*)address;
31 | }
32 |
33 | void* RmtAllocLinearBufferGetBaseAddress(RmtAllocLinearBuffer* linear_buffer)
34 | {
35 | RMT_ASSERT_MESSAGE(linear_buffer, "Parameter linearBuffer is NULL.");
36 | RMT_RETURN_ON_ERROR(linear_buffer, NULL);
37 |
38 | return linear_buffer->buffer_base;
39 | }
40 |
--------------------------------------------------------------------------------
/source/backend/rmt_data_profile.h:
--------------------------------------------------------------------------------
1 | //=============================================================================
2 | // Copyright (c) 2019-2025 Advanced Micro Devices, Inc. All rights reserved.
3 | /// @author AMD Developer Tools Team
4 | /// @file
5 | /// @brief Structures for profiling the RMT data for future parsing.
6 | //=============================================================================
7 |
8 | #ifndef RMV_BACKEND_RMT_DATA_PROFILE_H_
9 | #define RMV_BACKEND_RMT_DATA_PROFILE_H_
10 |
11 | #include
12 |
13 | #ifdef __cplusplus
14 | extern "C" {
15 | #endif // #ifdef __cplusplus
16 |
17 | /// A structure encapsulating a profile of an RMT file.
18 | typedef struct RmtDataProfile
19 | {
20 | int32_t process_count; ///< The number of processes seen in the RMT streams.
21 | int32_t stream_count; ///< The number of RMT streams.
22 | int32_t snapshot_count; ///< The number of snapshots in the RMT streams.
23 | int32_t snapshot_name_count; ///< The number of bytes required to store all snapshot names.
24 | int32_t current_virtual_allocation_count;
25 | int32_t max_virtual_allocation_count; ///< The maximum number of allocations seen concurrently.
26 | int32_t current_resource_count;
27 | int32_t max_concurrent_resources; ///< The maximum number of resources seen concurrently.
28 | int32_t total_resource_count; ///< The total number of resources seent at any time.
29 | int32_t total_virtual_allocation_count; ///< The total number of virtual allocations seen at any time.
30 |
31 | } RmtDataProfile;
32 |
33 | #ifdef __cplusplus
34 | }
35 | #endif // #ifdef __cplusplus
36 | #endif // #ifndef RMV_BACKEND_RMT_DATA_PROFILE_H_
37 |
--------------------------------------------------------------------------------
/source/frontend/views/delegates/rmv_regular_expression_validator.cpp:
--------------------------------------------------------------------------------
1 | //=============================================================================
2 | // Copyright (c) 2019-2025 Advanced Micro Devices, Inc. All rights reserved.
3 | /// @author AMD Developer Tools Team
4 | /// @file
5 | /// @brief Implementation of the regular expression validator with tooltip support.
6 | //=============================================================================
7 |
8 | #include "rmv_regular_expression_validator.h"
9 |
10 | #include
11 | #include
12 |
13 | RMVRegularExpressionValidator::RMVRegularExpressionValidator(const QRegularExpression& regular_expression, QObject* parent)
14 | : QRegularExpressionValidator(regular_expression, parent)
15 | {
16 | }
17 |
18 | RMVRegularExpressionValidator::~RMVRegularExpressionValidator()
19 | {
20 | }
21 |
22 | QValidator::State RMVRegularExpressionValidator::validate(QString& input, int& position) const
23 | {
24 | QValidator::State result = QValidator::Intermediate;
25 |
26 | result = QRegularExpressionValidator::validate(input, position);
27 |
28 | if (result == QValidator::Invalid)
29 | {
30 | QWidget* widget = qobject_cast(parent());
31 | if (widget != nullptr)
32 | {
33 | QPoint tool_tip_position;
34 | tool_tip_position.setY(widget->sizeHint().height());
35 | QToolTip::showText(widget->mapToGlobal(tool_tip_position), invalid_input_message_);
36 | }
37 | }
38 | else
39 | {
40 | QToolTip::hideText();
41 | }
42 |
43 | return result;
44 | }
45 |
46 | void RMVRegularExpressionValidator::SetInvalidInputMessage(const QString& text)
47 | {
48 | invalid_input_message_ = text;
49 | }
50 |
--------------------------------------------------------------------------------
/source/frontend/views/timeline/device_configuration_pane.h:
--------------------------------------------------------------------------------
1 | //=============================================================================
2 | // Copyright (c) 2020-2025 Advanced Micro Devices, Inc. All rights reserved.
3 | /// @author AMD Developer Tools Team
4 | /// @file
5 | /// @brief Header for the device configuration pane.
6 | //=============================================================================
7 |
8 | #ifndef RMV_VIEWS_TIMELINE_DEVICE_CONFIGURATION_PANE_H_
9 | #define RMV_VIEWS_TIMELINE_DEVICE_CONFIGURATION_PANE_H_
10 |
11 | #include
12 |
13 | #include "ui_device_configuration_pane.h"
14 |
15 | #include "models/timeline/device_configuration_model.h"
16 | #include "views/base_pane.h"
17 |
18 | /// @brief Class declaration.
19 | class DeviceConfigurationPane : public BasePane
20 | {
21 | Q_OBJECT
22 |
23 | public:
24 | /// @brief Constructor.
25 | ///
26 | /// @param [in] parent The parent widget.
27 | explicit DeviceConfigurationPane(QWidget* parent = nullptr);
28 |
29 | /// @brief Destructor.
30 | ~DeviceConfigurationPane();
31 |
32 | /// @brief Overridden Qt show event. Fired when this pane is opened.
33 | ///
34 | /// @param [in] event The show event object.
35 | virtual void showEvent(QShowEvent* event) Q_DECL_OVERRIDE;
36 |
37 | /// @brief Reset UI state.
38 | virtual void Reset() Q_DECL_OVERRIDE;
39 |
40 | private:
41 | /// @brief Refresh the UI.
42 | void Refresh();
43 |
44 | /// @brief Update the pane based on the color theme.
45 | void OnColorThemeUpdated();
46 |
47 | Ui::DeviceConfigurationPane* ui_; ///< Pointer to the Qt UI design.
48 | rmv::DeviceConfigurationModel* model_; ///< The model for this pane.
49 | };
50 |
51 | #endif // RMV_VIEWS_TIMELINE_DEVICE_CONFIGURATION_PANE_H_
52 |
--------------------------------------------------------------------------------
/documentation/source/resource_naming.rst:
--------------------------------------------------------------------------------
1 | Resource naming
2 | ===============
3 |
4 | Vulkan resource naming
5 | ----------------------
6 | Pipelines, images and buffers can be given unique names and these names will
7 | show up in the RMV UI. The Vulkan extension VK_EXT_debug_utils can be used for this.
8 |
9 | For more information, see the document:
10 |
11 | https://www.lunarg.com/wp-content/uploads/2018/05/Vulkan-Debug-Utils_05_18_v1.pdf
12 |
13 | specifically the section "Naming Objects"
14 |
15 | DirectX 12 resource naming
16 | --------------------------
17 | Memory traces for DirectX applications captured with the Radeon Developer Panel
18 | can include unique names for resources like heaps, buffers and textures. Names can be assigned to
19 | DirectX resources using the ``ID3D12Object::SetName()`` method.
20 | For more information, please review the Microsoft DirectX 12 documentation.
21 |
22 | Calling the ``SetName()``
23 | method results in ETW (Event Tracing for Windows) events being emitted and picked
24 | up by the Panel. This resource naming information is then included in the RMV trace
25 | file.
26 |
27 | Due to the asynchronous nature of the event tracing, memory events that happen a short time before the process exit
28 | may show up incorrectly in RMV in terms of naming, as well as
29 | marking and filtering out implicit heaps (created for committed resources)
30 | and implicit buffers (that D3D12 runtime creates automatically for every explicitly created heap).
31 | To overcome this problem, it is recommended to introduce a delay of few seconds
32 | between memory events of interest and the process exit.
33 |
34 | Viewing resource names
35 | ----------------------
36 | The resource names will show up in the RMV UI in the resource list pane, for example:
37 |
38 | .. image:: media/vk_resource_naming_1.png
39 |
40 |
--------------------------------------------------------------------------------
/source/frontend/models/proxy_models/memory_leak_finder_proxy_model.cpp:
--------------------------------------------------------------------------------
1 | //=============================================================================
2 | // Copyright (c) 2018-2025 Advanced Micro Devices, Inc. All rights reserved.
3 | /// @author AMD Developer Tools Team
4 | /// @file
5 | /// @brief Implementation of a proxy filter that processes multiple columns.
6 | //=============================================================================
7 |
8 | #include "models/proxy_models/memory_leak_finder_proxy_model.h"
9 |
10 | #include "rmt_assert.h"
11 |
12 | #include "models/resource_item_model.h"
13 |
14 | namespace rmv
15 | {
16 | MemoryLeakFinderProxyModel::MemoryLeakFinderProxyModel(uint32_t compare_id_filter, QObject* parent)
17 | : ResourceProxyModel(parent)
18 | , compare_id_filter_(compare_id_filter)
19 | {
20 | }
21 |
22 | MemoryLeakFinderProxyModel::~MemoryLeakFinderProxyModel()
23 | {
24 | }
25 |
26 | void MemoryLeakFinderProxyModel::UpdateCompareFilter(SnapshotCompareId compare_filter)
27 | {
28 | compare_id_filter_ = compare_filter;
29 | }
30 |
31 | bool MemoryLeakFinderProxyModel::filterAcceptsRow(int source_row, const QModelIndex& source_parent) const
32 | {
33 | bool pass = ResourceProxyModel::filterAcceptsRow(source_row, source_parent);
34 |
35 | if (pass)
36 | {
37 | QModelIndex index = sourceModel()->index(source_row, kResourceColumnCompareId, source_parent);
38 |
39 | QString index_data = index.data().toString();
40 |
41 | bool ok = false;
42 | const uint32_t compare_id = index_data.toULong(&ok, 0);
43 |
44 | pass = ((compare_id_filter_ & compare_id) != 0U);
45 | }
46 |
47 | return pass;
48 | }
49 | } // namespace rmv
50 |
--------------------------------------------------------------------------------
/source/frontend/views/custom_widgets/themes_and_colors_item_button.h:
--------------------------------------------------------------------------------
1 | //=============================================================================
2 | // Copyright (c) 2020-2025 Advanced Micro Devices, Inc. All rights reserved.
3 | /// @author AMD Developer Tools Team
4 | /// @file
5 | /// @brief Header for a helper class for custom button rendering for the
6 | /// themes and colors pane.
7 | //=============================================================================
8 |
9 | #ifndef RMV_VIEWS_CUSTOM_WIDGETS_THEMES_AND_COLORS_ITEM_BUTTON_H_
10 | #define RMV_VIEWS_CUSTOM_WIDGETS_THEMES_AND_COLORS_ITEM_BUTTON_H_
11 |
12 | #include "qt_common/custom_widgets/scaled_push_button.h"
13 |
14 | /// @brief Helper class for custom button rendering.
15 | class ThemesAndColorsItemButton : public ScaledPushButton
16 | {
17 | public:
18 | /// @brief Constructor.
19 | ///
20 | /// @param [in] parent The parent widget.
21 | explicit ThemesAndColorsItemButton(QWidget* parent = nullptr);
22 |
23 | /// @brief Destructor.
24 | virtual ~ThemesAndColorsItemButton();
25 |
26 | /// @brief Themes and colors button color setter.
27 | ///
28 | /// Stores color and font color values for use in custom drawing.
29 | ///
30 | /// @param [in] color The color to set.
31 | void SetColor(const QColor& color);
32 |
33 | /// @brief Themes and colors button paint event.
34 | ///
35 | /// Overrides button draw function to implement custom drawing functionality.
36 | ///
37 | /// @param [in] event Qt paint event.
38 | virtual void paintEvent(QPaintEvent* event) Q_DECL_OVERRIDE;
39 |
40 | private:
41 | QColor button_color_; ///< Color of this button.
42 | QColor font_color_; ///< Font color of this button.
43 | };
44 |
45 | #endif // RMV_VIEWS_CUSTOM_WIDGETS_THEMES_AND_COLORS_ITEM_BUTTON_H_
46 |
--------------------------------------------------------------------------------
/source/parser/rmt_util.h:
--------------------------------------------------------------------------------
1 | //=============================================================================
2 | // Copyright (c) 2019-2025 Advanced Micro Devices, Inc. All rights reserved.
3 | /// @author AMD Developer Tools Team
4 | /// @file
5 | /// @brief Utility macro definitions.
6 | //=============================================================================
7 |
8 | #ifndef RMV_PARSER_RMT_UTIL_H_
9 | #define RMV_PARSER_RMT_UTIL_H_
10 |
11 | /// Helper macro to avoid warnings about unused variables.
12 | #define RMT_UNUSED(x) ((void)(x))
13 |
14 | /// Helper macro to align an integer to the specified power of 2 boundary
15 | #define RMT_ALIGN_UP(x, y) (((x) + ((y) - 1)) & ~((y) - 1))
16 |
17 | /// Helper macro to check if a value is aligned.
18 | #define RMT_IS_ALIGNED(x) (((x) != 0) && ((x) & ((x) - 1)))
19 |
20 | /// Helper macro to stringify a value.
21 | #define RMT_STR(s) RMT_XSTR(s)
22 | #define RMT_XSTR(s) #s
23 |
24 | /// Helper macro to forward declare a structure.
25 | #define RMT_FORWARD_DECLARE(x) typedef struct x x
26 |
27 | /// Helper macro to return the maximum of two values.
28 | #define RMT_MAXIMUM(x, y) (((x) > (y)) ? (x) : (y))
29 |
30 | /// Helper macro to return the minimum of two values.
31 | #define RMT_MINIMUM(x, y) (((x) < (y)) ? (x) : (y))
32 |
33 | /// Helper macro to do safe free on a pointer.
34 | #define RMT_SAFE_FREE(x) \
35 | if (x) \
36 | free(x)
37 |
38 | /// Helper macro to return the abs of an integer value.
39 | #define RMT_ABSOLUTE(x) (((x) < 0) ? (-(x)) : (x))
40 |
41 | /// Helper macro to return sign of a value.
42 | #define RMT_SIGN(x) (((x) < 0) ? -1 : 1)
43 |
44 | /// Helper macro to work out the number of elements in an array.
45 | #define RMT_ARRAY_ELEMENTS(x) (int32_t)((sizeof(x) / sizeof(0 [x])) / ((size_t)(!(sizeof(x) % sizeof(0 [x])))))
46 |
47 | #endif // #ifndef RMV_PARSER_RMT_UTIL_H_
48 |
--------------------------------------------------------------------------------
/source/frontend/views/snapshot/heap_overview_pane.h:
--------------------------------------------------------------------------------
1 | //=============================================================================
2 | // Copyright (c) 2018-2025 Advanced Micro Devices, Inc. All rights reserved.
3 | /// @author AMD Developer Tools Team
4 | /// @file
5 | /// @brief Header for the Heap Overview pane.
6 | //=============================================================================
7 |
8 | #ifndef RMV_VIEWS_SNAPSHOT_HEAP_OVERVIEW_PANE_H_
9 | #define RMV_VIEWS_SNAPSHOT_HEAP_OVERVIEW_PANE_H_
10 |
11 | #include "ui_heap_overview_pane.h"
12 |
13 | #include "views/base_pane.h"
14 |
15 | /// @brief Class declaration.
16 | class HeapOverviewPane : public BasePane
17 | {
18 | Q_OBJECT
19 |
20 | public:
21 | /// @brief Constructor.
22 | ///
23 | /// @param [in] parent The parent widget.
24 | explicit HeapOverviewPane(QWidget* parent = nullptr);
25 |
26 | /// @brief Destructor.
27 | virtual ~HeapOverviewPane();
28 |
29 | /// @brief Open a snapshot.
30 | ///
31 | /// @param [in] snapshot The snapshot to open.
32 | virtual void OpenSnapshot(RmtDataSnapshot* snapshot) Q_DECL_OVERRIDE;
33 |
34 | protected:
35 | /// @brief Overridden show event. Fired when this pane is opened.
36 | ///
37 | /// @param [in] event the show event object.
38 | virtual void showEvent(QShowEvent* event) Q_DECL_OVERRIDE;
39 |
40 | /// @brief Overridden window resize event.
41 | ///
42 | /// @param [in] event the resize event object.
43 | virtual void resizeEvent(QResizeEvent* event) Q_DECL_OVERRIDE;
44 |
45 | private:
46 | /// @brief Refresh what's visible on the UI.
47 | void Refresh();
48 |
49 | /// @brief Resize all relevant UI items.
50 | void ResizeItems();
51 |
52 | Ui::HeapOverviewPane* ui_; ///< Pointer to the Qt UI design.
53 | };
54 |
55 | #endif // RMV_VIEWS_SNAPSHOT_HEAP_OVERVIEW_PANE_H_
56 |
--------------------------------------------------------------------------------
/documentation/source/compare_windows.rst:
--------------------------------------------------------------------------------
1 | Compare windows
2 | ===============
3 |
4 | These panes allow the user to compare snapshots to see how allocations and
5 | resources have changed over time.
6 |
7 | Snapshot delta
8 | --------------
9 |
10 | The snapshot delta gives a high level overview of the differences between two
11 | snapshots. It shows the difference in the number of allocations and resources
12 | for each heap type.
13 |
14 | The carousel works in a similar way to the carousel in the **Resource list** pane
15 | but now shows the differences between the 2 snapshots, indicating such things as
16 | whether memory consumption has gone up or down.
17 |
18 | The "**Switch snapshots**" button in the top right corner under the settings
19 | tab can be used to switch the snapshots.
20 |
21 | .. image:: media/compare/snapshot_delta_1.png
22 |
23 | Memory leak finder
24 | ------------------
25 |
26 | This pane shows the list of resources from both snapshots and allows them to be
27 | filtered depending on whether they are unique to one snapshot or present in
28 | both. This filtering can be achieved using the 3 checkboxes at the top. For example,
29 | just selecting the middle checkbox will show resources common to both snapshots.
30 | Underneath each checkbox is a summary of the number of resources that the checkbox
31 | represents and the total amount of memory used for that checkbox. For example, the
32 | left-most checkbox will show resources that are only present in the first snapshot.
33 |
34 | As with the other panes, search strings and the "**Filter by size**" slider can be
35 | used to narrow down the list of resources.
36 |
37 | Double-clicking on a resource will navigate to the **Resource details** pane and
38 | allow the snapshot to be viewed in the SNAPSHOT tab. If a resource is common to
39 | both snapshots, the base snapshot will be used.
40 |
41 | .. image:: media/compare/memory_leak_finder_1.png
42 |
43 |
44 |
--------------------------------------------------------------------------------
/source/frontend/resources.qrc:
--------------------------------------------------------------------------------
1 |
2 |
3 | ../assets/amd_logo.svg
4 | ../assets/amd_logo_white.svg
5 | ../assets/arrow_gray_left.svg
6 | ../assets/arrow_gray_right.svg
7 | ../assets/browse_back_normal.svg
8 | ../assets/browse_back_pressed.svg
9 | ../assets/browse_back_disabled.svg
10 | ../assets/browse_fwd_normal.svg
11 | ../assets/browse_fwd_pressed.svg
12 | ../assets/browse_fwd_disabled.svg
13 | ../assets/checkbox_on_gray.svg
14 | ../assets/checkbox_off_gray.svg
15 | ../assets/checkbox_on.svg
16 | ../assets/checkbox_off.svg
17 | ../assets/pulldown_off_gray.svg
18 | ../assets/pulldown_on_gray.svg
19 | ../assets/rmv_icon_32x32.png
20 | ../assets/rmv_icon_48x48.png
21 | ../assets/stop_128x128.png
22 | ../assets/zoom_in.svg
23 | ../assets/zoom_in_disabled.svg
24 | ../assets/zoom_out.svg
25 | ../assets/zoom_out_disabled.svg
26 | ../assets/zoom_to_selection.svg
27 | ../assets/zoom_to_selection_disabled.svg
28 | ../assets/zoom_reset.svg
29 | ../assets/zoom_reset_disabled.svg
30 | ../assets/third_party/ionicons/search_icon.png
31 | ../assets/third_party/ionicons/warning.svg
32 | ../assets/third_party/ionicons/warning_white.svg
33 | dark_mode_stylesheet.qss
34 | light_mode_stylesheet.qss
35 | stylesheet.qss
36 |
37 |
38 |
--------------------------------------------------------------------------------
/source/frontend/settings/settings_reader.h:
--------------------------------------------------------------------------------
1 | //=============================================================================
2 | // Copyright (c) 2018-2025 Advanced Micro Devices, Inc. All rights reserved.
3 | /// @author AMD Developer Tools Team
4 | /// @file
5 | /// @brief Header for the XML settings reader.
6 | //=============================================================================
7 |
8 | #ifndef RMV_SETTINGS_SETTINGS_READER_H_
9 | #define RMV_SETTINGS_SETTINGS_READER_H_
10 |
11 | #include
12 | #include
13 |
14 | #include "settings/rmv_settings.h"
15 |
16 | namespace rmv
17 | {
18 | /// @brief Support for the XML settings reader.
19 | class SettingsReader
20 | {
21 | public:
22 | /// @brief Constructor.
23 | ///
24 | /// @param [in] settings Output settings class.
25 | explicit SettingsReader(RMVSettings* settings);
26 |
27 | /// @brief Destructor.
28 | ~SettingsReader();
29 |
30 | /// @brief Begin reading the XML file and make sure it's valid.
31 | ///
32 | /// @param [in] device The XML file represented by a Qt IO device.
33 | bool Read(QIODevice* device);
34 |
35 | private:
36 | /// @brief Read global settings and recently used files section.
37 | void ReadSettingsAndRecents();
38 |
39 | /// @brief Read settings list.
40 | void ReadSettings();
41 |
42 | /// @brief Read individual settings.
43 | void ReadSetting();
44 |
45 | /// @brief Read recently opened file list.
46 | void ReadRecentFiles();
47 |
48 | /// @brief Read individual recently opened files.
49 | void ReadRecentFile();
50 |
51 | QXmlStreamReader reader_; ///< Qt's XML stream.
52 | RMVSettings* settings_; ///< Belongs to the caller, not this class.
53 | };
54 | } // namespace rmv
55 |
56 | #endif // RMV_SETTINGS_SETTINGS_READER_H_
57 |
--------------------------------------------------------------------------------
/source/frontend/views/delegates/rmv_snapshot_name_delegate.h:
--------------------------------------------------------------------------------
1 | //=============================================================================
2 | // Copyright (c) 2019-2025 Advanced Micro Devices, Inc. All rights reserved.
3 | /// @author AMD Developer Tools Team
4 | /// @file
5 | /// @brief Header of the name delegate for the snapshot table.
6 | //=============================================================================
7 |
8 | #ifndef RMV_VIEWS_DELEGATES_RMV_SNAPSHOT_NAME_DELEGATE_H_
9 | #define RMV_VIEWS_DELEGATES_RMV_SNAPSHOT_NAME_DELEGATE_H_
10 |
11 | #include
12 |
13 | /// Support for the snapshot name delegate.
14 | class RMVSnapshotNameDelegate : public QStyledItemDelegate
15 | {
16 | Q_OBJECT
17 |
18 | public:
19 | /// @brief Constructor.
20 | ///
21 | /// @param [in] parent The delegate's parent.
22 | explicit RMVSnapshotNameDelegate(QWidget* parent = nullptr);
23 |
24 | /// @brief Destructor.
25 | virtual ~RMVSnapshotNameDelegate();
26 |
27 | /// @brief Override to handle creating an editor widget.
28 | ///
29 | /// @param [in] parent The delegate's parent.
30 | /// @param [in] option The style properties for the editor widget.
31 | /// @param [in] index The model index requesting an edit widget.
32 | ///
33 | /// @return The edit widget.
34 | QWidget* createEditor(QWidget* parent, const QStyleOptionViewItem& option, const QModelIndex& index) const Q_DECL_OVERRIDE;
35 |
36 | /// @brief Override to update the model with data from the edit widget.
37 | ///
38 | /// @param [in] editor The edit widget.
39 | /// @param [in] model The model to be updated.
40 | /// @param [in] index The index of the cell in the model to be updated.
41 | virtual void setModelData(QWidget* editor, QAbstractItemModel* model, const QModelIndex& index) const Q_DECL_OVERRIDE;
42 | };
43 |
44 | #endif // RMV_VIEWS_DELEGATES_RMV_SNAPSHOT_NAME_DELEGATE_H_
45 |
--------------------------------------------------------------------------------
/source/parser/rmt_rdf_adapter_info.cpp:
--------------------------------------------------------------------------------
1 | //=============================================================================
2 | // Copyright (c) 2022-2025 Advanced Micro Devices, Inc. All rights reserved.
3 | /// @author AMD Developer Tools Team
4 | /// @file
5 | /// @brief Implementation of the RFD Adapter Information chunk parser.
6 | //=============================================================================
7 |
8 | #include "rmt_rdf_adapter_info.h"
9 |
10 | #include "rdf/rdf/inc/amdrdf.h"
11 |
12 | RmtRdfAdapterInfo::RmtRdfAdapterInfo()
13 | : adapter_info_{0}
14 | , chunk_data_valid_(false)
15 | {
16 | }
17 |
18 | RmtRdfAdapterInfo::~RmtRdfAdapterInfo()
19 | {
20 | }
21 |
22 | bool RmtRdfAdapterInfo::LoadChunk(rdf::ChunkFile& chunk_file)
23 | {
24 | bool retVal = false;
25 |
26 | const auto identifier = ChunkIdentifier();
27 |
28 | chunk_data_valid_ = false;
29 | if (!chunk_file.ContainsChunk(identifier))
30 | {
31 | return false;
32 | }
33 |
34 | const auto chunk_count = chunk_file.GetChunkCount(identifier);
35 | if (chunk_count != 1)
36 | {
37 | return false;
38 | }
39 |
40 | uint64_t header_size = chunk_file.GetChunkHeaderSize(identifier);
41 | uint64_t payload_size = chunk_file.GetChunkDataSize(identifier);
42 |
43 | std::vector header(header_size);
44 | if (header_size > 0)
45 | {
46 | chunk_file.ReadChunkHeaderToBuffer(identifier, header.data());
47 | }
48 |
49 | if (payload_size > 0)
50 | {
51 | chunk_file.ReadChunkDataToBuffer(identifier, &adapter_info_);
52 | retVal = true;
53 | }
54 |
55 | chunk_data_valid_ = true;
56 |
57 | return retVal;
58 | }
59 |
60 | const RmtRdfAdapterInfo::RmtRdfTraceAdapterInfo& RmtRdfAdapterInfo::GetChunkData() const
61 | {
62 | return adapter_info_;
63 | }
64 |
65 | const char* RmtRdfAdapterInfo::ChunkIdentifier()
66 | {
67 | return "AdapterInfo";
68 | }
69 |
--------------------------------------------------------------------------------
/source/frontend/views/custom_widgets/rmv_snapshot_table_view.h:
--------------------------------------------------------------------------------
1 | //=============================================================================
2 | // Copyright (c) 2020-2025 Advanced Micro Devices, Inc. All rights reserved.
3 | /// @author AMD Developer Tools Team
4 | /// @file
5 | /// @brief Header for the snapshot table view.
6 | ///
7 | /// Emit a signal whenever the table selection is changed so external objects
8 | /// can respond to it.
9 | ///
10 | //=============================================================================
11 |
12 | #ifndef RMV_VIEWS_CUSTOM_WIDGETS_RMV_SNAPSHOT_TABLE_VIEW_H_
13 | #define RMV_VIEWS_CUSTOM_WIDGETS_RMV_SNAPSHOT_TABLE_VIEW_H_
14 |
15 | #include "qt_common/custom_widgets/scaled_table_view.h"
16 |
17 | #include "views/delegates/rmv_snapshot_name_delegate.h"
18 |
19 | /// @brief Class declaration for the Snapshot table view.
20 | class RMVSnapshotTableView : public ScaledTableView
21 | {
22 | Q_OBJECT
23 | public:
24 | /// @brief Constructor.
25 | ///
26 | /// @param [in] parent The parent widget.
27 | explicit RMVSnapshotTableView(QWidget* parent = NULL);
28 |
29 | /// @brief Destructor.
30 | virtual ~RMVSnapshotTableView();
31 |
32 | protected:
33 | /// @brief Overridden Qt selectionChanged method.
34 | ///
35 | /// Called when a table entry is changed, either by mouse clicking on an entry or using the cursor keys.
36 | ///
37 | /// @param [in] selected The items selected.
38 | /// @param [in] deselected The items deselected.
39 | void selectionChanged(const QItemSelection& selected, const QItemSelection& deselected) Q_DECL_OVERRIDE;
40 |
41 | private:
42 | RMVSnapshotNameDelegate snapshot_name_delegate_; ///< The delegate that handles editing of snapshot names for the snapshot table.
43 |
44 | signals:
45 | /// @brief Signal the table selection has changed.
46 | void SelectionChanged();
47 | };
48 |
49 | #endif // RMV_VIEWS_CUSTOM_WIDGETS_RMV_SNAPSHOT_TABLE_VIEW_H_
50 |
--------------------------------------------------------------------------------
/source/frontend/views/debug_window.h:
--------------------------------------------------------------------------------
1 | //=============================================================================
2 | // Copyright (c) 2018-2025 Advanced Micro Devices, Inc. All rights reserved.
3 | /// @author AMD Developer Tools Team
4 | /// @file
5 | /// @brief Header for the debug window.
6 | //=============================================================================
7 |
8 | #ifndef RMV_VIEWS_DEBUG_WINDOW_H_
9 | #define RMV_VIEWS_DEBUG_WINDOW_H_
10 |
11 | #include
12 |
13 | #include "ui_debug_window.h"
14 |
15 | /// @brief Support for the debug window.
16 | class DebugWindow : public QDialog
17 | {
18 | Q_OBJECT
19 |
20 | public:
21 | /// @brief Constructor.
22 | explicit DebugWindow();
23 |
24 | /// @brief Destructor.
25 | ~DebugWindow();
26 |
27 | /// @brief Send a message to the debug window. Supports multiple arguments.
28 | ///
29 | /// @param [in] format The string containing format for each argument.
30 | static void DbgMsg(const char* format, ...);
31 |
32 | signals:
33 | /// @brief Signal that gets emitted when the debug window has new text to add.
34 | ///
35 | /// This will be picked up by the slot below.
36 | ///
37 | /// @param [in] string The new line of text to add.
38 | void EmitSetText(const QString& string);
39 |
40 | private slots:
41 | /// @brief Add a new line of text to the debug window.
42 | ///
43 | /// @param [in] string The new line of text to add.
44 | void SetText(const QString& string);
45 |
46 | private:
47 | /// @brief Helper function which to automatically scroll to the bottom on new line.
48 | void ScrollToBottom();
49 |
50 | /// @brief Register the Debug Window such that it is accessible.
51 | ///
52 | /// This is only to be called once, when initializing MainWindow.
53 | void RegisterDbgWindow();
54 |
55 | Ui::DebugWindow* ui_; ///< Pointer to the Qt UI design.
56 | };
57 |
58 | #endif // RMV_VIEWS_DEBUG_WINDOW_H_
59 |
--------------------------------------------------------------------------------
/source/frontend/views/custom_widgets/rmv_carousel_memory_footprint.h:
--------------------------------------------------------------------------------
1 | //=============================================================================
2 | // Copyright (c) 2018-2025 Advanced Micro Devices, Inc. All rights reserved.
3 | /// @author AMD Developer Tools Team
4 | /// @file
5 | /// @brief Header for the carousel memory footprint widget.
6 | //=============================================================================
7 |
8 | #ifndef RMV_VIEWS_CUSTOM_WIDGETS_RMV_CAROUSEL_MEMORY_FOOTPRINT_H_
9 | #define RMV_VIEWS_CUSTOM_WIDGETS_RMV_CAROUSEL_MEMORY_FOOTPRINT_H_
10 |
11 | #include
12 |
13 | #include "models/carousel_model.h"
14 | #include "views/custom_widgets/rmv_carousel_item.h"
15 |
16 | /// Container class for the carousel's memory footprint component.
17 | class RMVCarouselMemoryFootprint : public RMVCarouselItem
18 | {
19 | Q_OBJECT
20 |
21 | public:
22 | /// @brief Constructor.
23 | ///
24 | /// @param [in] config A configuration struct for this object.
25 | explicit RMVCarouselMemoryFootprint(const RMVCarouselConfig& config);
26 |
27 | /// @brief Destructor.
28 | virtual ~RMVCarouselMemoryFootprint();
29 |
30 | /// @brief Implementation of Qt's paint for this item.
31 | ///
32 | /// @param [in] painter The painter object to use.
33 | /// @param [in] item Provides style options for the item, such as its state, exposed area and its level-of-detail hints.
34 | /// @param [in] widget Points to the widget that is being painted on if specified.
35 | void paint(QPainter* painter, const QStyleOptionGraphicsItem* item, QWidget* widget) Q_DECL_OVERRIDE;
36 |
37 | /// @brief Set new data and update.
38 | ///
39 | /// @param [in] data The new data.
40 | void SetData(const rmv::RMVCarouselData& data) Q_DECL_OVERRIDE;
41 |
42 | private:
43 | rmv::RMVCarouselMemoryFootprintData data_; ///< The data required by this item.
44 | };
45 |
46 | #endif // RMV_VIEWS_CUSTOM_WIDGETS_RMV_CAROUSEL_MEMORY_FOOTPRINT_H_
47 |
--------------------------------------------------------------------------------
/source/frontend/views/delegates/rmv_regular_expression_validator.h:
--------------------------------------------------------------------------------
1 | //=============================================================================
2 | // Copyright (c) 2019-2025 Advanced Micro Devices, Inc. All rights reserved.
3 | /// @author AMD Developer Tools Team
4 | /// @file
5 | /// @brief Header for the regular expression validator with tooltip support.
6 | //=============================================================================
7 |
8 | #ifndef RMV_VIEWS_DELEGATES_RMV_REGULAR_EXPRESSION_VALIDATOR_H_
9 | #define RMV_VIEWS_DELEGATES_RMV_REGULAR_EXPRESSION_VALIDATOR_H_
10 |
11 | #include
12 |
13 | /// Support for the regular expression validator.
14 | class RMVRegularExpressionValidator : public QRegularExpressionValidator
15 | {
16 | Q_OBJECT
17 |
18 | public:
19 | /// @brief Constructor.
20 | ///
21 | /// @param [in] regular_expression The regular expression string.
22 | /// @param [in] parent The parent object for the validator.
23 | explicit RMVRegularExpressionValidator(const QRegularExpression& regular_expression, QObject* parent = nullptr);
24 |
25 | /// @brief Destructor.
26 | virtual ~RMVRegularExpressionValidator();
27 |
28 | /// @brief Override to handle validating the user's input string.
29 | ///
30 | /// @param [in] input The string entered by the user.
31 | /// @param [in] position The current cursor position in the input string.
32 | ///
33 | /// @return The validation state.
34 | virtual State validate(QString& input, int& position) const Q_DECL_OVERRIDE;
35 |
36 | /// @brief Assign a string displayed when the user enters an invalid character.
37 | ///
38 | /// @param [in] text The tooltip text message displayed.
39 | void SetInvalidInputMessage(const QString& text);
40 |
41 | private:
42 | QString invalid_input_message_; ///< The tooltip message displayed if the input string is invalid.
43 | };
44 |
45 | #endif // RMV_VIEWS_DELEGATES_RMV_REGULAR_EXPRESSION_VALIDATOR_H_
46 |
--------------------------------------------------------------------------------
/source/parser/rmt_address_helper.h:
--------------------------------------------------------------------------------
1 | //=============================================================================
2 | // Copyright (c) 2019-2025 Advanced Micro Devices, Inc. All rights reserved.
3 | /// @author AMD Developer Tools Team
4 | /// @file
5 | /// @brief Helpers for working with addresses.
6 | //=============================================================================
7 |
8 | #ifndef RMV_PARSER_RMT_ADDRESS_HELPER_H_
9 | #define RMV_PARSER_RMT_ADDRESS_HELPER_H_
10 |
11 | #include "rmt_format.h"
12 |
13 | #ifdef __cplusplus
14 | extern "C" {
15 | #endif // #ifdef __cplusplus
16 |
17 | /// Calculate the size of a page in bytes.
18 | ///
19 | /// @param [in] page_size An RmtPageSize defining the page size.
20 | /// @returns
21 | /// The page size, in bytes.
22 | uint64_t RmtGetPageSize(RmtPageSize page_size);
23 |
24 | /// Calculate the size of an allocation in bytes from its pages count and page size.
25 | ///
26 | /// @param [in] size_in_pages The size of the allocation, in pages.
27 | /// @param [in] page_size An RmtPageSize defining the page size.
28 | /// @returns
29 | /// The allocation size, in bytes.
30 | uint64_t RmtGetAllocationSizeInBytes(uint64_t size_in_pages, RmtPageSize page_size);
31 |
32 | /// Check if two ranges in an address space overlap.
33 | ///
34 | /// @param [in] base_address1 The base address of the first allocation.
35 | /// @param [in] size_in_bytes1 The size, in bytes, of the first allocation.
36 | /// @param [in] base_address2 The base address of the second allocation.
37 | /// @param [in] size_in_bytes2 The size, in bytes, of the second allocation.
38 | /// @returns
39 | /// If the allocations overlap, true is returned, otherwise false.
40 | bool RmtAllocationsOverlap(RmtGpuAddress base_address1, uint64_t size_in_bytes1, RmtGpuAddress base_address2, uint64_t size_in_bytes2);
41 |
42 | #ifdef __cplusplus
43 | }
44 | #endif // #ifdef __cplusplus
45 | #endif // #ifndef RMV_PARSER_RMT_ADDRESS_HELPER_H_
46 |
--------------------------------------------------------------------------------
/source/frontend/views/custom_widgets/rmv_cancellable_loading_widget.h:
--------------------------------------------------------------------------------
1 | //=============================================================================
2 | /// Copyright (c) 2023-2025 Advanced Micro Devices, Inc. All rights reserved.
3 | /// \author AMD Developer Tools Team
4 | /// \file
5 | /// \brief Header for a loading widget that has a cancel button
6 | //=============================================================================
7 |
8 | #ifndef RMV_VIEWS_CUSTOM_WIDGETS_RMV_CANCELLABLE_LOADING_WIDGET_H_
9 | #define RMV_VIEWS_CUSTOM_WIDGETS_RMV_CANCELLABLE_LOADING_WIDGET_H_
10 |
11 | #include
12 |
13 | #include "qt_common/custom_widgets/file_loading_widget.h"
14 | #include "qt_common/custom_widgets/scaled_push_button.h"
15 |
16 | /// Class to handle the loading animation with cancel button.
17 | class RmvCancellableLoadingWidget : public FileLoadingWidget
18 | {
19 | Q_OBJECT
20 |
21 | public:
22 | /// @brief Constructor.
23 | ///
24 | /// @param [in] parent The animation widget's parent.
25 | /// @param [in] can_cancel If true, indicates that the user can cancel the operation by clicking a cancel button.
26 | RmvCancellableLoadingWidget(QWidget* parent = nullptr, const bool can_cancel = true);
27 |
28 | /// @brief Virtual destructor.
29 | virtual ~RmvCancellableLoadingWidget();
30 |
31 | signals:
32 | /// @brief Notifies when the user clicks the cancel button.
33 | void CancelClicked();
34 |
35 | private slots:
36 | /// @brief Handle when the user clicks the cancel button.
37 | ///
38 | /// @param [in] checked Not used.
39 | void HandleCancelClicked(bool checked = false);
40 |
41 | protected:
42 | /// @brief Overridden resizeEvent handler. Adjusts position of cancel button.
43 | ///
44 | /// @param [in] event The resize event.
45 | virtual void resizeEvent(QResizeEvent* event) Q_DECL_OVERRIDE;
46 |
47 | private:
48 | ScaledPushButton* cancel_button_; ///< The cancel button.
49 | };
50 |
51 | #endif // RMV_VIEWS_CUSTOM_WIDGETS_RMV_CANCELLABLE_LOADING_WIDGET_H_
52 |
--------------------------------------------------------------------------------
/source/backend/rmt_adapter_info.h:
--------------------------------------------------------------------------------
1 | //=============================================================================
2 | // Copyright (c) 2020-2025 Advanced Micro Devices, Inc. All rights reserved.
3 | /// @author AMD Developer Tools Team
4 | /// @file
5 | /// @brief Helper function for legacy adapter information captured for the target process.
6 | //=============================================================================
7 |
8 | #ifndef RMV_BACKEND_RMT_ADAPTER_INFO_H_
9 | #define RMV_BACKEND_RMT_ADAPTER_INFO_H_
10 |
11 | #ifdef __cplusplus
12 | extern "C" {
13 | #endif // #ifdef __cplusplus
14 |
15 | /// @brief An enumeration of memory types that can be used with an adapter.
16 | typedef enum RmtAdapterInfoMemoryType
17 | {
18 | kRmtAdapterInfoMemoryTypeUnknown = 0, ///< Memory is unknown.
19 | kRmtAdapterInfoMemoryTypeDdr2 = 1, ///< System DDR2.
20 | kRmtAdapterInfoMemoryTypeDdr3 = 2, ///< System DDR3.
21 | kRmtAdapterInfoMemoryTypeDdr4 = 3, ///< System DDR4.
22 | kRmtAdapterInfoMemoryTypeGddr5 = 4, ///< Graphics DDR 5.
23 | kRmtAdapterInfoMemoryTypeGddr6 = 5, ///< Graphics DDR 6.
24 | kRmtAdapterInfoMemoryTypeHbm = 6, ///< First version of High-Bandwidth Memory.
25 | kRmtAdapterInfoMemoryTypeHbm2 = 7, ///< Second version of High-Bandwidth Memory.
26 | kRmtAdapterInfoMemoryTypeHbm3 = 8, ///< Third version of High-Bandwidth Memory.
27 | kRmtAdapterInfoMemoryTypeLpddr4 = 9, ///< Low power DDR4.
28 | kRmtAdapterInfoMemoryTypeLpddr5 = 10, ///< Low power DDR5.
29 | kRmtAdapterInfoMemoryTypeDdr5 = 11 ///< System DDR5.
30 | } RmtAdapterInfoMemoryType;
31 |
32 | /// @brief Get the chip type (in string) of the video memory.
33 | ///
34 | /// @param [in] memory_type The memory type enumerator.
35 | ///
36 | /// @returns
37 | /// Pointer to the memory chip type string.
38 | const char* RmtAdapterInfoGetVideoMemoryType(const RmtAdapterInfoMemoryType memory_type);
39 |
40 | #ifdef __cplusplus
41 | }
42 | #endif // #ifdef __cplusplus
43 | #endif // #ifndef RMV_BACKEND_RMT_ADAPTER_INFO_H_
44 |
--------------------------------------------------------------------------------
/source/frontend/models/proxy_models/memory_leak_finder_proxy_model.h:
--------------------------------------------------------------------------------
1 | //=============================================================================
2 | // Copyright (c) 2018-2025 Advanced Micro Devices, Inc. All rights reserved.
3 | /// @author AMD Developer Tools Team
4 | /// @file
5 | /// @brief Header for a proxy filter that processes multiple columns of the
6 | /// memory leak finder table.
7 | //=============================================================================
8 |
9 | #ifndef RMV_MODELS_PROXY_MODELS_MEMORY_LEAK_FINDER_PROXY_MODEL_H_
10 | #define RMV_MODELS_PROXY_MODELS_MEMORY_LEAK_FINDER_PROXY_MODEL_H_
11 |
12 | #include "models/proxy_models/resource_proxy_model.h"
13 |
14 | namespace rmv
15 | {
16 | /// @brief Class to filter out and sort the memory leak table.
17 | class MemoryLeakFinderProxyModel : public ResourceProxyModel
18 | {
19 | Q_OBJECT
20 |
21 | public:
22 | /// @brief Constructor.
23 | ///
24 | /// @param [in] compare_id_filter The compare filter.
25 | /// @param [in] parent The parent widget.
26 | explicit MemoryLeakFinderProxyModel(uint32_t compare_id_filter, QObject* parent = nullptr);
27 |
28 | /// @brief Destructor.
29 | virtual ~MemoryLeakFinderProxyModel();
30 |
31 | /// @brief Update the filter.
32 | ///
33 | /// @param [in] compare_filter The new filter.
34 | void UpdateCompareFilter(SnapshotCompareId compare_filter);
35 |
36 | protected:
37 | /// @brief Make the filter run across multiple columns.
38 | ///
39 | /// @param [in] source_row The target row.
40 | /// @param [in] source_parent The source parent.
41 | ///
42 | /// @return true if the row passed the filter, false if not.
43 | virtual bool filterAcceptsRow(int source_row, const QModelIndex& source_parent) const override;
44 |
45 | uint32_t compare_id_filter_; ///< Filtering flags specified in the UI.
46 | };
47 | } // namespace rmv
48 |
49 | #endif // RMV_MODELS_PROXY_MODELS_MEMORY_LEAK_FINDER_PROXY_MODEL_H_
50 |
--------------------------------------------------------------------------------
/source/frontend/models/proxy_models/snapshot_timeline_proxy_model.h:
--------------------------------------------------------------------------------
1 | //=============================================================================
2 | // Copyright (c) 2018-2025 Advanced Micro Devices, Inc. All rights reserved.
3 | /// @author AMD Developer Tools Team
4 | /// @file
5 | /// @brief Header for a proxy filter that processes multiple columns of the
6 | /// snapshot timeline table.
7 | //=============================================================================
8 |
9 | #ifndef RMV_MODELS_PROXY_MODELS_SNAPSHOT_TIMELINE_PROXY_MODEL_H_
10 | #define RMV_MODELS_PROXY_MODELS_SNAPSHOT_TIMELINE_PROXY_MODEL_H_
11 |
12 | #include "models/proxy_models/table_proxy_model.h"
13 |
14 | namespace rmv
15 | {
16 | /// @brief Class to filter out and sort the snapshot table on the timeline pane.
17 | class SnapshotTimelineProxyModel : public TableProxyModel
18 | {
19 | Q_OBJECT
20 |
21 | public:
22 | /// @brief Constructor.
23 | ///
24 | /// @param [in] parent The parent widget.
25 | explicit SnapshotTimelineProxyModel(QObject* parent = nullptr);
26 |
27 | /// @brief Destructor.
28 | virtual ~SnapshotTimelineProxyModel();
29 |
30 | protected:
31 | /// @brief Make the filter run across multiple columns.
32 | ///
33 | /// @param [in] source_row The target row.
34 | /// @param [in] source_parent The source parent.
35 | ///
36 | /// @return true if the row passed the filter, false if not.
37 | virtual bool filterAcceptsRow(int source_row, const QModelIndex& source_parent) const override;
38 |
39 | /// @brief Implement the comparison for sorting.
40 | ///
41 | /// @param [in] left The left item to compare.
42 | /// @param [in] right The right item to compare.
43 | ///
44 | /// @return If left < right then true, else false.
45 | virtual bool lessThan(const QModelIndex& left, const QModelIndex& right) const override;
46 | };
47 | } // namespace rmv
48 |
49 | #endif // RMV_MODELS_PROXY_MODELS_SNAPSHOT_TIMELINE_PROXY_MODEL_H_
50 |
--------------------------------------------------------------------------------
/source/frontend/views/custom_widgets/rmv_color_swatch_tooltip_item.h:
--------------------------------------------------------------------------------
1 | //=============================================================================
2 | // Copyright (c) 2020-2025 Advanced Micro Devices, Inc. All rights reserved.
3 | /// @author AMD Developer Tools Team
4 | /// @file
5 | /// @brief Header for a custom tooltip comprising of a multiline text
6 | /// string with a color swatch before each line of text.
7 | ///
8 | /// Implemented on top of QGraphicsSimpleTextItem and uses the base class
9 | /// setText() to store the text and the custom color data is set in setData().
10 | ///
11 | //=============================================================================
12 |
13 | #ifndef RMV_VIEWS_CUSTOM_WIDGETS_RMV_COLOR_SWATCH_TOOLTIP_ITEM_H_
14 | #define RMV_VIEWS_CUSTOM_WIDGETS_RMV_COLOR_SWATCH_TOOLTIP_ITEM_H_
15 |
16 | #include
17 | #include
18 | #include
19 |
20 | /// @brief Container class for the custom tooltip with color swatch.
21 | class RMVColorSwatchTooltipItem : public QGraphicsSimpleTextItem
22 | {
23 | public:
24 | /// @brief Constructor.
25 | ///
26 | /// @param [in] parent The parent widget.
27 | explicit RMVColorSwatchTooltipItem(QGraphicsItem* parent = nullptr);
28 |
29 | /// @brief Destructor.
30 | virtual ~RMVColorSwatchTooltipItem();
31 |
32 | /// @brief Qt's overridden boundingRect method.
33 | ///
34 | /// @return The item's bounding rectangle.
35 | virtual QRectF boundingRect() const Q_DECL_OVERRIDE;
36 |
37 | /// @brief Qt's overridden paint method.
38 | ///
39 | /// @param [in] painter The painter object to use.
40 | /// @param [in] option Provides style options for the item, such as its state, exposed area and its level-of-detail hints.
41 | /// @param [in] widget Points to the widget that is being painted on if specified.
42 | virtual void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget) Q_DECL_OVERRIDE;
43 |
44 | private:
45 | int icon_size_; ///< The icon size.
46 | };
47 |
48 | #endif // RMV_VIEWS_CUSTOM_WIDGETS_RMV_COLOR_SWATCH_TOOLTIP_ITEM_H_
49 |
--------------------------------------------------------------------------------
/source/frontend/models/colorizer.h:
--------------------------------------------------------------------------------
1 | //=============================================================================
2 | // Copyright (c) 2019-2025 Advanced Micro Devices, Inc. All rights reserved.
3 | /// @author AMD Developer Tools Team
4 | /// @file
5 | /// @brief Header file for a colorizer control.
6 | ///
7 | /// The colorizer is responsible for the functionality for the "color by"
8 | /// combo box across multiple panes. It sets up the combo box with all or
9 | /// a subset of the available coloring modes and updates the allocations and
10 | /// resource widgets and the legends depending on which coloring mode is
11 | /// required.
12 | ///
13 | //=============================================================================
14 |
15 | #ifndef RMV_MODELS_COLORIZER_H_
16 | #define RMV_MODELS_COLORIZER_H_
17 |
18 | #include
19 |
20 | #include "qt_common/custom_widgets/arrow_icon_combo_box.h"
21 | #include "qt_common/custom_widgets/colored_legend_graphics_view.h"
22 |
23 | #include "colorizer_base.h"
24 |
25 | namespace rmv
26 | {
27 | /// @brief Handles control of the "color by" combo boxes and picking which colors to use.
28 | class Colorizer : public ColorizerBase
29 | {
30 | Q_OBJECT
31 |
32 | public:
33 | /// @brief Constructor.
34 | explicit Colorizer();
35 |
36 | /// @brief Destructor.
37 | virtual ~Colorizer();
38 |
39 | /// @brief Initialize the colorizer.
40 | ///
41 | /// @param [in] parent The parent pane or widget.
42 | /// @param [in] combo_box The 'color by' combo box to set up.
43 | /// @param [in] legends_view The graphics view containing the color legends.
44 | /// @param [in] mode_list The list of color modes required.
45 | void Initialize(QWidget* parent, ArrowIconComboBox* combo_box, ColoredLegendGraphicsView* legends_view, const ColorMode* mode_list);
46 |
47 | public slots:
48 | /// @brief Slot to handle what happens when the combo box is selected.
49 | void ApplyColorMode();
50 | };
51 | } // namespace rmv
52 |
53 | #endif // RMV_MODELS_COLORIZER_H_
54 |
--------------------------------------------------------------------------------
/source/parser/rmt_assert.cpp:
--------------------------------------------------------------------------------
1 | //=============================================================================
2 | // Copyright (c) 2017-2025 Advanced Micro Devices, Inc. All rights reserved.
3 | /// @author AMD Developer Tools Team
4 | /// @file
5 | /// @brief Implementation of assert.
6 | //=============================================================================
7 |
8 | #include // for malloc()
9 |
10 | #ifdef _WIN32
11 | #define WIN32_LEAN_AND_MEAN
12 | #include // required for sprintf_s
13 | #include // required for OutputDebugString()
14 | #endif // #ifndef _WIN32
15 |
16 | #include "rmt_assert.h"
17 |
18 | static RmtAssertCallback s_assert_callback;
19 |
20 | // set the printing callback function
21 | void RmtAssertSetPrintingCallback(RmtAssertCallback callback)
22 | {
23 | s_assert_callback = callback;
24 | return;
25 | }
26 |
27 | // implementation of assert reporting
28 | bool RmtAssertReport(const char* file, int32_t line, const char* condition, const char* message)
29 | {
30 | if (!file)
31 | {
32 | return true;
33 | }
34 |
35 | #ifdef _WIN32
36 | // form the final assertion string and output to the TTY.
37 | const size_t bufferSize = snprintf(NULL, 0, "%s(%d): ASSERTION FAILED. %s\n", file, line, message ? message : condition) + 1;
38 | char* tempBuf = (char*)malloc(bufferSize);
39 | if (!tempBuf)
40 | {
41 | return true;
42 | }
43 |
44 | if (!message)
45 | {
46 | sprintf_s(tempBuf, bufferSize, "%s(%d): ASSERTION FAILED. %s\n", file, line, condition);
47 | }
48 | else
49 | {
50 | sprintf_s(tempBuf, bufferSize, "%s(%d): ASSERTION FAILED. %s\n", file, line, message);
51 | }
52 |
53 | if (!s_assert_callback)
54 | {
55 | OutputDebugStringA(tempBuf);
56 | }
57 | else
58 | {
59 | s_assert_callback(tempBuf);
60 | }
61 |
62 | // free the buffer.
63 | free(tempBuf);
64 |
65 | #else
66 | RMT_UNUSED(line);
67 | RMT_UNUSED(condition);
68 | RMT_UNUSED(message);
69 | #endif
70 |
71 | return true;
72 | }
73 |
--------------------------------------------------------------------------------
/source/parser/rmt_address_helper.cpp:
--------------------------------------------------------------------------------
1 | //=============================================================================
2 | // Copyright (c) 2019-2025 Advanced Micro Devices, Inc. All rights reserved.
3 | /// @author AMD Developer Tools Team
4 | /// @file
5 | /// @brief Implementation of helper functions for working with addresses.
6 | //=============================================================================
7 |
8 | #include "rmt_address_helper.h"
9 | #include "rmt_assert.h"
10 |
11 | uint64_t RmtGetPageSize(RmtPageSize page_size)
12 | {
13 | switch (page_size)
14 | {
15 | case kRmtPageSize4Kb:
16 | return 4 * 1024;
17 | case kRmtPageSize64Kb:
18 | return 64 * 1024;
19 | case kRmtPageSize256Kb:
20 | return 256 * 1024;
21 | case kRmtPageSize1Mb:
22 | return 1024 * 1024;
23 | case kRmtPageSize2Mb:
24 | return 2 * 1024 * 1024;
25 | default:
26 | return 0;
27 | }
28 | }
29 |
30 | uint64_t RmtGetAllocationSizeInBytes(uint64_t size_in_pages, RmtPageSize page_size)
31 | {
32 | const uint64_t page_size_in_bytes = RmtGetPageSize(page_size);
33 | return size_in_pages * page_size_in_bytes;
34 | }
35 |
36 | bool RmtAllocationsOverlap(RmtGpuAddress base_address1, uint64_t size_in_bytes1, RmtGpuAddress base_address2, uint64_t size_in_bytes2)
37 | {
38 | // If there's a size of 0 bytes, there is no overlap.
39 | if (size_in_bytes1 == 0 || size_in_bytes2 == 0)
40 | {
41 | return false;
42 | }
43 |
44 | // Case 1: |---2----| |----1----|
45 | if (base_address1 > (base_address2 + size_in_bytes2 - 1))
46 | {
47 | return false;
48 | }
49 |
50 | // Case 2: |---1----| |----2----|
51 | if (base_address2 > (base_address1 + size_in_bytes1 - 1))
52 | {
53 | return false;
54 | }
55 |
56 | // Case 3: |--------1------------|
57 | // |----2---|
58 | // Case 4: |-----1-----|
59 | // |-----2-----|
60 | // Case 5: |-----2-----|
61 | // |-----1------|
62 | // Case 6: |-----2-------------------|
63 | // |----1----|
64 | return true;
65 | }
66 |
--------------------------------------------------------------------------------
/source/frontend/util/log_file_writer.h:
--------------------------------------------------------------------------------
1 | //=============================================================================
2 | // Copyright (c) 2018-2025 Advanced Micro Devices, Inc. All rights reserved.
3 | /// @author AMD Developer Tools Team
4 | /// @file
5 | /// @brief Declaration for the log file writer.
6 | //=============================================================================
7 |
8 | #ifndef RMV_UTIL_LOG_FILE_WRITER_H_
9 | #define RMV_UTIL_LOG_FILE_WRITER_H_
10 |
11 | #include
12 | #include
13 |
14 | namespace rmv
15 | {
16 | /// @brief Log file writer class definition.
17 | class LogFileWriter
18 | {
19 | public:
20 | /// @brief Log levels used by the logger from most severe to least severe.
21 | enum LogLevel
22 | {
23 | kError,
24 | kWarning,
25 | kInfo,
26 | kDebug,
27 | };
28 |
29 | /// @brief LogFileWriter instance get function.
30 | ///
31 | /// @return a reference to the LogFileWriter instance.
32 | static LogFileWriter& Get();
33 |
34 | /// @brief Write a string to the log file.
35 | ///
36 | /// @param [in] log_level The log level to use for this message.
37 | /// @param [in] log_message The message to write to the log file.
38 | void WriteLog(LogLevel log_level, const char* log_message, ...);
39 |
40 | /// @brief Get the location of the log file.
41 | ///
42 | /// @return The location of the log file.
43 | QString GetLogFileLocation();
44 |
45 | private:
46 | /// @brief Constructor.
47 | explicit LogFileWriter();
48 |
49 | /// @brief Destructor.
50 | ~LogFileWriter();
51 |
52 | /// @brief Write the log out to the log file.
53 | ///
54 | /// @param [in] log_message The message to write to the log file.
55 | void WriteLogMessage(const char* log_message);
56 |
57 | QMutex mutex_; ///< The mutex to write the log.
58 | LogLevel log_level_; ///< The current log level.
59 | };
60 | } // namespace rmv
61 |
62 | #endif // RMV_UTIL_LOG_FILE_WRITER_H_
63 |
--------------------------------------------------------------------------------
/source/frontend/settings/settings_writer.h:
--------------------------------------------------------------------------------
1 | //=============================================================================
2 | // Copyright (c) 2018-2025 Advanced Micro Devices, Inc. All rights reserved.
3 | /// @author AMD Developer Tools Team
4 | /// @file
5 | /// @brief Header for the XML settings writer.
6 | //=============================================================================
7 |
8 | #ifndef RMV_SETTINGS_SETTINGS_WRITER_H_
9 | #define RMV_SETTINGS_SETTINGS_WRITER_H_
10 |
11 | #include
12 | #include
13 |
14 | #include "settings/rmv_settings.h"
15 |
16 | namespace rmv
17 | {
18 | /// @brief Support for the XML settings writer.
19 | class SettingsWriter
20 | {
21 | public:
22 | /// @brief Constructor.
23 | ///
24 | /// @param [in] settings Output settings class.
25 | explicit SettingsWriter(RMVSettings* settings);
26 |
27 | /// @brief Destructor.
28 | ~SettingsWriter();
29 |
30 | /// @brief Begin writing the XML file and make sure it's valid.
31 | ///
32 | /// @param [in] device The XML file represented by a Qt IO device.
33 | bool Write(QIODevice* device);
34 |
35 | private:
36 | /// @brief Write global settings and recently used files section.
37 | void WriteSettingsAndRecents();
38 |
39 | /// @brief Write settings list.
40 | void WriteSettings();
41 |
42 | /// @brief Write individual settings.
43 | ///
44 | /// @param [in] setting The RMVSetting structure to write out.
45 | void WriteSetting(const RMVSetting& setting);
46 |
47 | /// @brief Write recently opened file list.
48 | void WriteRecentFiles();
49 |
50 | /// @brief Write individual recently opened files.
51 | ///
52 | /// @param [in] recent_file The name of the file to write.
53 | void WriteRecentFile(const RecentFileData& recent_file);
54 |
55 | QXmlStreamWriter writer_; ///< Qt's XML stream.
56 | RMVSettings* settings_; ///< Belongs to the caller, not this class.
57 | };
58 | } // namespace rmv
59 |
60 | #endif // RMV_SETTINGS_SETTINGS_WRITER_H_
61 |
--------------------------------------------------------------------------------
/source/frontend/views/snapshot/snapshot_start_pane.h:
--------------------------------------------------------------------------------
1 | //=============================================================================
2 | // Copyright (c) 2020-2025 Advanced Micro Devices, Inc. All rights reserved.
3 | /// @author AMD Developer Tools Team
4 | /// @file
5 | /// @brief Header for the Snapshot start pane.
6 | //=============================================================================
7 |
8 | #ifndef RMV_VIEWS_SNAPSHOT_SNAPSHOT_START_PANE_H_
9 | #define RMV_VIEWS_SNAPSHOT_SNAPSHOT_START_PANE_H_
10 |
11 | #include
12 |
13 | #include "ui_snapshot_start_pane.h"
14 |
15 | #include "views/base_pane.h"
16 | #include "views/custom_widgets/rmv_camera_snapshot_widget.h"
17 |
18 | /// @brief Class declaration.
19 | class SnapshotStartPane : public BasePane
20 | {
21 | Q_OBJECT
22 |
23 | public:
24 | /// @brief constructor.
25 | ///
26 | /// @param [in] parent The parent widget.
27 | explicit SnapshotStartPane(QWidget* parent = nullptr);
28 |
29 | /// @brief Destructor.
30 | virtual ~SnapshotStartPane();
31 |
32 | /// @brief Overridden window resize event.
33 | ///
34 | /// @param [in] event the resize event object.
35 | virtual void resizeEvent(QResizeEvent* event) Q_DECL_OVERRIDE;
36 |
37 | /// @brief Reset UI state.
38 | virtual void Reset() Q_DECL_OVERRIDE;
39 |
40 | /// @brief Update UI coloring.
41 | virtual void ChangeColoring() Q_DECL_OVERRIDE;
42 |
43 | /// @brief Open a snapshot.
44 | ///
45 | /// @param [in] snapshot Pointer to the snapshot to open.
46 | virtual void OpenSnapshot(RmtDataSnapshot* snapshot) Q_DECL_OVERRIDE;
47 |
48 | /// @brief Set the text for the pane describing an empty snapshot.
49 | void SetEmptyTitleText();
50 |
51 | private:
52 | /// @brief Resizes the GraphicsView to fit the scene.
53 | void ResizeGraphicsView();
54 |
55 | Ui::SnapshotStartPane* ui_; ///< Pointer to the Qt UI design.
56 | QGraphicsScene* scene_; ///< Qt scene for the camera drawing.
57 | RMVCameraSnapshotWidget* snapshot_widget_; ///< Circle with camera.
58 | };
59 |
60 | #endif // RMV_VIEWS_SNAPSHOT_SNAPSHOT_START_PANE_H_
61 |
--------------------------------------------------------------------------------
/test/source/backend_test/log.h:
--------------------------------------------------------------------------------
1 | //=============================================================================
2 | // Copyright (c) 2020-2025 Advanced Micro Devices, Inc. All rights reserved.
3 | /// @author AMD Developer Tools Team
4 | /// @file
5 | /// @brief Backend test log file header.
6 | ///
7 | /// The log file will contain detailed information about the test run so the
8 | /// exact failure can be determined.
9 | //=============================================================================
10 |
11 | #ifndef LOG_H_
12 | #define LOG_H_
13 |
14 | #include
15 |
16 | namespace backend_test
17 | {
18 | class Log
19 | {
20 | public:
21 | /// @brief Constructor.
22 | Log();
23 |
24 | /// @brief Destructor.
25 | ~Log();
26 |
27 | /// @brief Open / create the log file.
28 | ///
29 | /// @param [in] filename The name of the trace file being tested.
30 | void Open(const char* filename);
31 |
32 | /// @brief Write a string to the log file.
33 | ///
34 | /// @param [in] log_message The string to write.
35 | void Write(const char* log_message, ...) const;
36 |
37 | /// @brief Write a string to both the console and the log file.
38 | ///
39 | /// @param [in] log_message The string to write.
40 | /// @param [in] ... Additional arguments dependent on log_message formatting.
41 | void WriteConsole(const char* log_message, ...) const;
42 |
43 | private:
44 | /// @brief Write a string to the log file and optionally the console.
45 | ///
46 | /// @param [in] log_message The string to write.
47 | /// @param [in] arg_ptr Additional arguments dependent on log_message formatting.
48 | /// @paran [in] write_to_console If true, the message is output to the console in addition to the log file.
49 | void WriteImpl(const char* log_message, va_list arg_ptr, const bool write_to_console) const;
50 |
51 | private:
52 | FILE* log_file_handle_; ///< Handle to the log file.
53 | };
54 | } // namespace backend_test
55 |
56 | #endif // LOG_H_
57 |
--------------------------------------------------------------------------------
/source/parser/rmt_string_memory_pool.cpp:
--------------------------------------------------------------------------------
1 | //=============================================================================
2 | // Copyright (c) 2023-2025 Advanced Micro Devices, Inc. All rights reserved.
3 | /// @author AMD Developer Tools Team
4 | /// @file
5 | /// @brief Implementation of functions for a dynamic memory pool
6 | /// allocator optimized for small text strings.
7 | //=============================================================================
8 |
9 | #include "rmt_string_memory_pool.h"
10 |
11 | #include "rmt_assert.h"
12 | #include "rmt_error.h"
13 |
14 | RmtStringMemoryPool::RmtStringMemoryPool(const size_t block_size)
15 | {
16 | memory_pool_block_size_ = block_size;
17 | memory_pool_buffer_ = nullptr;
18 | memory_pool_buffer_offset_ = 0;
19 | }
20 |
21 | RmtStringMemoryPool::~RmtStringMemoryPool()
22 | {
23 | FreeAll();
24 | }
25 |
26 | RmtErrorCode RmtStringMemoryPool::Allocate(const size_t buffer_size, char** out_buffer)
27 | {
28 | RMT_RETURN_ON_ERROR(out_buffer != nullptr, kRmtErrorInvalidPointer);
29 |
30 | // Check to see if there is enough room in the buffer.
31 | // If not, set things up to allocate a new buffer block.
32 | if ((memory_pool_buffer_offset_ + buffer_size) >= memory_pool_block_size_)
33 | {
34 | memory_pool_buffer_ = nullptr;
35 | }
36 |
37 | // If no buffer, allocate one and add it to the buffer cache.
38 | if (memory_pool_buffer_ == nullptr)
39 | {
40 | memory_pool_buffer_ = new char[memory_pool_block_size_];
41 | memory_pool_blocks_.push_back(memory_pool_buffer_);
42 | memory_pool_buffer_offset_ = 0;
43 | }
44 |
45 | // Generate memory pointer from the buffer.
46 | *out_buffer = memory_pool_buffer_ + memory_pool_buffer_offset_;
47 | memory_pool_buffer_offset_ += buffer_size;
48 |
49 | return kRmtOk;
50 | }
51 |
52 | RmtErrorCode RmtStringMemoryPool::FreeAll()
53 | {
54 | memory_pool_buffer_offset_ = 0;
55 | memory_pool_buffer_ = nullptr;
56 | for (auto memory_block : memory_pool_blocks_)
57 | {
58 | delete[] (memory_block);
59 | }
60 | memory_pool_blocks_.clear();
61 |
62 | return kRmtOk;
63 | }
64 |
--------------------------------------------------------------------------------
/source/frontend/util/time_util.cpp:
--------------------------------------------------------------------------------
1 | //=============================================================================
2 | // Copyright (c) 2019-2025 Advanced Micro Devices, Inc. All rights reserved.
3 | /// @author AMD Developer Tools Team
4 | /// @file
5 | /// @brief Implementation of a number of time-related utilities.
6 | //=============================================================================
7 |
8 | #include "util/time_util.h"
9 |
10 | #include "qt_common/utils/qt_util.h"
11 |
12 | #include "rmt_assert.h"
13 | #include "rmt_data_set.h"
14 | #include "rmt_error.h"
15 |
16 | #include "managers/trace_manager.h"
17 | #include "settings/rmv_settings.h"
18 |
19 | namespace rmv
20 | {
21 | QString time_util::ClockToTimeUnit(uint64_t clk)
22 | {
23 | double time = 0.0;
24 |
25 | TimeUnitType unit_type = RMVSettings::Get().GetUnits();
26 |
27 | if (unit_type == kTimeUnitTypeClk)
28 | {
29 | time = clk;
30 | }
31 | else
32 | {
33 | TraceManager& trace_manager = TraceManager::Get();
34 | if (trace_manager.DataSetValid())
35 | {
36 | // This should only get called if the CPU clock timestamp is valid.
37 | const RmtDataSet* data_set = trace_manager.GetDataSet();
38 | RmtErrorCode error_code = RmtDataSetGetCpuClockTimestamp(data_set, clk, &time);
39 | RMT_UNUSED(error_code);
40 | RMT_ASSERT(error_code == kRmtOk);
41 | }
42 | }
43 |
44 | return QtCommon::QtUtils::ClockToTimeUnit(time, unit_type);
45 | }
46 |
47 | double time_util::TimeToClockRatio()
48 | {
49 | double ratio = 1.0;
50 | if (RMVSettings::Get().GetUnits() != kTimeUnitTypeClk)
51 | {
52 | TraceManager& trace_manager = TraceManager::Get();
53 | if (trace_manager.DataSetValid())
54 | {
55 | const RmtDataSet* data_set = trace_manager.GetDataSet();
56 | RmtDataSetGetCpuClockTimestamp(data_set, 1, &ratio);
57 | }
58 | RMT_ASSERT(ratio > 0.0);
59 | }
60 | return ratio;
61 | }
62 | } // namespace rmv
63 |
--------------------------------------------------------------------------------
/source/frontend/views/delegates/rmv_snapshot_name_delegate.cpp:
--------------------------------------------------------------------------------
1 | //=============================================================================
2 | // Copyright (c) 2019-2025 Advanced Micro Devices, Inc. All rights reserved.
3 | /// @author AMD Developer Tools Team
4 | /// @file
5 | /// @brief Implementation of the name delegate for the snapshot table.
6 | //=============================================================================
7 |
8 | #include "rmv_snapshot_name_delegate.h"
9 |
10 | #include
11 |
12 | #include "models/timeline/snapshot_item_model.h"
13 | #include "rmv_regular_expression_validator.h"
14 |
15 | // Regular Expression to filter non-printable characters and limit the snapshot name hlength to 32 characters.
16 | static const QString kSnapshotNameRegEx("[ -~]{1,32}");
17 |
18 | // Tooltip message displayed when user enters and invalid character for a snapshot name.
19 | static const QString kInvalidSnapshotNameMessage("Snapshot names must contain only printable characters and must be 32 characters or less.");
20 |
21 | RMVSnapshotNameDelegate::RMVSnapshotNameDelegate(QWidget* parent)
22 | : QStyledItemDelegate(parent)
23 | {
24 | }
25 |
26 | RMVSnapshotNameDelegate::~RMVSnapshotNameDelegate()
27 | {
28 | }
29 |
30 | QWidget* RMVSnapshotNameDelegate::createEditor(QWidget* parent, const QStyleOptionViewItem& option, const QModelIndex& index) const
31 | {
32 | Q_UNUSED(option);
33 | Q_UNUSED(index);
34 |
35 | QLineEdit* line_edit = new QLineEdit(parent);
36 | if (line_edit != nullptr)
37 | {
38 | RMVRegularExpressionValidator* validator =
39 | new RMVRegularExpressionValidator((QRegularExpression(kSnapshotNameRegEx, QRegularExpression::CaseInsensitiveOption)), line_edit);
40 | validator->SetInvalidInputMessage(kInvalidSnapshotNameMessage);
41 | line_edit->setValidator(validator);
42 | }
43 |
44 | return line_edit;
45 | }
46 |
47 | void RMVSnapshotNameDelegate::setModelData(QWidget* editor, QAbstractItemModel* model, const QModelIndex& index) const
48 | {
49 | QLineEdit* line_edit = qobject_cast(editor);
50 | if (line_edit != nullptr)
51 | {
52 | QString value = line_edit->text().trimmed();
53 | model->setData(index, value, Qt::EditRole);
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/source/frontend/views/compare/compare_start_pane.h:
--------------------------------------------------------------------------------
1 | //=============================================================================
2 | // Copyright (c) 2018-2025 Advanced Micro Devices, Inc. All rights reserved.
3 | /// @author AMD Developer Tools Team
4 | /// @file
5 | /// @brief Header for the Compare start pane.
6 | //=============================================================================
7 |
8 | #ifndef RMV_VIEWS_COMPARE_COMPARE_START_PANE_H_
9 | #define RMV_VIEWS_COMPARE_COMPARE_START_PANE_H_
10 |
11 | #include "ui_compare_start_pane.h"
12 |
13 | #include
14 |
15 | #include "views/base_pane.h"
16 | #include "views/custom_widgets/rmv_camera_snapshot_widget.h"
17 |
18 | /// @brief Class declaration.
19 | class CompareStartPane : public BasePane
20 | {
21 | Q_OBJECT
22 |
23 | public:
24 | /// @brief Constructor.
25 | ///
26 | /// @param [in] parent The parent widget.
27 | explicit CompareStartPane(QWidget* parent = nullptr);
28 |
29 | /// @brief Destructor.
30 | virtual ~CompareStartPane();
31 |
32 | /// @brief Overridden window resize event.
33 | ///
34 | /// @param [in] event the resize event object.
35 | virtual void resizeEvent(QResizeEvent* event) Q_DECL_OVERRIDE;
36 |
37 | /// @brief Reset UI state.
38 | virtual void Reset() Q_DECL_OVERRIDE;
39 |
40 | /// @brief Update UI coloring.
41 | virtual void ChangeColoring() Q_DECL_OVERRIDE;
42 |
43 | /// @brief Open a snapshot.
44 | ///
45 | /// @param [in] snapshot The snapshot to open.
46 | virtual void OpenSnapshot(RmtDataSnapshot* snapshot) Q_DECL_OVERRIDE;
47 |
48 | /// @brief Set the text for the pane describing an empty comparison.
49 | void SetEmptyTitleText();
50 |
51 | private:
52 | /// @brief Repositions the right circle and resizes the GraphicsView to fit the whole scene.
53 | void UpdateCirclePositions();
54 |
55 | Ui::CompareStartPane* ui_; ///< Pointer to the Qt UI design.
56 |
57 | QGraphicsScene* scene_; ///< Qt scene for the camera drawing.
58 | RMVCameraSnapshotWidget* snapshot_widget_left_; ///< Left circle with camera.
59 | RMVCameraSnapshotWidget* snapshot_widget_right_; ///< Right circle with camera.
60 | };
61 |
62 | #endif // RMV_VIEWS_COMPARE_COMPARE_START_PANE_H_
63 |
--------------------------------------------------------------------------------
/source/frontend/views/custom_widgets/rmv_carousel_memory_types.h:
--------------------------------------------------------------------------------
1 | //=============================================================================
2 | // Copyright (c) 2018-2025 Advanced Micro Devices, Inc. All rights reserved.
3 | /// @author AMD Developer Tools Team
4 | /// @file
5 | /// @brief Header for the carousel memory types widget.
6 | //=============================================================================
7 |
8 | #ifndef RMV_VIEWS_CUSTOM_WIDGETS_RMV_CAROUSEL_MEMORY_TYPES_H_
9 | #define RMV_VIEWS_CUSTOM_WIDGETS_RMV_CAROUSEL_MEMORY_TYPES_H_
10 |
11 | #include
12 |
13 | #include "models/carousel_model.h"
14 | #include "views/custom_widgets/rmv_carousel_item.h"
15 |
16 | /// Container class for the carousel's memory types component.
17 | class RMVCarouselMemoryTypes : public RMVCarouselItem
18 | {
19 | Q_OBJECT
20 |
21 | public:
22 | /// @brief Constructor.
23 | ///
24 | /// @param [in] config A configuration struct for this object.
25 | explicit RMVCarouselMemoryTypes(const RMVCarouselConfig& config);
26 |
27 | /// @brief Destructor.
28 | virtual ~RMVCarouselMemoryTypes();
29 |
30 | /// @brief Implementation of Qt's paint for this item.
31 | ///
32 | /// @param [in] painter The painter object to use.
33 | /// @param [in] item Provides style options for the item, such as its state, exposed area and its level-of-detail hints.
34 | /// @param [in] widget Points to the widget that is being painted on if specified.
35 | void paint(QPainter* painter, const QStyleOptionGraphicsItem* item, QWidget* widget) Q_DECL_OVERRIDE;
36 |
37 | /// @brief Should this item display the physical heap data.
38 | ///
39 | /// @param [in] is_physical_heap If true, show the physical heap.
40 | void SetIsPhysicalHeap(bool is_physical_heap);
41 |
42 | /// @brief Set new data and update.
43 | ///
44 | /// @param [in] data New data.
45 | void SetData(const rmv::RMVCarouselData& data) Q_DECL_OVERRIDE;
46 |
47 | private:
48 | rmv::RMVCarouselMemoryTypesData data_; ///< The data required by this item.
49 | bool physical_heap_; ///< If true, display physical heap data, otherwise preferred heap.
50 | };
51 |
52 | #endif // RMV_VIEWS_CUSTOM_WIDGETS_RMV_CAROUSEL_MEMORY_TYPES_H_
53 |
--------------------------------------------------------------------------------
/source/frontend/views/custom_widgets/rmv_range_slider.h:
--------------------------------------------------------------------------------
1 | //=============================================================================
2 | // Copyright (c) 2024-2025 Advanced Micro Devices, Inc. All rights reserved.
3 | /// @author AMD Developer Tools Team
4 | /// @file
5 | /// @brief Header for the custom range slider widget.
6 | //=============================================================================
7 |
8 | #ifndef RMV_VIEWS_CUSTOM_WIDGETS_RMV_RANGE_SLIDER_H_
9 | #define RMV_VIEWS_CUSTOM_WIDGETS_RMV_RANGE_SLIDER_H_
10 |
11 | #include
12 |
13 | #include "qt_common/custom_widgets/double_slider_widget.h"
14 |
15 | #include "views/custom_widgets/rmv_fixed_width_label.h"
16 |
17 | enum class ESliderType : int8_t
18 | {
19 | Size = 0,
20 | MipLevel,
21 | Num
22 | };
23 |
24 | /// @brief Range slider that extends the double slider widget by adding a range value label.
25 | class RmvRangeSlider : public DoubleSliderWidget
26 | {
27 | Q_PROPERTY(ESliderType SliderType READ SliderType WRITE setSliderType)
28 | public:
29 | /// @brief Constructor
30 | ///
31 | /// @param [in] parent The parent of slider widget.
32 | explicit RmvRangeSlider(QWidget* parent = nullptr);
33 |
34 | /// @brief Destructor.
35 | virtual ~RmvRangeSlider();
36 |
37 | /// @brief Intializes the range slider and adds the range value label.
38 | void Init();
39 |
40 | /// @brief Get rmv range slider type.
41 | ESliderType SliderType() const;
42 |
43 | /// @brief Set rmv range slider type.
44 | ///
45 | /// @param [in] slider_type The type of this slider widget.
46 | void setSliderType(ESliderType slider_type);
47 |
48 | private slots:
49 | /// @brief Slot to update the range value label when the slide is adjusted.
50 | ///
51 | /// @param [in] min_value The minimum index value for the slider.
52 | /// @param [in] max_value The maximum index value for the slider.
53 | void UpdateValues(const int min_value, const int max_value);
54 |
55 | private:
56 | RmvFixedWidthLabel* range_value_label_; ///< A pointer to the label widget that displays the range values.
57 | ESliderType slider_type_;
58 | };
59 | #endif // RMV_VIEWS_CUSTOM_WIDGETS_RMV_RANGE_SLIDER_H_
60 |
--------------------------------------------------------------------------------
/source/frontend/views/custom_widgets/rmv_color_picker_button.h:
--------------------------------------------------------------------------------
1 | //=============================================================================
2 | // Copyright (c) 2021-2025 Advanced Micro Devices, Inc. All rights reserved.
3 | /// @author AMD Developer Tools Team
4 | /// @file
5 | /// @brief Header for a color picker button.
6 | //=============================================================================
7 |
8 | #ifndef RMV_VIEWS_CUSTOM_WIDGETS_RMV_COLOR_PICKER_BUTTON_H_
9 | #define RMV_VIEWS_CUSTOM_WIDGETS_RMV_COLOR_PICKER_BUTTON_H_
10 |
11 | #include
12 | #include
13 |
14 | #include "qt_common/utils/color_palette.h"
15 |
16 | /// @brief Helper class for color picker. Allows custom button painting.
17 | class RMVColorPickerButton : public QPushButton
18 | {
19 | public:
20 | /// @brief Constructor.
21 | ///
22 | /// @param [in] parent The parent widget.
23 | explicit RMVColorPickerButton(QWidget* parent = nullptr);
24 |
25 | /// @brief Destructor.
26 | virtual ~RMVColorPickerButton();
27 |
28 | /// @brief Set the color of the button.
29 | ///
30 | /// @param [in] color The button color.
31 | void SetColor(const QColor& color);
32 |
33 | /// @brief Provides the desired height for the specified width which will keep the button square.
34 | ///
35 | /// @param [in] width The pixel width of this widget.
36 | ///
37 | /// @return The desired pixel height of this width.
38 | virtual int heightForWidth(int width) const Q_DECL_OVERRIDE;
39 |
40 | /// @brief Size hint, which is the scaled default button dimensions.
41 | ///
42 | /// @return The scaled size hint.
43 | virtual QSize sizeHint() const Q_DECL_OVERRIDE;
44 |
45 | /// @brief Minimum size hint, which is the unscaled default button dimensions.
46 | ///
47 | /// @return The mimium size hint.
48 | virtual QSize minimumSizeHint() const Q_DECL_OVERRIDE;
49 |
50 | protected:
51 | /// @brief Picker button paint event.
52 | ///
53 | /// Overrides button draw function to implement custom drawing functionality.
54 | ///
55 | /// @param [in] event Qt paint event.
56 | virtual void paintEvent(QPaintEvent* event) Q_DECL_OVERRIDE;
57 |
58 | private:
59 | QColor button_color_; ///< Color of this button.
60 | };
61 |
62 | #endif // RMV_VIEWS_CUSTOM_WIDGETS_RMV_COLOR_PICKER_BUTTON_H_
63 |
--------------------------------------------------------------------------------
/source/frontend/views/custom_widgets/themes_and_colors_item_button.cpp:
--------------------------------------------------------------------------------
1 | //=============================================================================
2 | // Copyright (c) 2020-2025 Advanced Micro Devices, Inc. All rights reserved.
3 | /// @author AMD Developer Tools Team
4 | /// @file
5 | /// @brief Implementation for a helper class for custom button rendering for
6 | /// the themes and colors pane.
7 | //=============================================================================
8 |
9 | #include
10 | #include
11 |
12 | #include "util/rmv_util.h"
13 | #include "views/custom_widgets/themes_and_colors_item_button.h"
14 |
15 | ThemesAndColorsItemButton::ThemesAndColorsItemButton(QWidget* parent)
16 | : ScaledPushButton(parent)
17 | {
18 | setContentsMargins(10, 5, 10, 5);
19 | }
20 |
21 | ThemesAndColorsItemButton::~ThemesAndColorsItemButton()
22 | {
23 | }
24 |
25 | void ThemesAndColorsItemButton::SetColor(const QColor& color)
26 | {
27 | button_color_ = color;
28 | font_color_ = rmv_util::GetTextColorForBackground(color);
29 | update();
30 | }
31 |
32 | void ThemesAndColorsItemButton::paintEvent(QPaintEvent* event)
33 | {
34 | Q_UNUSED(event);
35 |
36 | QPainter painter(this);
37 |
38 | const int position_adjust = 1;
39 | const int size_adjust = position_adjust * 2;
40 | const int outline_width = 2;
41 |
42 | // Rectangles used for drawing button and its border.
43 | QRect r1(position_adjust, position_adjust, this->size().width() - size_adjust, this->size().height() - size_adjust);
44 | QRect r2(r1.left() + outline_width, r1.top() + outline_width, r1.width() - (outline_width * 2), r1.height() - (outline_width * 2));
45 | QRect r3(r2.left(), r2.top(), r2.width() - 1, r2.height() - 1);
46 |
47 | if (this->isChecked() || this->underMouse())
48 | {
49 | // Fill rect with black to form border.
50 | painter.fillRect(r1, QBrush(Qt::black));
51 | painter.fillRect(r2, QBrush(button_color_));
52 | painter.setPen(QPen(Qt::white, 1));
53 | painter.drawRect(r3);
54 | }
55 | else
56 | {
57 | // Fill rect with black to form border.
58 | painter.fillRect(r1, button_color_);
59 | }
60 |
61 | // Draw text.
62 | painter.setPen(QPen(font_color_, 1));
63 | painter.drawText(r1, Qt::AlignHCenter | Qt::AlignVCenter, this->text());
64 | }
65 |
--------------------------------------------------------------------------------
/source/frontend/views/start/recent_traces_pane.h:
--------------------------------------------------------------------------------
1 | //=============================================================================
2 | // Copyright (c) 2018-2025 Advanced Micro Devices, Inc. All rights reserved.
3 | /// @author AMD Developer Tools Team
4 | /// @file
5 | /// @brief Header for the Recent traces pane.
6 | //=============================================================================
7 |
8 | #ifndef RMV_VIEWS_START_RECENT_TRACES_PANE_H_
9 | #define RMV_VIEWS_START_RECENT_TRACES_PANE_H_
10 |
11 | #include
12 | #include
13 | #include
14 |
15 | #include "ui_recent_traces_pane.h"
16 |
17 | #include "qt_common/custom_widgets/recent_trace_widget.h"
18 |
19 | #include "views/base_pane.h"
20 |
21 | /// @brief Class declaration.
22 | class RecentTracesPane : public BasePane
23 | {
24 | Q_OBJECT
25 |
26 | public:
27 | /// @brief Constructor.
28 | ///
29 | /// @param [in] parent The parent widget.
30 | explicit RecentTracesPane(QWidget* parent = nullptr);
31 |
32 | /// @brief Destructor.
33 | virtual ~RecentTracesPane();
34 |
35 | signals:
36 | /// @brief A file in the recent file list was deleted.
37 | void RecentFileDeleted();
38 |
39 | private slots:
40 | /// @brief Set up the list of recent traces in the UI.
41 | void SetupFileList();
42 |
43 | /// @brief Slot to delete a trace from the Recent traces list.
44 | ///
45 | /// Only removes it from the list; doesn't actually delete the file.
46 | ///
47 | /// @param [in] path The path to the trace file.
48 | void DeleteTrace(const QString& path);
49 |
50 | /// Slot to display an error message when a trace is not found.
51 | ///
52 | /// @param [in] path The path of the trace that wasn't found.
53 | void HandleTraceNotFoundError(const QString path);
54 |
55 | private:
56 | Ui::RecentTracesPane* ui_; ///< Pointer to the Qt UI design.
57 |
58 | QVector trace_widgets_; ///< Array of trace widgets.
59 | QVBoxLayout* vbox_layout_; ///< The vertical layout to handle custom widgets.
60 | QWidget* scroll_area_widget_contents_; ///< The scroll area widget contents widget.
61 | QLabel* no_traces_label_; ///< The no traces label.
62 | };
63 |
64 | #endif // RMV_VIEWS_START_RECENT_TRACES_PANE_H_
65 |
--------------------------------------------------------------------------------
/source/frontend/models/heap_combo_box_model.h:
--------------------------------------------------------------------------------
1 | //=============================================================================
2 | // Copyright (c) 2020-2025 Advanced Micro Devices, Inc. All rights reserved.
3 | /// @author AMD Developer Tools Team
4 | /// @file
5 | /// @brief Header for a model corresponding to a heap combo box.
6 | //=============================================================================
7 |
8 | #ifndef RMV_MODELS_HEAP_COMBO_BOX_MODEL_H_
9 | #define RMV_MODELS_HEAP_COMBO_BOX_MODEL_H_
10 |
11 | #include "qt_common/custom_widgets/arrow_icon_combo_box.h"
12 |
13 | #include "combo_box_model.h"
14 |
15 | namespace rmv
16 | {
17 | /// @brief Model encapsulating everything needed for a heap combo box.
18 | class HeapComboBoxModel : public ComboBoxModel
19 | {
20 | Q_OBJECT
21 |
22 | public:
23 | /// @brief Constructor.
24 | HeapComboBoxModel();
25 |
26 | /// @brief Destructor.
27 | virtual ~HeapComboBoxModel();
28 |
29 | /// @brief Set up the heap combo box taking into account any resources that are to be ignored.
30 | ///
31 | /// @param [in] combo_box Pointer to the combo box to set up.
32 | void SetupHeapComboBox(ArrowIconComboBox* combo_box);
33 |
34 | /// @brief Reset the heap combo box to its default values.
35 | ///
36 | /// @param [in] combo_box Pointer to the combo box to reset.
37 | void ResetHeapComboBox(ArrowIconComboBox* combo_box);
38 |
39 | /// @brief Get the Filter string for the regular expression to be used when filtering a resource list table by heap.
40 | ///
41 | /// @param [in] combo_box Pointer to the combo box to query.
42 | QString GetFilterString(const ArrowIconComboBox* combo_box);
43 |
44 | /// @brief Check the state of the combo box and setup the internal state representation of the ArrowIconComboBox.
45 | ///
46 | /// @param [in] combo_box Pointer to the combo box whose state is to be examined.
47 | void SetupState(const ArrowIconComboBox* combo_box);
48 |
49 | signals:
50 | /// @brief Signal emitted when a combo box item is changed.
51 | ///
52 | /// @param [in] checked The checked state of the filter.
53 | void FilterChanged(bool checked);
54 | };
55 | } // namespace rmv
56 |
57 | #endif // RMV_MODELS_HEAP_COMBO_BOX_MODEL_H_
58 |
--------------------------------------------------------------------------------
/test/source/backend_test/rmv_test_segment_info.h:
--------------------------------------------------------------------------------
1 | //=============================================================================
2 | // Copyright (c) 2020-2025 Advanced Micro Devices, Inc. All rights reserved.
3 | /// @author AMD Developer Tools Team
4 | /// @file
5 | /// @brief Backend test segment info header.
6 | //=============================================================================
7 |
8 | #ifndef RMV_TEST_SEGMENT_INFO_H_
9 | #define RMV_TEST_SEGMENT_INFO_H_
10 |
11 | #include "rmt_data_snapshot.h"
12 |
13 | #include "log.h"
14 |
15 | namespace backend_test
16 | {
17 | class RMVTestSegmentInfo
18 | {
19 | public:
20 | /// @brief Constructor.
21 | RMVTestSegmentInfo();
22 |
23 | /// @brief Destructor.
24 | ~RMVTestSegmentInfo();
25 |
26 | /// @brief Run test cases for the segment info.
27 | ///
28 | /// @param [in] snapshot_index The index of the snapshot being tested.
29 | /// @param [in] snapshot The snapshot to use for the segment tests.
30 | /// @param [in] log The log to write any output to.
31 | ///
32 | /// @return true if the tests passed, false if not.
33 | bool RunTests(int32_t snapshot_index, const RmtDataSnapshot& snapshot, const Log& log);
34 |
35 | private:
36 | /// @brief Test the amount of requested and committed memory for each heap.
37 | ///
38 | /// Ensure that committed memory is <= requested memory.
39 | ///
40 | /// @param [in] snapshot The snapshot to use for the segment tests.
41 | /// @param [in] log The log to write any output to.
42 | ///
43 | /// @return true if the test passed, false if not.
44 | bool TestRequestedAndCommitted(const RmtDataSnapshot& snapshot, const Log& log);
45 |
46 | /// @brief Test the amount of requested and bound memory for each heap.
47 | ///
48 | /// Ensure that bound memory is <= requested memory.
49 | ///
50 | /// @param [in] snapshot The snapshot to use for the segment tests.
51 | /// @param [in] log The log to write any output to.
52 | ///
53 | /// @return true if the test passed, false if not.
54 | bool TestRequestedAndBound(const RmtDataSnapshot& snapshot, const Log& log);
55 | };
56 | } // namespace backend_test
57 |
58 | #endif // RMV_TEST_SEGMENT_INFO_H_
59 |
--------------------------------------------------------------------------------
/source/frontend/models/resource_sorter.cpp:
--------------------------------------------------------------------------------
1 | //=============================================================================
2 | // Copyright (c) 2019-2025 Advanced Micro Devices, Inc. All rights reserved.
3 | /// @author AMD Developer Tools Team
4 | /// @file
5 | /// @brief Implementation for a resource sorter.
6 | ///
7 | /// Contains a list of resources and allows them to be sorted and returns
8 | /// sorted values and smaller values grouped together as "other"
9 | ///
10 | //=============================================================================
11 |
12 | #include "models/resource_sorter.h"
13 |
14 | #include "rmt_assert.h"
15 |
16 | namespace rmv
17 | {
18 | ResourceSorter::ResourceSorter()
19 | {
20 | }
21 |
22 | ResourceSorter::~ResourceSorter()
23 | {
24 | }
25 |
26 | void ResourceSorter::Clear()
27 | {
28 | resource_list_.clear();
29 | }
30 |
31 | void ResourceSorter::AddResource(RmtResourceUsageType type, uint64_t count)
32 | {
33 | ResourceInfo resource_info;
34 | resource_info.type = type;
35 | resource_info.count = count;
36 | resource_list_.push_back(resource_info);
37 | }
38 |
39 | void ResourceSorter::Sort()
40 | {
41 | std::stable_sort(resource_list_.begin(), resource_list_.end(), &ResourceSorter::SortComparator);
42 | }
43 |
44 | size_t ResourceSorter::GetNumResources() const
45 | {
46 | return resource_list_.size();
47 | }
48 |
49 | RmtResourceUsageType ResourceSorter::GetResourceType(size_t index) const
50 | {
51 | RMT_ASSERT(index < resource_list_.size());
52 | return resource_list_[index].type;
53 | }
54 |
55 | uint64_t ResourceSorter::GetResourceValue(size_t index) const
56 | {
57 | RMT_ASSERT(index < resource_list_.size());
58 | return resource_list_[index].count;
59 | }
60 |
61 | int64_t ResourceSorter::GetRemainder(int start_index) const
62 | {
63 | int64_t value = 0;
64 | for (size_t i = start_index; i < GetNumResources(); i++)
65 | {
66 | value += resource_list_[i].count;
67 | }
68 | return value;
69 | }
70 |
71 | bool ResourceSorter::SortComparator(const ResourceInfo& resource_info_a, const ResourceInfo& resource_info_b)
72 | {
73 | return resource_info_a.count > resource_info_b.count;
74 | }
75 | } // namespace rmv
76 |
--------------------------------------------------------------------------------
/source/frontend/models/combo_box_model.h:
--------------------------------------------------------------------------------
1 | //=============================================================================
2 | // Copyright (c) 2019-2025 Advanced Micro Devices, Inc. All rights reserved.
3 | /// @author AMD Developer Tools Team
4 | /// @file
5 | /// @brief Header for a model corresponding to a combo box.
6 | ///
7 | /// This can be used for the ArrowIconComboBoxes when in the checkbox mode,
8 | /// where it's possible to have more than 1 entry selected.
9 | ///
10 | //=============================================================================
11 |
12 | #ifndef RMV_MODELS_COMBO_BOX_MODEL_H_
13 | #define RMV_MODELS_COMBO_BOX_MODEL_H_
14 |
15 | #include
16 | #include
17 | #include
18 |
19 | #include "qt_common/custom_widgets/arrow_icon_combo_box.h"
20 |
21 | namespace rmv
22 | {
23 | /// @brief Base combo box model class.
24 | class ComboBoxModel : public QObject
25 | {
26 | Q_OBJECT
27 |
28 | public:
29 | /// @brief Constructor.
30 | ComboBoxModel();
31 |
32 | /// @brief Destructor.
33 | virtual ~ComboBoxModel();
34 |
35 | /// @brief Set up the list of excluded items.
36 | ///
37 | /// These are items from an enum list that are not shown in the UI so the model
38 | /// also needs to know they are excluded.
39 | ///
40 | /// @param [in] indices The set of indices to exclude.
41 | void SetupExcludeIndexList(const std::set& indices);
42 |
43 | /// @brief Is an item in the list.
44 | ///
45 | /// @param [in] item The item to search for.
46 | ///
47 | /// @return true if so, false otherwise.
48 | bool ItemInList(int item) const;
49 |
50 | protected:
51 | /// @brief Check the state of the combo box and setup the internal state representation
52 | /// of the ArrowIconComboBox.
53 | ///
54 | /// @param [in] combo_box Pointer to the combo box whose state is to be examined.
55 | /// @param [in] all_option True if the combo box contains an "All" option.
56 | void SetupState(const ArrowIconComboBox* combo_box, bool all_option);
57 |
58 | private:
59 | std::set checked_items_list_; ///< The list of checked items.
60 | std::vector excluded_list_; ///< The list of excluded items.
61 | };
62 | } // namespace rmv
63 |
64 | #endif // RMV_MODELS_COMBO_BOX_MODEL_H_
65 |
--------------------------------------------------------------------------------
/source/backend/rmt_trace_loader.h:
--------------------------------------------------------------------------------
1 | //=============================================================================
2 | // Copyright (c) 2022-2025 Advanced Micro Devices, Inc. All rights reserved.
3 | /// @author AMD Developer Tools Team
4 | /// @file
5 | /// @brief Trace loader structures and functions.
6 | //=============================================================================
7 |
8 | #ifndef RMV_BACKEND_RMT_TRACE_LOADER_H_
9 | #define RMV_BACKEND_RMT_TRACE_LOADER_H_
10 |
11 | #include "rmt_data_set.h"
12 |
13 | #ifdef __cplusplus
14 | extern "C" {
15 | #endif // #ifdef __cplusplus
16 |
17 | /// @brief Get a pointer to the internal data set.
18 | ///
19 | /// @return Pointer to the currently loaded data set.
20 | RmtDataSet* RmtTraceLoaderGetDataSet();
21 |
22 | /// @brief Get a pointer to the internal timeline.
23 | ///
24 | /// @return Pointer to the internal timeline.
25 | RmtDataTimeline* RmtTraceLoaderGetTimeline();
26 |
27 | /// @brief Is the data set valid?
28 | ///
29 | /// @return true if the data set is valid, false if not.
30 | bool RmtTraceLoaderDataSetValid();
31 |
32 | /// @brief Load a trace.
33 | ///
34 | /// @param[in] trace_file_name The trace file to load.
35 | /// @param[in] reporter_function The callback function used to report errors.
36 | ///
37 | /// @return an RmtErrorCode indicating whether the trace loaded correctly.
38 | RmtErrorCode RmtTraceLoaderTraceLoad(const char* trace_file_name, RmtDataSetErrorReportFunc reporter_function = nullptr);
39 |
40 | /// @brief Clear out the trace data.
41 | void RmtTraceLoaderClearTrace();
42 |
43 | /// @brief Get a snapshot point from the loaded trace.
44 | ///
45 | /// @param[in] index The snapshot index.
46 | ///
47 | /// @return The snapshot point.
48 | RmtSnapshotPoint* RmtTraceLoaderGetSnapshotPoint(int32_t index);
49 |
50 | /// @brief Get the number of snapshots in the trace.
51 | ///
52 | /// @return The number of snapshots.
53 | int32_t RmtTraceLoaderGetSnapshotCount();
54 |
55 | #ifdef _LINUX
56 | /// @brief Determine if a trace file is already opened by another process.
57 | ///
58 | /// @param[in] trace_file_path The full path of the trace file.
59 | ///
60 | /// @return Determine if a trace file is already opened by another process.
61 | bool RmtTraceLoaderIsTraceAlreadyInUse(const char* trace_file_path);
62 | #endif // #ifdef _LINUX
63 |
64 | #ifdef __cplusplus
65 | }
66 | #endif // #ifdef __cplusplus
67 | #endif // #ifndef RMV_BACKEND_RMT_TRACE_LOADER_H_
68 |
--------------------------------------------------------------------------------
/.clang-tidy:
--------------------------------------------------------------------------------
1 | Checks: bugprone-*,clang-analyzer-*,clang-diagnostic-*,google-*,misc-*,modernize-*,-modernize-use-trailing-return-type,-modernize-concat-nested-namespaces,performance-*,readability-*,-modernize-use-auto
2 | WarningsAsErrors: bugprone-*,clang-analyzer-*,clang-diagnostic-*,google-*,misc-*,modernize-*,performance-*,readability-*
3 | FormatStyle: file
4 | CheckOptions:
5 | - key: readability-identifier-naming.ClassCase
6 | value: CamelCase
7 | - key: readability-identifier-naming.ClassConstantCase
8 | value: CamelCase
9 | - key: readability-identifier-naming.ClassConstantPrefix
10 | value: k
11 | - key: readability-identifier-naming.EnumCase
12 | value: CamelCase
13 | - key: readability-identifier-naming.EnumConstantCase
14 | value: CamelCase
15 | - key: readability-identifier-naming.EnumConstantPrefix
16 | value: k
17 | - key: readability-identifier-naming.FunctionCase
18 | value: CamelCase
19 | - key: readability-identifier-naming.GlobalConstantCase
20 | value: CamelCase
21 | - key: readability-identifier-naming.GlobalConstantPrefix
22 | value: k
23 | - key: readability-identifier-naming.GlobalConstantPointerCase
24 | value: CamelCase
25 | - key: readability-identifier-naming.GlobalConstantPointerPrefix
26 | value: k
27 | - key: readability-identifier-naming.MethodCase
28 | value: CamelCase
29 | - key: readability-identifier-naming.NamespaceCase
30 | value: lower_case
31 | - key: readability-identifier-naming.ParameterCase
32 | value: lower_case
33 | - key: readability-identifier-naming.PrivateMemberCase
34 | value: lower_case
35 | - key: readability-identifier-naming.PrivateMemberSuffix
36 | value: _
37 | - key: readability-identifier-naming.PublicMemberCase
38 | value: lower_case
39 | - key: readability-identifier-naming.StaticConstantCase
40 | value: CamelCase
41 | - key: readability-identifier-naming.StaticConstantPrefix
42 | value: k
43 | - key: readability-identifier-naming.TemplateParameterCase
44 | value: CamelCase
45 | - key: readability-identifier-naming.TypeAliasCase
46 | value: CamelCase
47 | - key: readability-identifier-naming.TypedefCase
48 | value: CamelCase
49 | - key: readability-identifier-naming.UnionCase
50 | value: CamelCase
51 | - key: readability-identifier-naming.VariableCase
52 | value: lower_case
53 |
--------------------------------------------------------------------------------
/source/frontend/windows/rmv.rc:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2021-2025 Advanced Micro Devices, Inc. All rights reserved.
2 | //
3 | // Microsoft Visual C++ generated resource script.
4 | //
5 | #include "resource.h"
6 | #include "../util/version.h"
7 |
8 | #define APSTUDIO_READONLY_SYMBOLS
9 | /////////////////////////////////////////////////////////////////////////////
10 | //
11 | // Generated from the TEXTINCLUDE 2 resource.
12 | //
13 | #include "windows.h"
14 |
15 | /////////////////////////////////////////////////////////////////////////////
16 | #undef APSTUDIO_READONLY_SYMBOLS
17 |
18 | /////////////////////////////////////////////////////////////////////////////
19 | // English (U.S.) resources
20 |
21 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
22 | #ifdef _WIN32
23 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
24 | #pragma code_page(1252)
25 | #endif //_WIN32
26 |
27 | /////////////////////////////////////////////////////////////////////////////
28 | //
29 | // Icon
30 | //
31 |
32 | // Icon with lowest ID value placed first to ensure application icon
33 | // remains consistent on all systems.
34 | IDI_ICON1 ICON "rmv_icon.ico"
35 |
36 | /////////////////////////////////////////////////////////////////////////////
37 | //
38 | // Version
39 | //
40 |
41 | VS_VERSION_INFO VERSIONINFO
42 | FILEVERSION RMV_MAJOR_VERSION, RMV_MINOR_VERSION, RMV_BUGFIX_NUMBER, RMV_BUILD_NUMBER
43 | PRODUCTVERSION RMV_MAJOR_VERSION, RMV_MINOR_VERSION, RMV_BUGFIX_NUMBER, RMV_BUILD_NUMBER
44 | FILEFLAGSMASK 0x17L
45 | #ifdef _DEBUG
46 | FILEFLAGS 0x1L
47 | #else
48 | FILEFLAGS 0x0L
49 | #endif
50 | FILEOS 0x4L
51 | FILETYPE 0x1L
52 | FILESUBTYPE 0x0L
53 | BEGIN
54 | BLOCK "StringFileInfo"
55 | BEGIN
56 | BLOCK "040904b0"
57 | BEGIN
58 | VALUE "CompanyName", "Advanced Micro Devices, Inc."
59 | VALUE "FileDescription", RMV_APP_NAME
60 | VALUE "FileVersion", RMV_VERSION_STRING
61 | VALUE "InternalName", RMV_APP_NAME
62 | VALUE "OriginalFilename", "RMV" ".exe"
63 | VALUE "LegalCopyright", RMV_COPYRIGHT_STRING
64 | VALUE "ProductName", RMV_APP_NAME
65 | VALUE "ProductVersion", RMV_VERSION_STRING
66 | END
67 | END
68 | BLOCK "VarFileInfo"
69 | BEGIN
70 | VALUE "Translation", 0x409, 1200
71 | END
72 | END
73 |
74 | #endif // English (U.S.) resources
75 | /////////////////////////////////////////////////////////////////////////////
76 |
--------------------------------------------------------------------------------
/source/backend/rmt_rdf_file_parser.h:
--------------------------------------------------------------------------------
1 | //=============================================================================
2 | // Copyright (c) 2022-2025 Advanced Micro Devices, Inc. All rights reserved.
3 | /// @author AMD Developer Tools Team
4 | /// @file
5 | /// @brief Definition of the RFD File parser.
6 | //=============================================================================
7 |
8 | #ifndef RMV_PARSER_RMT_RDF_FILE_PARSER_H_
9 | #define RMV_PARSER_RMT_RDF_FILE_PARSER_H_
10 |
11 | #include "rmt_data_set.h"
12 | #include "rmt_error.h"
13 | #include "rmt_types.h"
14 |
15 | #ifdef __cplusplus
16 | extern "C" {
17 | #endif // #ifdef __cplusplus
18 |
19 | /// Loads an RDF memory trace file and populates the data set.
20 | ///
21 | /// @param [in] path A path to the memory trace file to be loaded.
22 | /// @param [in,out] out_data_set A pointer to the data set populated with the trace file information.
23 | ///
24 | /// @retval
25 | /// kRmtOk The trace file loaded successfully.
26 | /// @retval
27 | /// kRmtErrorMalformedData The file contains unexpected data.
28 | /// @retVal
29 | /// kRmtErrorInvalidSize The trace file is missing data.
30 | ///
31 | RmtErrorCode RmtRdfFileParserLoadRdf(const char* path, RmtDataSet* out_data_set);
32 |
33 | /// Delete all RDF data stream objects created while parsing the RDF file.
34 | ///
35 | /// @retval
36 | /// kRmtOk The data streams were successfully deleted.
37 | ///
38 | RmtErrorCode RmtRdfFileParserDestroyAllDataStreams();
39 |
40 | /// Open the global RDF stream.
41 | ///
42 | /// @param [in] path A path to the memory trace file to be loaded.
43 | /// @param [in] read_only Open the file in read only mode if true, otherwise enable write access.
44 | ///
45 | /// @retval
46 | /// kRmtOk The RDF stream was successfully opened.
47 | /// @retval
48 | /// kRmtErrorMalformedData The file contains unexpected data.
49 | ///
50 | RmtErrorCode RmtRdfStreamOpen(const char* path, const bool read_only);
51 |
52 | /// Close the global RDF stream.
53 | ///
54 | /// @retval
55 | /// kRmtOk The RDF stream was successfully closed.
56 | ///
57 | RmtErrorCode RmtRdfStreamClose();
58 |
59 | #ifdef __cplusplus
60 | }
61 | #endif // #ifdef __cplusplus
62 | #endif // #ifndef RMV_PARSER_RMT_RDF_FILE_PARSER_H_
63 |
--------------------------------------------------------------------------------
/source/backend/rmt_thread.h:
--------------------------------------------------------------------------------
1 | //=============================================================================
2 | // Copyright (c) 2019-2025 Advanced Micro Devices, Inc. All rights reserved.
3 | /// @author AMD Developer Tools Team
4 | /// @file
5 | /// @brief Abstraction of a thread.
6 | //=============================================================================
7 |
8 | #ifndef RMV_BACKEND_RMT_THREAD_H_
9 | #define RMV_BACKEND_RMT_THREAD_H_
10 |
11 | #include "rmt_error.h"
12 |
13 | /// Define the size of the thread handle structure (in DWORDS).
14 | #define RMT_THREAD_SIZE (24)
15 |
16 | #ifdef _WIN32
17 | /// The calling convention used by thread functions on Windows platform.
18 | #define RMT_THREAD_FUNC __stdcall
19 | #else
20 | #define RMT_THREAD_FUNC
21 | #endif // #ifdef _WIN32
22 |
23 | #ifdef __cplusplus
24 | extern "C" {
25 | #endif // #ifdef __cplusplus
26 |
27 | /// A handle for a thread.
28 | typedef struct RmtThread
29 | {
30 | uint32_t data[RMT_THREAD_SIZE];
31 | } RmtThread;
32 |
33 | /// A type for the thread function.
34 | typedef uint32_t(RMT_THREAD_FUNC* RmtThreadFunc)(void* input_data);
35 |
36 | /// Create a new thread.
37 | ///
38 | /// @param [in,out] thread A pointer to a RmtThread structure to contain a handle to the thread.
39 | /// @param [in] thread_func The function to execute as the thread's main function.
40 | /// @param [in] input_data Data to pass to the threads inputData parameter.
41 | ///
42 | /// @retval
43 | /// kRmtOk The operation completed successfully.
44 | /// @retval
45 | /// kRmtErrorInvalidPointer The parameter thread or threadFunc was NULL.
46 | /// @retval
47 | /// kRmtErrorPlatformFunctionFailed A platform-specific function failed.
48 | ///
49 | RmtErrorCode RmtThreadCreate(RmtThread* thread, RmtThreadFunc thread_func, void* input_data);
50 |
51 | /// Wait for the thread to exit.
52 | ///
53 | /// @param [in] thread A pointer to a RmtThread structure.
54 | ///
55 | /// @retval
56 | /// kRmtOk The operation completed successfully.
57 | /// @retval
58 | /// kRmtErrorInvalidPointer The parameter thread was NULL.
59 | ///
60 | RmtErrorCode RmtThreadWaitForExit(RmtThread* thread);
61 |
62 | #ifdef __cplusplus
63 | }
64 | #endif // #ifdef __cplusplus
65 | #endif // #ifndef RMV_BACKEND_RMT_THREAD_H_
66 |
--------------------------------------------------------------------------------
/source/frontend/views/custom_widgets/rmv_carousel_resource_types.h:
--------------------------------------------------------------------------------
1 | //=============================================================================
2 | // Copyright (c) 2018-2025 Advanced Micro Devices, Inc. All rights reserved.
3 | /// @author AMD Developer Tools Team
4 | /// @file
5 | /// @brief Header for the carousel resource types widget.
6 | //=============================================================================
7 |
8 | #ifndef RMV_VIEWS_CUSTOM_WIDGETS_RMV_CAROUSEL_RESOURCE_TYPES_H_
9 | #define RMV_VIEWS_CUSTOM_WIDGETS_RMV_CAROUSEL_RESOURCE_TYPES_H_
10 |
11 | #include
12 |
13 | #include "models/carousel_model.h"
14 | #include "views/custom_widgets/rmv_carousel_item.h"
15 |
16 | /// @brief Container class for the carousel's resource types component.
17 | class RMVCarouselResourceTypes : public RMVCarouselItem
18 | {
19 | Q_OBJECT
20 |
21 | public:
22 | /// @brief Constructor.
23 | ///
24 | /// @param [in] config A configuration struct for this object.
25 | explicit RMVCarouselResourceTypes(const RMVCarouselConfig& config);
26 |
27 | /// @brief Destructor.
28 | virtual ~RMVCarouselResourceTypes();
29 |
30 | /// @brief Implementation of Qt's paint for this item.
31 | ///
32 | /// @param [in] painter The painter object to use.
33 | /// @param [in] option Provides style options for the item, such as its state, exposed area and its level-of-detail hints.
34 | /// @param [in] widget Points to the widget that is being painted on if specified.
35 | void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget) Q_DECL_OVERRIDE;
36 |
37 | /// @brief Update the data for this item.
38 | ///
39 | /// @param [in] data New data.
40 | void SetData(const rmv::RMVCarouselData& data) Q_DECL_OVERRIDE;
41 |
42 | private:
43 | /// @brief Helper function to draw color key for a memory usage.
44 | ///
45 | /// @param [in] painter The Qt painter.
46 | /// @param [in] y_offset How far down should this get drawn.
47 | /// @param [in] resource_name The resource name.
48 | /// @param [in] resource_color The resource color.
49 | /// @param [in] usage_amount The data.
50 | void DrawCarouselMemoryUsageLegend(QPainter* painter, uint32_t y_offset, const QString& resource_name, const QColor& resource_color, int32_t usage_amount);
51 |
52 | rmv::RMVCarouselResourceTypesData data_; ///< The model data for this carousel item.
53 | };
54 |
55 | #endif // RMV_VIEWS_CUSTOM_WIDGETS_RMV_CAROUSEL_RESOURCE_TYPES_H_
56 |
--------------------------------------------------------------------------------
/source/frontend/views/settings/settings_pane.h:
--------------------------------------------------------------------------------
1 | //=============================================================================
2 | // Copyright (c) 2018-2025 Advanced Micro Devices, Inc. All rights reserved.
3 | /// @author AMD Developer Tools Team
4 | /// @file
5 | /// @brief Header for the Settings pane.
6 | //=============================================================================
7 |
8 | #ifndef RMV_VIEWS_SETTINGS_SETTINGS_PANE_H_
9 | #define RMV_VIEWS_SETTINGS_SETTINGS_PANE_H_
10 |
11 | #include "ui_settings_pane.h"
12 |
13 | #include "views/base_pane.h"
14 |
15 | /// @brief Class declaration.
16 | class SettingsPane : public BasePane
17 | {
18 | Q_OBJECT
19 |
20 | public:
21 | /// @brief Constructor.
22 | ///
23 | /// @param [in] parent The parent widget.
24 | explicit SettingsPane(QWidget* parent = nullptr);
25 |
26 | /// @brief Destructor.
27 | virtual ~SettingsPane();
28 |
29 | /// @brief Overridden show event. Fired when this pane is opened.
30 | ///
31 | /// @param [in] event the show event object.
32 | virtual void showEvent(QShowEvent* event) Q_DECL_OVERRIDE;
33 |
34 | /// @brief Update time units.
35 | virtual void SwitchTimeUnits() Q_DECL_OVERRIDE;
36 |
37 | public slots:
38 | /// @brief Slot to handle what happens when the auto updates box changes.
39 | ///
40 | /// Update and save the settings.
41 | void CheckForUpdatesOnStartupStateChanged();
42 |
43 | /// @brief Slot to handle what happens when the Driver Overrides notification check box changes.
44 | ///
45 | /// @param checked The new state of the check box.
46 | void DriverOverridesAllowNotificationsChanged(bool checked);
47 |
48 | /// @brief Slot to handle what happens when the time units combo box has changed.
49 | void TimeUnitsChanged();
50 |
51 | /// @brief Slot to handle what happens when the byte units combo box has changed.
52 | void ByteUnitsChanged();
53 |
54 | private:
55 | /// @brief Update the time unit combo box.
56 | ///
57 | /// Take into account that the mapping of the time value enums and the indices
58 | /// in the combo box is not linear.
59 | ///
60 | /// @param [in] units The time units.
61 | void UpdateTimeComboBox(int units);
62 |
63 | /// @brief Update the byte unit combo box.
64 | ///
65 | /// @param [in] units The byte units.
66 | void UpdateByteComboBox(const QString& units);
67 |
68 | Ui::SettingsPane* ui_; ///< Pointer to the Qt UI design.
69 | };
70 |
71 | #endif // RMV_VIEWS_SETTINGS_SETTINGS_PANE_H_
72 |
--------------------------------------------------------------------------------
/test/source/backend_test/windows/backend_test.rc:
--------------------------------------------------------------------------------
1 | // Copyright (c) 2021-2025 Advanced Micro Devices, Inc. All rights reserved.
2 | //
3 | // Microsoft Visual C++ generated resource script.
4 | //
5 | #include "resource.h"
6 | #include "../../source/frontend/util/version.h"
7 |
8 | #define APSTUDIO_READONLY_SYMBOLS
9 | /////////////////////////////////////////////////////////////////////////////
10 | //
11 | // Generated from the TEXTINCLUDE 2 resource.
12 | //
13 | #include "windows.h"
14 |
15 | /////////////////////////////////////////////////////////////////////////////
16 | #undef APSTUDIO_READONLY_SYMBOLS
17 |
18 | /////////////////////////////////////////////////////////////////////////////
19 | // English (U.S.) resources
20 |
21 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
22 | #ifdef _WIN32
23 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
24 | #pragma code_page(1252)
25 | #endif //_WIN32
26 |
27 | /////////////////////////////////////////////////////////////////////////////
28 | //
29 | // Icon
30 | //
31 |
32 | // Icon with lowest ID value placed first to ensure application icon
33 | // remains consistent on all systems.
34 | // IDI_ICON1 ICON "rmv_icon.ico"
35 |
36 | /////////////////////////////////////////////////////////////////////////////
37 | //
38 | // Version
39 | //
40 |
41 | VS_VERSION_INFO VERSIONINFO
42 | FILEVERSION RMV_MAJOR_VERSION, RMV_MINOR_VERSION, RMV_BUGFIX_NUMBER, RMV_BUILD_NUMBER
43 | PRODUCTVERSION RMV_MAJOR_VERSION, RMV_MINOR_VERSION, RMV_BUGFIX_NUMBER, RMV_BUILD_NUMBER
44 | FILEFLAGSMASK 0x17L
45 | #ifdef _DEBUG
46 | FILEFLAGS 0x1L
47 | #else
48 | FILEFLAGS 0x0L
49 | #endif
50 | FILEOS 0x4L
51 | FILETYPE 0x1L
52 | FILESUBTYPE 0x0L
53 | BEGIN
54 | BLOCK "StringFileInfo"
55 | BEGIN
56 | BLOCK "040904b0"
57 | BEGIN
58 | VALUE "CompanyName", "Advanced Micro Devices, Inc."
59 | VALUE "FileDescription", "RMVBackendTest"
60 | VALUE "FileVersion", RMV_VERSION_STRING
61 | VALUE "InternalName", "RMVBackendTest"
62 | VALUE "OriginalFilename", "RMVBackendTest" ".exe"
63 | VALUE "LegalCopyright", RMV_COPYRIGHT_STRING
64 | VALUE "ProductName", "RMVBackendTest"
65 | VALUE "ProductVersion", RMV_VERSION_STRING
66 | END
67 | END
68 | BLOCK "VarFileInfo"
69 | BEGIN
70 | VALUE "Translation", 0x409, 1200
71 | END
72 | END
73 |
74 | #endif // English (U.S.) resources
75 | /////////////////////////////////////////////////////////////////////////////
76 |
--------------------------------------------------------------------------------
/source/frontend/models/proxy_models/allocation_proxy_model.h:
--------------------------------------------------------------------------------
1 | //=============================================================================
2 | // Copyright (c) 2019-2025 Advanced Micro Devices, Inc. All rights reserved.
3 | /// @author AMD Developer Tools Team
4 | /// @file
5 | /// @brief Header for a proxy filter that processes multiple columns
6 | /// of an allocation table.
7 | //=============================================================================
8 |
9 | #ifndef RMV_MODELS_PROXY_MODELS_ALLOCATION_PROXY_MODEL_H_
10 | #define RMV_MODELS_PROXY_MODELS_ALLOCATION_PROXY_MODEL_H_
11 |
12 | #include
13 |
14 | #include "models/allocation_item_model.h"
15 | #include "models/proxy_models/table_proxy_model.h"
16 |
17 | namespace rmv
18 | {
19 | /// @brief Class to filter out and sort an allocation table.
20 | class AllocationProxyModel : public TableProxyModel
21 | {
22 | Q_OBJECT
23 |
24 | public:
25 | /// @brief Constructor.
26 | ///
27 | /// @param [in] parent The parent widget.
28 | explicit AllocationProxyModel(QObject* parent = nullptr);
29 |
30 | /// @brief Destructor.
31 | virtual ~AllocationProxyModel();
32 |
33 | /// @brief Initialize the allocation table model.
34 | ///
35 | /// @param [in] table_view The table view.
36 | /// @param [in] num_rows The table row count.
37 | /// @param [in] num_columns The table column count.
38 | ///
39 | /// @return the model for the allocation table model.
40 | AllocationItemModel* InitializeAllocationTableModels(QTableView* table_view, int num_rows, int num_columns);
41 |
42 | protected:
43 | /// @brief Make the filter run across multiple columns.
44 | ///
45 | /// @param [in] source_row The target row.
46 | /// @param [in] source_parent The source parent.
47 | ///
48 | /// @return true if the row passed the filter, false if not.
49 | virtual bool filterAcceptsRow(int source_row, const QModelIndex& source_parent) const override;
50 |
51 | /// @brief The sort comparator.
52 | ///
53 | /// @param [in] left The left item to compare.
54 | /// @param [in] right The right item to compare.
55 | ///
56 | /// @return true if left is less than right, false otherwise.
57 | virtual bool lessThan(const QModelIndex& left, const QModelIndex& right) const override;
58 | };
59 | } // namespace rmv
60 |
61 | #endif // RMV_MODELS_PROXY_MODELS_ALLOCATION_PROXY_MODEL_H_
62 |
--------------------------------------------------------------------------------
/source/frontend/views/start/recent_traces_pane.ui:
--------------------------------------------------------------------------------
1 |
2 |
3 | RecentTracesPane
4 |
5 |
6 |
7 | 0
8 | 0
9 | 400
10 | 300
11 |
12 |
13 |
14 | -
15 |
16 |
17 | QFrame::NoFrame
18 |
19 |
20 | QFrame::Plain
21 |
22 |
23 | true
24 |
25 |
26 |
27 |
28 | 0
29 | 0
30 | 382
31 | 282
32 |
33 |
34 |
35 |
-
36 |
37 |
38 |
39 | 0
40 | 0
41 |
42 |
43 |
44 |
45 | 75
46 | true
47 |
48 |
49 |
50 | Recent traces
51 |
52 |
53 |
54 | -
55 |
56 |
57 | Qt::Vertical
58 |
59 |
60 |
61 | 20
62 | 40
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 | ScaledLabel
76 | QLabel
77 | qt_common/custom_widgets/scaled_label.h
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
--------------------------------------------------------------------------------
/test/source/backend_test/rmv_test_timestamps.h:
--------------------------------------------------------------------------------
1 | //=============================================================================
2 | // Copyright (c) 2020-2025 Advanced Micro Devices, Inc. All rights reserved.
3 | /// @author AMD Developer Tools Team
4 | /// @file
5 | /// @brief Backend test timestamps header.
6 | //=============================================================================
7 |
8 | #ifndef RMV_TEST_TIMESTAMPS_H_
9 | #define RMV_TEST_TIMESTAMPS_H_
10 |
11 | #include "rmt_data_set.h"
12 | #include "rmt_data_snapshot.h"
13 |
14 | #include "log.h"
15 |
16 | namespace backend_test
17 | {
18 | class RMVTestTimestamps
19 | {
20 | public:
21 | /// @brief Constructor.
22 | RMVTestTimestamps();
23 |
24 | /// @brief Destructor.
25 | ~RMVTestTimestamps();
26 |
27 | /// @brief Run test cases for timestamps.
28 | ///
29 | /// @param [in] snapshot_index The index of the snapshot being tested.
30 | /// @param [in] data_set The data set containing the trace file data.
31 | /// @param [in] snapshot The snapshot to use for the timestamp tests.
32 | /// @param [in] log The log to write any output to.
33 | ///
34 | /// @return true if the tests passed, false if not.
35 | bool RunTests(int32_t snapshot_index, const RmtDataSet& data_set, const RmtDataSnapshot& snapshot, const Log& log);
36 |
37 | private:
38 | /// @brief Make sure any embedded snapshots have timestamps < max timestamp.
39 | ///
40 | /// @param [in] data_set The data set containing the trace file data.
41 | /// @param [in] log The log to write any output to.
42 | /// @param [out] result The test result, passed in from previous tests. This is modified to be false if this test fails.
43 | void TestSnapshotTimestamps(const RmtDataSet& data_set, const Log& log, bool* result);
44 |
45 | /// @brief Make sure all allocations have timestamps < max timestamp.
46 | ///
47 | /// @param [in] data_set The data set containing the trace file data.
48 | /// @param [in] snapshot The snapshot to use for the timestamp tests.
49 | /// @param [in] log The log to write any output to.
50 | /// @param [out] result The test result, passed in from previous tests. This is modified to be false if this test fails.
51 | void TestAllocationTimestamps(const RmtDataSet& data_set, const RmtDataSnapshot& snapshot, const Log& log, bool* result);
52 | };
53 | } // namespace backend_test
54 |
55 | #endif // RMV_TEST_TIMESTAMPS_H_
56 |
--------------------------------------------------------------------------------
/source/frontend/views/custom_widgets/rmv_color_swatch_tooltip_item.cpp:
--------------------------------------------------------------------------------
1 | //=============================================================================
2 | // Copyright (c) 2020-2025 Advanced Micro Devices, Inc. All rights reserved.
3 | /// @author AMD Developer Tools Team
4 | /// @file
5 | /// @brief Implementation of a custom tooltip comprising of a multiline
6 | /// text string with a color swatch before each line of text.
7 | ///
8 | /// Implemented on top of QGraphicsSimpleTextItem and uses the base class
9 | /// setText() to store the text and the custom color data is set in setData().
10 | ///
11 | //=============================================================================
12 |
13 | #include "views/custom_widgets/rmv_color_swatch_tooltip_item.h"
14 |
15 | RMVColorSwatchTooltipItem::RMVColorSwatchTooltipItem(QGraphicsItem* parent)
16 | : QGraphicsSimpleTextItem(parent)
17 | , icon_size_(0)
18 | {
19 | }
20 |
21 | RMVColorSwatchTooltipItem::~RMVColorSwatchTooltipItem()
22 | {
23 | }
24 |
25 | QRectF RMVColorSwatchTooltipItem::boundingRect() const
26 | {
27 | QRectF rect = QGraphicsSimpleTextItem::boundingRect();
28 | qreal width = rect.width();
29 | rect.setWidth(width + icon_size_);
30 | return rect;
31 | }
32 |
33 | void RMVColorSwatchTooltipItem::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget)
34 | {
35 | Q_UNUSED(option);
36 | Q_UNUSED(widget);
37 |
38 | QStringList line_list = text().split("\n");
39 | int num_rows = line_list.size();
40 | if (num_rows > 0)
41 | {
42 | painter->setFont(font());
43 |
44 | const int text_height = boundingRect().height() / num_rows;
45 | icon_size_ = text_height - 2;
46 |
47 | int offset = 0;
48 | for (auto index = 0; index < line_list.size(); index++)
49 | {
50 | QString color = data(index).toString();
51 |
52 | // If the tooltip item contains a color string, drawn the swatch followed by the text.
53 | // Otherwise, just draw the text (split the difference of the swatch rectangle width to center the text).
54 | if (color.length() > 0)
55 | {
56 | painter->fillRect(0, offset + 1, icon_size_, icon_size_, QColor(color));
57 | painter->drawText(icon_size_ + 1, icon_size_ + offset, line_list[index]);
58 | }
59 | else
60 | {
61 | painter->drawText((icon_size_ / 2) + 1, icon_size_ + offset, line_list[index]);
62 | }
63 |
64 | offset += text_height;
65 | }
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/source/frontend/models/proxy_models/resource_details_proxy_model.h:
--------------------------------------------------------------------------------
1 | //=============================================================================
2 | // Copyright (c) 2019-2025 Advanced Micro Devices, Inc. All rights reserved.
3 | /// @author AMD Developer Tools Team
4 | /// @file
5 | /// @brief Header for a proxy filter that processes the resource details table
6 | /// in the resource details pane.
7 | //=============================================================================
8 |
9 | #ifndef RMV_MODELS_PROXY_MODELS_RESOURCE_DETAILS_PROXY_MODEL_H_
10 | #define RMV_MODELS_PROXY_MODELS_RESOURCE_DETAILS_PROXY_MODEL_H_
11 |
12 | #include
13 |
14 | #include "models/proxy_models/table_proxy_model.h"
15 | #include "models/snapshot/resource_timeline_item_model.h"
16 |
17 | namespace rmv
18 | {
19 | /// @brief Class to filter out and sort the resource details table.
20 | class ResourceDetailsProxyModel : public TableProxyModel
21 | {
22 | Q_OBJECT
23 |
24 | public:
25 | /// @brief Constructor.
26 | ///
27 | /// @param [in] parent The parent widget.
28 | explicit ResourceDetailsProxyModel(QObject* parent = nullptr);
29 |
30 | /// @brief Destructor.
31 | virtual ~ResourceDetailsProxyModel();
32 |
33 | /// @brief Initialize the resource table model.
34 | ///
35 | /// @param [in] view The table view.
36 | /// @param [in] num_rows The table row count.
37 | /// @param [in] num_columns The table column count.
38 | ///
39 | /// @return the model for the resource table model.
40 | ResourceTimelineItemModel* InitializeResourceTableModels(QTableView* view, int num_rows, int num_columns);
41 |
42 | protected:
43 | /// @brief Make the filter run across multiple columns.
44 | ///
45 | /// @param [in] source_row The target row.
46 | /// @param [in] source_parent The source parent.
47 | ///
48 | /// @return true if the row passed the filter, false if not.
49 | virtual bool filterAcceptsRow(int source_row, const QModelIndex& source_parent) const override;
50 |
51 | /// @brief The sort comparator.
52 | ///
53 | /// @param [in] left The left item to compare.
54 | /// @param [in] right The right item to compare.
55 | ///
56 | /// @return true if left is less than right, false otherwise.
57 | virtual bool lessThan(const QModelIndex& left, const QModelIndex& right) const override;
58 | };
59 | } // namespace rmv
60 |
61 | #endif // RMV_MODELS_PROXY_MODELS_RESOURCE_DETAILS_PROXY_MODEL_H_
62 |
--------------------------------------------------------------------------------
/source/parser/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | #######################################################################################################################
2 | ### Copyright (c) 2019-2025 Advanced Micro Devices, Inc. All rights reserved.
3 | ### \author AMD Developer Tools Team
4 | #######################################################################################################################
5 |
6 | cmake_minimum_required(VERSION 3.10)
7 | project(RmvParser)
8 |
9 | add_definitions(-DRDF_CXX_BINDINGS)
10 |
11 | set(CMAKE_INCLUDE_CURRENT_DIR ON)
12 | include_directories(AFTER ../parser)
13 |
14 | # List of all source files. It may be possible to have the build process call cmake to update the makefiles
15 | # only when this file has changed (ie source files have been added or removed)
16 |
17 | set( SOURCES
18 | "rmt_address_helper.cpp"
19 | "rmt_address_helper.h"
20 | "rmt_assert.cpp"
21 | "rmt_assert.h"
22 | "rmt_constants.h"
23 | "rmt_error.h"
24 | "rmt_file_format.h"
25 | "rmt_file_format.cpp"
26 | "rmt_format.h"
27 | "rmt_parser.cpp"
28 | "rmt_parser.h"
29 | "rmt_platform.cpp"
30 | "rmt_platform.h"
31 | "rmt_print.cpp"
32 | "rmt_print.h"
33 | "rmt_profile.h"
34 | "rmt_rdf_data_stream.cpp"
35 | "rmt_rdf_data_stream.h"
36 | "rmt_rdf_dd_event_info.cpp"
37 | "rmt_rdf_dd_event_info.h"
38 | "rmt_rdf_gpu_mem_segment_info.cpp"
39 | "rmt_rdf_gpu_mem_segment_info.h"
40 | "rmt_rdf_snapshot_index.cpp"
41 | "rmt_rdf_snapshot_index.h"
42 | "rmt_rdf_snapshot_info.cpp"
43 | "rmt_rdf_snapshot_info.h"
44 | "rmt_string_memory_pool.cpp"
45 | "rmt_string_memory_pool.h"
46 | "rmt_token.cpp"
47 | "rmt_token.h"
48 | "rmt_token_heap.cpp"
49 | "rmt_token_heap.h"
50 | "rmt_types.h"
51 | "rmt_util.h"
52 | )
53 |
54 | set( LINUX_SOURCES
55 | "linux/safe_crt.cpp"
56 | "linux/safe_crt.h"
57 | )
58 |
59 |
60 | # specify output library name
61 | IF(WIN32)
62 | add_library(${PROJECT_NAME} ${SOURCES})
63 | ELSEIF(UNIX)
64 | add_library(${PROJECT_NAME} ${SOURCES} ${LINUX_SOURCES})
65 | ENDIF(WIN32)
66 |
67 | set_property(TARGET ${PROJECT_NAME} PROPERTY POSITION_INDEPENDENT_CODE ON)
68 |
69 | IF(WIN32)
70 | # Create Visual Studio filters so that the source files in the project match the directory structure
71 | foreach(source IN LISTS SOURCES)
72 | get_filename_component(source_path "${source}" PATH)
73 | string(REPLACE "/" "\\" source_path_msvc "${source_path}")
74 | source_group("${source_path_msvc}" FILES "${source}")
75 | endforeach()
76 | ENDIF(WIN32)
77 |
78 | devtools_target_options(${PROJECT_NAME})
79 |
80 |
--------------------------------------------------------------------------------
/source/backend/rmt_snapshot_writer.h:
--------------------------------------------------------------------------------
1 | //=============================================================================
2 | // Copyright (c) 2023-2025 Advanced Micro Devices, Inc. All rights reserved.
3 | /// @author AMD Developer Tools Team
4 | /// @file
5 | /// @brief Base class that handles writing snapshot data.
6 | //=============================================================================
7 |
8 | #ifndef RMV_BACKEND_RMT_SNAPSHOT_WRITER_H_
9 | #define RMV_BACKEND_RMT_SNAPSHOT_WRITER_H_
10 |
11 | #include "rmt_data_set.h"
12 | #include "rmt_error.h"
13 |
14 | // The base class that handles writing snapshot data.
15 | class RmtSnapshotWriter
16 | {
17 | public:
18 | /// Constructor for the RmtSnapshotWriter
19 | ///
20 | /// @param [in] data_set A pointer to the RmtDataSetdata object.
21 | explicit RmtSnapshotWriter(RmtDataSet* data_set);
22 |
23 | /// Destructor for the RmtSnapshotWriter
24 | virtual ~RmtSnapshotWriter();
25 |
26 | /// Add a snapshot to a trace file.
27 | ///
28 | /// @param [in] name A pointer to the data set containing the events.
29 | /// @param [in] timestamp The position on the timeline of the snapshot.
30 | /// @param [in] new_snapshot_index The index of the snapshot in the data set to be added.
31 | ///
32 | /// @retval
33 | /// kRmtOk The operation completed successfully.
34 | /// @retval
35 | /// kRmtErrorMalformedData The operation failed.
36 | /// @retval
37 | /// kRmtErrorInvalidPointer The operation failed because of an invalid pointer.
38 | virtual RmtErrorCode Add(const char* name, const uint64_t timestamp, const uint16_t new_snapshot_index) const = 0;
39 |
40 | /// Remove a snapshot from a trace file.
41 | ///
42 | /// @param [in] new_snapshot_index The index of the snapshot in the data set to be removed.
43 | ///
44 | /// @retval
45 | /// kRmtOk The operation completed successfully.
46 | /// @retval
47 | /// kRmtErrorMalformedData The operation failed.
48 | /// @retval
49 | /// kRmtErrorInvalidPointer The operation failed because of an invalid pointer.
50 | virtual RmtErrorCode Remove(const uint16_t removed_snapshot_index) const = 0;
51 |
52 | protected:
53 | RmtDataSet* data_set_; ///< A pointer to the RMT data set.
54 | };
55 | #endif // #ifndef RMV_BACKEND_RMT_SNAPSHOT_WRITER_H_
56 |
--------------------------------------------------------------------------------
/source/frontend/views/custom_widgets/rmv_tooltip.h:
--------------------------------------------------------------------------------
1 | //=============================================================================
2 | // Copyright (c) 2020-2025 Advanced Micro Devices, Inc. All rights reserved.
3 | /// @author AMD Developer Tools Team
4 | /// @file
5 | /// @brief Header for the custom tooltips.
6 | ///
7 | /// Comprises of a tooltip data item (either text or swatches) and a
8 | /// background. Both of these objects are derived from QGraphicsItem so can be
9 | /// added to any scene. This class takes care of making sure the tooltip is
10 | /// placed around about the mouse position and clipping it to the view
11 | /// rectangle.
12 | ///
13 | //=============================================================================
14 |
15 | #ifndef RMV_VIEWS_CUSTOM_WIDGETS_RMV_TOOLTIP_H_
16 | #define RMV_VIEWS_CUSTOM_WIDGETS_RMV_TOOLTIP_H_
17 |
18 | #include
19 | #include
20 |
21 | /// @brief Container class for a custom tooltip.
22 | class RMVTooltip
23 | {
24 | public:
25 | /// @brief Constructor.
26 | explicit RMVTooltip();
27 |
28 | /// @brief Destructor.
29 | virtual ~RMVTooltip();
30 |
31 | /// @brief Create the tool tip.
32 | ///
33 | /// @param [in] scene The graphics scene on which to place the tooltip.
34 | /// @param [in] color_swatch Is a color swatch needed for this tooltip.
35 | void CreateToolTip(QGraphicsScene* scene, bool color_swatch);
36 |
37 | /// @brief Update the tool tip.
38 | ///
39 | /// @param [in] mouse_pos The mouse position in the parent view.
40 | /// @param [in] scene_pos The mouse position in the scene.
41 | /// @param [in] view_width The width of the parent view.
42 | /// @param [in] view_height The height of the parent view.
43 | void UpdateToolTip(const QPointF& mouse_pos, const QPointF& scene_pos, const qreal view_width, const qreal view_height);
44 |
45 | /// @brief Hide the tool tip.
46 | void HideToolTip();
47 |
48 | /// @brief Set the text for this tooltip.
49 | ///
50 | /// @param [in] text_string The text to display in the tooltip.
51 | void SetText(const QString& text_string);
52 |
53 | /// @brief Set the colors for this tooltip.
54 | ///
55 | /// @param [in] color_string The colors for the swatches for each line of text.
56 | void SetColors(const QString& color_string);
57 |
58 | private:
59 | QGraphicsSimpleTextItem* tooltip_contents_; ///< Contents of the custom tool tip implementation.
60 | QGraphicsRectItem* tooltip_background_; ///< Background rect of the custom tool tip implementation.
61 | };
62 |
63 | #endif // RMV_VIEWS_CUSTOM_WIDGETS_RMV_TOOLTIP_H_
64 |
--------------------------------------------------------------------------------
/source/frontend/models/snapshot/allocation_overview_model.cpp:
--------------------------------------------------------------------------------
1 | //=============================================================================
2 | // Copyright (c) 2018-2025 Advanced Micro Devices, Inc. All rights reserved.
3 | /// @author AMD Developer Tools Team
4 | /// @file
5 | /// @brief Implementation for the allocation overview model.
6 | //=============================================================================
7 |
8 | #include "models/snapshot/allocation_overview_model.h"
9 |
10 | #include
11 |
12 | #include "rmt_assert.h"
13 |
14 | #include "managers/trace_manager.h"
15 | #include "util/string_util.h"
16 |
17 | namespace rmv
18 | {
19 | AllocationOverviewModel::AllocationOverviewModel(int32_t num_allocation_models)
20 | : ModelViewMapper(kAllocationOverviewNumWidgets)
21 | , sort_mode_(AllocationOverviewModel::SortMode::kSortModeAllocationSize)
22 | , sort_ascending_(false)
23 | {
24 | allocation_bar_model_ = new MultiAllocationBarModel(num_allocation_models);
25 | ResetModelValues();
26 | }
27 |
28 | AllocationOverviewModel::~AllocationOverviewModel()
29 | {
30 | delete allocation_bar_model_;
31 | }
32 |
33 | void AllocationOverviewModel::ResetModelValues()
34 | {
35 | allocation_bar_model_->ResetModelValues();
36 | }
37 |
38 | size_t AllocationOverviewModel::GetViewableAllocationCount() const
39 | {
40 | return allocation_bar_model_->GetViewableAllocationCount();
41 | }
42 |
43 | void AllocationOverviewModel::SetNormalizeAllocations(bool normalized)
44 | {
45 | allocation_bar_model_->SetNormalizeAllocations(normalized);
46 | }
47 |
48 | void AllocationOverviewModel::Sort(int sort_mode, bool ascending)
49 | {
50 | sort_mode_ = static_cast(sort_mode);
51 | sort_ascending_ = ascending;
52 | allocation_bar_model_->Sort(sort_mode, ascending);
53 | }
54 |
55 | void AllocationOverviewModel::ApplyFilters(const QString& filter_text, const bool* heap_array_flags)
56 | {
57 | ResetModelValues();
58 | allocation_bar_model_->ApplyAllocationFilters(filter_text, heap_array_flags, sort_mode_, sort_ascending_);
59 | }
60 |
61 | size_t AllocationOverviewModel::SelectResource(RmtResourceIdentifier resource_identifier, int32_t model_index)
62 | {
63 | return allocation_bar_model_->SelectResource(resource_identifier, model_index);
64 | }
65 |
66 | MultiAllocationBarModel* AllocationOverviewModel::GetAllocationBarModel() const
67 | {
68 | return allocation_bar_model_;
69 | }
70 | } // namespace rmv
71 |
--------------------------------------------------------------------------------
/source/parser/rmt_string_memory_pool.h:
--------------------------------------------------------------------------------
1 | //=============================================================================
2 | // Copyright (c) 2023-2025 Advanced Micro Devices, Inc. All rights reserved.
3 | /// @author AMD Developer Tools Team
4 | /// @file
5 | /// @brief Definition of structures and functions for a dynamic memory pool
6 | /// allocator optimized for small text strings.
7 | //=============================================================================
8 |
9 | #ifndef RMV_PARSER_RMT_STRING_MEMORY_POOL_H_
10 | #define RMV_PARSER_RMT_STRING_MEMORY_POOL_H_
11 |
12 | #include
13 |
14 | #include "rmt_error.h"
15 |
16 | /// A class for allocating text string memory buffers.
17 | /// These are typically very small strings so internally a memory pool is used.
18 | /// Since items are only ever added to the buffer, there is no need to add
19 | /// functionality to deal with deleting or defragmenting memory until all allocated
20 | /// memory is freed.
21 | class RmtStringMemoryPool
22 | {
23 | public:
24 | /// Constructor for initializing the RmtStringMemoryPool class.
25 | ///
26 | /// @param [in] block_size The size of a single block to allocate.
27 | RmtStringMemoryPool(const size_t block_size);
28 |
29 | /// Deletes all allocated memory blocks from the pool.
30 | ~RmtStringMemoryPool();
31 |
32 | /// Allocate a memory buffer for a text string.
33 | ///
34 | /// @param [in] buffer_size The size of the memory buffer requested.
35 | /// @param [in/out] out_buffer A pointer to the allocated memory buffer.
36 | ///
37 | /// @retval
38 | /// kRmtOk The operation completed succesfully.
39 | /// @retval
40 | /// kRmtErrorInvalidPointer The operation failed because out_buffer is invalid.
41 | RmtErrorCode Allocate(const size_t buffer_size, char** out_buffer);
42 |
43 | /// Delete all allocated memory blocks for the memory pool.
44 | ///
45 | /// @retval
46 | /// kRmtOk The operation completed succesfully.
47 | RmtErrorCode FreeAll();
48 |
49 | private:
50 | std::vector memory_pool_blocks_; ///< A list of all memory blocks that have been allocated.
51 | size_t memory_pool_block_size_; ///< The size of memory block allocations.
52 | char* memory_pool_buffer_; ///< A pointer to the current memory block.
53 | size_t memory_pool_buffer_offset_; ///< The offset in the current memory block being allocated.
54 | };
55 | #endif // #ifndef RMV_PARSER_RMT_STRING_MEMORY_POOL_H_
56 |
--------------------------------------------------------------------------------
/source/backend/rmt_legacy_snapshot_writer.h:
--------------------------------------------------------------------------------
1 | //=============================================================================
2 | // Copyright (c) 2023-2025 Advanced Micro Devices, Inc. All rights reserved.
3 | /// @author AMD Developer Tools Team
4 | /// @file
5 | /// @brief Class that handles writing snapshot data to legacy trace files.
6 | //=============================================================================
7 |
8 | #ifndef RMV_BACKEND_RMT_LEGACY_SNAPSHOT_WRITER_H_
9 | #define RMV_BACKEND_RMT_LEGACY_SNAPSHOT_WRITER_H_
10 |
11 | #include "rmt_data_set.h"
12 | #include "rmt_error.h"
13 |
14 | #include "rmt_snapshot_writer.h"
15 |
16 | // A class that handles writing snapshot data for legacy trace files.
17 | class RmtLegacySnapshotWriter : public RmtSnapshotWriter
18 | {
19 | public:
20 | /// Constructor for the RmtLegacySnapshotWriter
21 | ///
22 | /// @param [in] data_set A pointer to the RmtDataSetdata object.
23 | explicit RmtLegacySnapshotWriter(RmtDataSet* data_set);
24 |
25 | /// Destructor for the RmtSnapshotWriter
26 | ~RmtLegacySnapshotWriter();
27 |
28 | /// Add a snapshot to a trace file.
29 | ///
30 | /// @param [in] name A pointer to the data set containing the events.
31 | /// @param [in] timestamp The position on the timeline of the snapshot.
32 | /// @param [in] new_snapshot_index The index of the snapshot in the data set to be added.
33 | ///
34 | /// @retval
35 | /// kRmtOk The operation completed successfully.
36 | /// @retval
37 | /// kRmtErrorMalformedData The operation failed.
38 | /// @retval
39 | /// kRmtErrorInvalidPointer The operation failed because of an invalid pointer.
40 | RmtErrorCode Add(const char* name, const uint64_t timestamp, const uint16_t new_snapshot_index) const;
41 |
42 | /// Remove a snapshot from a trace file.
43 | ///
44 | /// @param [in] new_snapshot_index The index of the snapshot in the data set to be removed.
45 | ///
46 | /// @retval
47 | /// kRmtOk The operation completed successfully.
48 | /// @retval
49 | /// kRmtErrorMalformedData The operation failed.
50 | /// @retval
51 | /// kRmtErrorInvalidPointer The operation failed because of an invalid pointer.
52 | RmtErrorCode Remove(const uint16_t removed_snapshot_index) const;
53 | };
54 | #endif // #ifndef RMV_BACKEND_RMT_LEGACY_SNAPSHOT_WRITER_H_
55 |
--------------------------------------------------------------------------------