Skip to content

Commit de5ef12

Browse files
committed
Update source code for RMV v1.10 release
1 parent a20908b commit de5ef12

File tree

78 files changed

+567
-568
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+567
-568
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ documentation/build
1111
documentation/source/_build
1212
source/frontend/util/version.h
1313
Buildinfo.properties
14+
external
1415
.vscode
1516
*.aps
16-

BUILD.md

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,21 @@ Clone the project radeon_memory_visualizer from github.com
77
git clone https://github.com/GPUOpen-Tools/radeon_memory_visualizer.git
88
```
99

10+
### Get Qt6
11+
Qt V6.7.0 can be installed using the Qt online installer available from the Qt 6.7.0 release page [here][qt-online].
12+
As an alternative, the Qt 6.7.0 offline installer can be used [here][qt-offline].
13+
Packages for Windows and Linux are provided.
14+
1015
### Building on Windows
1116
As a preliminary step, make sure that you have the following installed on your system:
1217
* CMake 3.11 or above.
1318
* Python 3.7 or above.
14-
* Qt® 5 or above (5.15.2 is the default and recommended).
19+
* Qt® 6 or above (6.7.0 is the default and recommended).
1520
* Visual Studio® 2015 or above (2019 is the default).
1621

17-
Qt V5.15.2 can be installed using the Qt online installer available from the Qt 5.15.2 release page [here][qt-online].
18-
As an alternative, the Qt 5.12.6 offline installer can be used [here][qt-offline].
19-
Qt should be installed to the default location (C:\Qt\Qt5.xx.x).
22+
Qt should be installed to the default location (C:\Qt\Qt6.xx.x).
2023
Be sure to select msvc2017/msvc2019 64-bit during Qt installation, depending on the compiler you decide to use.
24+
Select msvc2019 if using Visual Studio 2022.
2125
A reboot is required after Qt is installed.
2226

2327
CMake can be downloaded from [here](https://cmake.org/download/).
@@ -27,7 +31,7 @@ This can be installed once Python is installed, as follows:
2731
* pip install -U sphinx
2832
* pip install sphinx_rtd_theme
2933

30-
Run the python pre_build.py script in the build folder from a command prompt. If no command line options are provided, the defaults will be used (Qt 5.15.2 and Visual Studio 2019)
34+
Run the python pre_build.py script in the build folder from a command prompt. If no command line options are provided, the defaults will be used (Qt 6.7.0 and Visual Studio 2022)
3135

3236
Some useful options of the pre_build.py script:
3337
* --vs <Visual Studio version>: generate the solution files for a specific Visual Studio version. For example, to target Visual Studio 2017, add --vs 2017 to the command.
@@ -38,6 +42,8 @@ Go into the 'vs2019' folder (build/win/vs2019) and double click on the RMV.sln f
3842
The Release and Debug builds of RMV will be available in the build/release and build/debug folders.
3943

4044
### Building on Ubuntu
45+
If Qt is installed from a Qt installer, it should be installed to ~/Qt/Qt6.7.0 (the default of ~/Qt6.7.0 will not work).
46+
4147
Required dependencies can be installed as follows:
4248
```bash
4349
sudo apt-get update
@@ -51,21 +57,26 @@ sudo apt-get install python3-sphinx
5157
sudo apt-get install libxcb-xinerama0
5258
sudo apt-get install mesa-common-dev libglu1-mesa-dev
5359
```
54-
Qt V5.15.2 can be installed using the Qt online installer available from the Qt 5.15.2 release page [here][qt-online].
55-
As an alternative, the Qt 5.12.6 offline installer can be used [here][qt-offline] (the .run file) and installed
56-
to ~/Qt/Qt5.12.6 (the default of ~/Qt5.12.6 will not work).
5760

58-
XCB libraries are required for Qt v5.15.x (they are not needed for older Qt versions). By default, the CMake configuration will attempt to copy
59-
these files from the Qt lib folder. If needed, the XCB library files (libxcb*) can be obtained from the /lib folder of the Radeon Developer Tool
60-
Suite download found [here](https://gpuopen.com/tools/).
61+
Qt6 can be installed from the package manager using:
62+
```bash
63+
sudo apt-get install qt6-base-dev
64+
sudo apt-get install qt6-base-private-dev
65+
```
66+
As of this writing, this package on Ubuntu 2204 is 6.2.4
67+
68+
XCB libraries are required for Qt v5 and above. These can be installed by using:
69+
```bash
70+
sudo apt-get install libxcb-cursor-dev
71+
```
6172

6273
Run the python pre_build.py in the build folder.
6374
```bash
6475
python3 pre_build.py
6576
```
6677
Or run the pre_build.py script with the -qt option to specify another version of Qt. For example:
6778
```bash
68-
python3 pre_build.py --qt 5.12.6
79+
python3 pre_build.py --qt 6.7.0
6980
```
7081
The pre_build.py script will construct the output folders and build the necessary makefiles.
7182
To build the release build, use:
@@ -81,25 +92,14 @@ Alternatively, building can be done directly from the prebuild script with the -
8192
python3 pre_build.py --build
8293
```
8394

84-
It is possible to use the system-installed version of Qt rather than using a Qt installer described above. At the time of this writing, Ubuntu 22.04 LTS
85-
comes with Qt 5.15.3. To use the system Qt, a fake Qt package is needed. For Qt 5.15.3, this can be made by creating the required directory structure
95+
If Qt is not installed from a Qt installer, a fake Qt package is needed. This can be made by creating the required directory structure
8696
and setting up symbolic links to point to the system Qt lib and include directories:
8797
```bash
88-
mkdir -p ~/Qt/Qt5.15.3/5.15.3/gcc_64
89-
sudo ln -s /usr/lib/x86_64-linux-gnu ~/Qt/Qt5.15.3/5.15.3/gcc_64/lib
90-
sudo ln -s /usr/include/x86_64-linux-gnu/qt5 ~/Qt/Qt5.15.3/5.15.3/gcc_64/include
91-
```
92-
python3 pre_build.py --qt 5.15.3 --qt-system --build
93-
94-
Some additional Qt components may be required, so install those:
95-
96-
```
97-
sudo apt-get install qtbase5-dev
98-
sudo apt-get install qtbase5-dev-tools
99-
sudo apt-get install libqt5svg5-dev
100-
sudo apt-get install libqt5x11extras5
101-
sudo apt-get install qtbase5-private-dev
98+
mkdir -p ~/Qt/Qt6.7.0/6.7.0/gcc_64
99+
sudo ln -s /usr/lib/x86_64-linux-gnu ~/Qt/Qt6.7.0/6.7.0/gcc_64/lib
100+
sudo ln -s /usr/include/x86_64-linux-gnu/qt6 ~/Qt/Qt6.7.0/6.7.0/gcc_64/include
102101
```
102+
python3 pre_build.py --qt 6.7.0 --build
103103

104-
[qt-online]: https://www.qt.io/blog/qt-5.15.2-released
105-
[qt-offline]: https://download.qt.io/archive/qt/5.12/5.12.6/
104+
[qt-online]: https://www.qt.io/blog/qt-6.7-released
105+
[qt-offline]: https://download.qt.io/archive/qt/6.7/6.7.0

CMakeLists.txt

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,12 @@ cmake_minimum_required(VERSION 3.11)
77

88
set(SYSTEM_INFO_BUILD_RDF_INTERFACES ON)
99

10-
1110
## Specify the top level name of the project - this will define the solution name for Visual Studio
1211
project(RMV)
1312

1413
# Define version information
1514
set(RMV_MAJOR_VERSION 1)
16-
set(RMV_MINOR_VERSION 9)
15+
set(RMV_MINOR_VERSION 10)
1716
if (NOT RMV_BUGFIX_NUMBER)
1817
set(RMV_BUGFIX_NUMBER 0)
1918
endif ()
@@ -60,7 +59,6 @@ ELSE(WIN32)
6059
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/../../debug)
6160
ENDIF(WIN32)
6261

63-
6462
# Add for CentOS compiler warning
6563
add_definitions(-DJSON_SKIP_UNSUPPORTED_COMPILER_CHECK)
6664

@@ -168,18 +166,6 @@ if(SPHINX_EXECUTABLE)
168166
COMMAND ${CMAKE_COMMAND} -E echo "building Sphinx documentation"
169167
COMMAND ${SPHINX_EXECUTABLE} ${CMAKE_SOURCE_DIR}/documentation/source ${DOCS_OUTPUT_DIR}/help/rmv/. -t ${SPHINX_OPTION}
170168
COMMAND ${CMAKE_COMMAND} -E remove_directory ${DOCS_OUTPUT_DIR}/help/rmv/.doctrees
171-
COMMAND ${CMAKE_COMMAND} -E remove ${DOCS_OUTPUT_DIR}/help/rmv/allocation_explorer.html
172-
COMMAND ${CMAKE_COMMAND} -E remove ${DOCS_OUTPUT_DIR}/help/rmv/allocation_overview.html
173-
COMMAND ${CMAKE_COMMAND} -E remove ${DOCS_OUTPUT_DIR}/help/rmv/capture.html
174-
COMMAND ${CMAKE_COMMAND} -E remove ${DOCS_OUTPUT_DIR}/help/rmv/carousel.html
175-
COMMAND ${CMAKE_COMMAND} -E remove ${DOCS_OUTPUT_DIR}/help/rmv/heap_overview.html
176-
COMMAND ${CMAKE_COMMAND} -E remove ${DOCS_OUTPUT_DIR}/help/rmv/memory_leak_finder.html
177-
COMMAND ${CMAKE_COMMAND} -E remove ${DOCS_OUTPUT_DIR}/help/rmv/resource_details.html
178-
COMMAND ${CMAKE_COMMAND} -E remove ${DOCS_OUTPUT_DIR}/help/rmv/resource_list.html
179-
COMMAND ${CMAKE_COMMAND} -E remove ${DOCS_OUTPUT_DIR}/help/rmv/resource_overview.html
180-
COMMAND ${CMAKE_COMMAND} -E remove ${DOCS_OUTPUT_DIR}/help/rmv/settings.html
181-
COMMAND ${CMAKE_COMMAND} -E remove ${DOCS_OUTPUT_DIR}/help/rmv/snapshot_delta.html
182-
COMMAND ${CMAKE_COMMAND} -E remove ${DOCS_OUTPUT_DIR}/help/rmv/timeline.html
183169
)
184170
else()
185171
message(WARNING "SPHINX_EXECUTABLE (sphinx-build) is not found! Documentation will not be built!")
@@ -194,5 +180,3 @@ add_custom_command(TARGET Documentation POST_BUILD
194180
COMMAND ${CMAKE_COMMAND} -E make_directory ${DOCS_OUTPUT_DIR}/samples
195181
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_SOURCE_DIR}/samples/sample_trace.rmv ${DOCS_OUTPUT_DIR}/samples/.
196182
)
197-
198-

build/dependency_map.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@
2121
# Define a set of dependencies that exist as separate git projects.
2222
# each git dependency has a desired directory where it will be cloned - along with a commit to checkout
2323
git_mapping = {
24-
github_tools + "QtCommon" : ["../external/qt_common", "v3.12.0", True],
25-
github_tools + "UpdateCheckApi" : ["../external/update_check_api", "v2.1.0", True],
24+
github_tools + "qt_common" : ["../external/qt_common", "v4.0.0", True],
25+
github_tools + "update_check_api" : ["../external/update_check_api", "v2.1.1", True],
2626
github_tools + "system_info_utils" : ["../external/system_info_utils", "88a338a01949f8d8bad60a30b78b65300fd13a9f", False],
2727
github_root + "GPUOpen-Drivers/libamdrdf" : ["../external/rdf", "v1.1.2", True],
2828
}
29+

build/fetch_dependencies.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@
66
## \brief Script to fetch all external git and/or downloadable dependencies
77
## needed to build the project.
88
##
9+
## fetch_dependencies.py (--internal)
10+
##
11+
## If --internal is specified, then any additional dependencies required for internal builds will also
12+
## be checked out.
13+
##
914
## Each git repo will be updated to the commit specified in the "gitMapping" table.
1015
##=============================================================================
1116

build/pre_build.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
import argparse
1717
import shutil
1818
import subprocess
19-
import distutils.spawn
2019
import platform
2120
import time
2221

@@ -63,9 +62,10 @@
6362
else:
6463
parser.add_argument("--qt-root", default="~/Qt", help="specify the root directory for locating QT on this system (default: ~/Qt) ")
6564
parser.add_argument("--qt-system", action="store_true", help="use the system-installed version of QT")
66-
parser.add_argument("--qt", default="5.15.2", help="specify the version of QT to be used with the script (default: 5.15.2)" )
65+
parser.add_argument("--qt", default="6.7.0", help="specify the version of QT to be used with the script (default: 6.7.0)" )
6766
parser.add_argument("--clean", action="store_true", help="delete any directories created by this script")
6867
parser.add_argument("--no-qt", action="store_true", help="build a headless version (not applicable for all products)")
68+
parser.add_argument("--build-number", default="0", help="specify the build number, primarily to be used by build machines to produce versioned builds")
6969
parser.add_argument("--update", action="store_true", help="Force fetch_dependencies script to update all dependencies")
7070
parser.add_argument("--output", default=output_root, help="specify the output location for generated cmake and build output files (default = OS specific subdirectory of location of PreBuild.py script)")
7171
parser.add_argument("--build", action="store_true", help="build all supported configurations on completion of prebuild step")
@@ -114,10 +114,10 @@ def mkdir_print(dir):
114114
# Look for Qt path in specified Qt root directory
115115
# Example:
116116
# --qt-root=C:\\Qt
117-
# --qt=5.15.2
118-
# Look first for C:\\Qt\\Qt5.15.2\\5.15.2
117+
# --qt=6.7.0
118+
# Look first for C:\\Qt\\Qt6.7.0\\6.7.0
119119
# (if not found..)
120-
# Look next for C:\\Qt\\5.15.2
120+
# Look next for C:\\Qt\\6.7.0
121121
#
122122
# If neither of those can be found AND we are using the default
123123
# qt-root dir (i.e. the user did not specify --qt-root), then also
@@ -262,6 +262,8 @@ def generate_config(config):
262262
if args.qt_system:
263263
cmake_args.extend(["-DQT_SYSTEM:BOOL=TRUE"])
264264

265+
cmake_args.extend(["-DRMV_BUILD_NUMBER=" + str(args.build_number)])
266+
265267
cmake_args.extend(["-DCMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE=" + release_output_dir])
266268
cmake_args.extend(["-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=" + release_output_dir])
267269
cmake_args.extend(["-DCMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG=" + debug_output_dir])
@@ -324,7 +326,7 @@ def generate_config(config):
324326
with open(vscode_json_file, 'w') as f:
325327
json.dump(json_data, f, indent=4)
326328

327-
if not distutils.spawn.find_executable(cmake_args[0]):
329+
if not shutil.which(cmake_args[0]):
328330
log_error_and_exit("cmake not found")
329331

330332
p = subprocess.Popen(cmake_args, cwd=cmake_dir, stderr=subprocess.STDOUT)

cmake/devtools_qt_helper.cmake

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
cmake_minimum_required(VERSION 3.10)
77

8-
98
# Attempt to automatically find Qt on the local machine
109
if (UNIX AND NOT APPLE)
1110
find_package(Qt6 QUIET COMPONENTS Core Widgets Network Gui Svg Test GuiPrivate CorePrivate)
@@ -32,6 +31,16 @@ if (NOT Qt6_DIR)
3231
endif ()
3332
endif ()
3433

34+
# linuxdeployqt
35+
if (UNIX AND NOT APPLE)
36+
37+
find_program(LINUXDEPLOYQT "linuxdeployqt" HINTS "${PROJECT_SOURCE_DIR}/external/linuxdeployqt")
38+
if (LINUXDEPLOYQT)
39+
message(STATUS "Found linuxdeployqt: ${LINUXDEPLOYQT}")
40+
else ()
41+
message(ERROR "linuxdeployqt not found but is required for build")
42+
endif ()
43+
endif ()
3544

3645
if (Qt5_DIR OR Qt6_DIR)
3746
#######################################################################################################################
@@ -57,7 +66,7 @@ if (Qt5_DIR OR Qt6_DIR)
5766
if (WIN32)
5867
if (Qt6_DIR)
5968
set(DEPLOYQT_POST_BUILD_COMMAND
60-
${DEPLOYQT_EXECUTABLE} $<TARGET_FILE:${target}> -verbose 0 --no-compiler-runtime --no-translations
69+
${DEPLOYQT_EXECUTABLE} $<TARGET_FILE:${target}> -verbose 0 --no-compiler-runtime --no-translations --no-system-d3d-compiler --no-system-dxc-compiler --no-opengl-sw --no-network
6170
WORKING_DIRECTORY ${output_directory})
6271
else ()
6372
set(DEPLOYQT_POST_BUILD_COMMAND
@@ -67,7 +76,7 @@ if (Qt5_DIR OR Qt6_DIR)
6776
elseif (UNIX AND NOT APPLE)
6877
set(DEPLOYQT_POST_BUILD_COMMAND
6978
${CMAKE_COMMAND} -E env LD_LIBRARY_PATH=${EXTERNAL_DIR}/libtraceevent/lib:${EXTERNAL_DIR}/libtracefs/lib:${_qt_bin_dir}/../lib
70-
${DEPLOYQT_EXECUTABLE} $<TARGET_FILE:${target}> -qmake=${QT_QMAKE_EXECUTABLE} -verbose=0 -unsupported-allow-new-glibc
79+
${DEPLOYQT_EXECUTABLE} $<TARGET_FILE:${target}> -qmake=${QT_QMAKE_EXECUTABLE} -verbose=0 -unsupported-allow-new-glibc -no-translations
7180
WORKING_DIRECTORY ${output_directory})
7281
elseif (include_mac)
7382

source/backend/rmt_data_set.cpp

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
#else
4444
#define WIN32_LEAN_AND_MEAN
4545
#include <windows.h>
46+
#include <corecrt_io.h>
4647
#endif // #ifdef _LINUX
4748

4849
// Determine if a file is read only.
@@ -58,6 +59,30 @@ static bool IsFileReadOnly(const char* file_path)
5859
#endif
5960
}
6061

62+
/// @brief Opens a file with the option of preventing other processes from inheriting the handle.
63+
///
64+
// @param [out] file_descriptor A pointer to the file descriptor to be opened.
65+
// @param [in] file_name A pointer to the file name to be opened.
66+
// @param [in] mode The mode to open the file in.
67+
// @param [in] prevent_inheritance A flag that, if true, prevents inheritance of the file handle.
68+
///
69+
/// @return An error code indicating the result of the operation (0 indicates success).
70+
///
71+
static errno_t OpenFile(FILE** file_descriptor, char const* file_name, char const* mode, bool prevent_inheritance)
72+
{
73+
errno_t error_no = fopen_s(file_descriptor, file_name, mode);
74+
#ifdef WIN32
75+
if ((error_no == 0) && (prevent_inheritance))
76+
{
77+
// Disable inheritance of the file handle.
78+
SetHandleInformation((HANDLE)_get_osfhandle(_fileno(*file_descriptor)), HANDLE_FLAG_INHERIT, 0);
79+
}
80+
#else
81+
RMT_UNUSED(prevent_inheritance);
82+
#endif
83+
return error_no;
84+
}
85+
6186
/// @brief Determine if the trace file is an RGD crash dump.
6287
///
6388
/// @param [in] path A pointer to the trace file path to be checked.
@@ -1118,7 +1143,7 @@ static RmtErrorCode CommitTemporaryFileEdits(RmtDataSet* data_set, bool remove_t
11181143
else
11191144
{
11201145
data_set->file_handle = NULL;
1121-
errno_t error_no = fopen_s((FILE**)&data_set->file_handle, data_set->temporary_file_path, "rb+");
1146+
errno_t error_no = OpenFile((FILE**)&data_set->file_handle, data_set->temporary_file_path, "rb+", true);
11221147

11231148
RMT_ASSERT(data_set->file_handle);
11241149
RMT_ASSERT(error_no == 0);
@@ -1187,7 +1212,7 @@ RmtErrorCode RmtDataSetInitialize(const char* path, RmtDataSet* data_set)
11871212
{
11881213
// Determine if the back up file or original file should be opened. If the backup file can't be opened with write privileges
11891214
// (because another RMV instance already has opened it), set the read only flag and attempt to open the original file in read only mode.
1190-
error_no = fopen_s((FILE**)&data_set->file_handle, trace_file, file_access_mode);
1215+
error_no = OpenFile((FILE**)&data_set->file_handle, trace_file, file_access_mode, true);
11911216
if ((data_set->file_handle == nullptr) || error_no != 0)
11921217
{
11931218
// Set the read only flag so that opening the original file will be attempted.
@@ -1200,7 +1225,7 @@ RmtErrorCode RmtDataSetInitialize(const char* path, RmtDataSet* data_set)
12001225
// File is read-only. Attempt to just read the original rmv trace file.
12011226
file_access_mode = "rb";
12021227
trace_file = data_set->file_path;
1203-
error_no = fopen_s((FILE**)&data_set->file_handle, trace_file, file_access_mode);
1228+
error_no = OpenFile((FILE**)&data_set->file_handle, trace_file, file_access_mode, true);
12041229
if ((data_set->file_handle == nullptr) || error_no != 0)
12051230
{
12061231
error_code = kRmtErrorFileNotOpen;
@@ -1227,7 +1252,7 @@ RmtErrorCode RmtDataSetInitialize(const char* path, RmtDataSet* data_set)
12271252
if (error_code != kRmtOk)
12281253
{
12291254
// Loading as an RDF file failed, attempt to open the trace file using the legacy format.
1230-
error_no = fopen_s((FILE**)&data_set->file_handle, trace_file, file_access_mode);
1255+
error_no = OpenFile((FILE**)&data_set->file_handle, trace_file, file_access_mode, true);
12311256
if ((data_set->file_handle != nullptr) && (error_no == 0))
12321257
{
12331258
error_code = kRmtOk;

source/backend/rmt_data_timeline.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ typedef struct RmtDataTimeline
8080
int32_t* series_memory_buffer; ///< The size of the series memory buffer. This is subdivided into the series and levels.
8181
uint64_t maximum_value_in_all_series; ///< The maxim value seen at any one time in all series.
8282
RmtDataTimelineType timeline_type; ///< The type of timeline.
83+
uint32_t filter_mask; ///< Bit mask used to filter one or more of the series.
8384
} RmtDataTimeline;
8485

8586
/// Destroy the timeline (and free underlaying memory allocated for this).

source/backend/rmt_rdf_file_parser.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ static RmtErrorCode LoadSegmentChunk(rdfChunkFile* chunk_file, RmtDataSet* data_
130130
{
131131
data_set->segment_info[count].base_address = data.physical_base_address;
132132
data_set->segment_info[count].heap_type = static_cast<RmtHeapType>(data.type);
133+
133134
data_set->segment_info[count].index = 0;
134135
data_set->segment_info[count].size = data.size;
135136
count++;

0 commit comments

Comments
 (0)