Skip to content

Commit

Permalink
Update source code for RMV v1.6 release
Browse files Browse the repository at this point in the history
  • Loading branch information
ahosier committed Apr 27, 2023
1 parent f5180e2 commit 2a91cef
Show file tree
Hide file tree
Showing 316 changed files with 4,439 additions and 1,232 deletions.
32 changes: 22 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
cmake_minimum_required(VERSION 3.11)

set(SYSTEM_INFO_BUILD_RDF_INTERFACES ON)

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

# Define version information
set(RMV_MAJOR_VERSION 1)
set(RMV_MINOR_VERSION 5)
set(RMV_MINOR_VERSION 6)
if (NOT RMV_BUGFIX_NUMBER)
set(RMV_BUGFIX_NUMBER 0)
endif ()
Expand All @@ -19,6 +21,9 @@ string(TIMESTAMP YEAR_STRING "\"%Y\"")
configure_file("${CMAKE_SOURCE_DIR}/Buildinfo.properties.in" "${CMAKE_SOURCE_DIR}/Buildinfo.properties")
configure_file("${CMAKE_SOURCE_DIR}/source/frontend/util/version.h.in" "${CMAKE_SOURCE_DIR}/source/frontend/util/version.h")

option(RDF_ENABLE_CXX_BINDINGS "Allow usage of C++ interface for RDF library" ON)
option(RDF_STATIC "Build RDF as a static library" ON)

## For RMV we only care about the Debug and Release configuration types
set(CMAKE_CONFIGURATION_TYPES Debug Release)

Expand All @@ -30,35 +35,36 @@ IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
ENDIF()

# As default for RMV, include the debug & internal status in filename - but not the platform bitness
set (CMAKE_DEBUG_POSTFIX -d${ADT_INTERNAL_POSTFIX})
set (CMAKE_RELEASE_POSTFIX ${ADT_INTERNAL_POSTFIX})
set (CMAKE_DEBUG_POSTFIX -d)
set (CMAKE_RELEASE_POSTFIX)

IF(WIN32)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/../release${ADT_INTERNAL_POSTFIX_LOWER})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/../debug${ADT_INTERNAL_POSTFIX_LOWER})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/../release)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/../debug)
ELSE(WIN32)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/../../release${ADT_INTERNAL_POSTFIX_LOWER})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/../../debug${ADT_INTERNAL_POSTFIX_LOWER})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/../../release)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/../../debug)
ENDIF(WIN32)

# Add for CentOS compiler warning
add_definitions(-DJSON_SKIP_UNSUPPORTED_COMPILER_CHECK)

include_directories("${PROJECT_SOURCE_DIR}/external/qt_common/")
include_directories("${PROJECT_SOURCE_DIR}/external/")
include_directories("${PROJECT_SOURCE_DIR}/external/third_party/")

# Global compiler options
IF(WIN32)
add_compile_options(/MP)
# bump the stack size
add_link_options(/STACK:16777216)
ELSEIF(UNIX)
# Use -Wno-missing-field-initializers for CentOS compiler warning
add_compile_options(-D_LINUX -Wall -Wextra -Wno-missing-field-initializers)
add_compile_options(-D_LINUX -mno-avx2)
# Allow executable to be double clicked.
add_link_options(-no-pie)
# Use _DEBUG on Unix for Debug Builds (defined automatically on Windows)
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_DEBUG")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
ENDIF(WIN32)

IF(WIN32)
Expand Down Expand Up @@ -87,8 +93,14 @@ MACRO(SOURCE_GROUP_BY_FOLDER target)
ENDIF (files)
ENDMACRO(SOURCE_GROUP_BY_FOLDER)

# Define C++ standard for RMV
set(CMAKE_CXX_STANDARD 17)

add_subdirectory(external/qt_common/custom_widgets QtCommon/custom_widgets)
add_subdirectory(external/qt_common/utils QtCommon/utils)
add_subdirectory(external/rdf/imported/zstd)
add_subdirectory(external/rdf/rdf)
add_subdirectory(external/system_info_utils)
add_subdirectory(source/parser parser)
add_subdirectory(source/backend backend)
add_subdirectory(source/frontend frontend)
Expand Down Expand Up @@ -185,5 +197,5 @@ add_custom_command(TARGET Documentation POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${RELEASE_DOCS_IN_ROOT} ${DOCS_OUTPUT_DIR}/.
COMMAND ${CMAKE_COMMAND} -E echo "copying Samples to output directory"
COMMAND ${CMAKE_COMMAND} -E make_directory ${DOCS_OUTPUT_DIR}/samples
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_SOURCE_DIR}/samples/sampleTrace.rmv ${DOCS_OUTPUT_DIR}/samples/sample_trace.rmv
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_SOURCE_DIR}/samples/sample_trace.rmv ${DOCS_OUTPUT_DIR}/samples/.
)
11 changes: 7 additions & 4 deletions build/dependency_map.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#! python3
# Copyright (c) 2022 Advanced Micro Devices, Inc. All rights reserved.
# Copyright (c) 2020-2023 Advanced Micro Devices, Inc. All rights reserved.

import sys

Expand All @@ -10,11 +10,14 @@

# To allow for future updates where we may have cloned the project somewhere other than gerrit, store the root of
# the repo in a variable. In future, we can automatically calculate this based on the git config
git_root = "https://github.com/GPUOpen-Tools/"
github_tools = "https://github.com/GPUOpen-Tools/"
github_root = "https://github.com/"

# Define a set of dependencies that exist as separate git projects.
# each git dependency has a desired directory where it will be cloned - along with a commit to checkout
git_mapping = {
git_root + "QtCommon" : ["../external/qt_common", "v3.8.0"],
git_root + "UpdateCheckAPI" : ["../external/update_check_api", "v2.0.1"],
github_tools + "QtCommon" : ["../external/qt_common", "v3.8.0"],
github_tools + "UpdateCheckApi" : ["../external/update_check_api", "v2.0.1"],
github_tools + "system_info_utils" : ["../external/system_info_utils", "88a338a01949f8d8bad60a30b78b65300fd13a9f"],
github_root + "GPUOpen-Drivers/libamdrdf" : ["../external/rdf", "v1.1.2"],
}
2 changes: 1 addition & 1 deletion build/fetch_dependencies.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#! python3
# Copyright (c) 2020 Advanced Micro Devices, Inc. All rights reserved.
# Copyright (c) 2020-2023 Advanced Micro Devices, Inc. All rights reserved.
#
# Script to fetch all external git and/or downloadable dependencies needed to build the project
#
Expand Down
6 changes: 3 additions & 3 deletions build/pre_build.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#! python3
# Copyright (c) 2020-2022 Advanced Micro Devices, Inc. All rights reserved.
# Copyright (c) 2020-2023 Advanced Micro Devices, Inc. All rights reserved.
#
# Script to perform all necessary pre build steps. This includes:
#
Expand Down Expand Up @@ -49,8 +49,8 @@
# parse the command line arguments
parser = argparse.ArgumentParser(description="A script that generates all the necessary build dependencies for a project")
if sys.platform == "win32":
parser.add_argument("--vs", default="2019", choices=["2017", "2019", "2022"], help="specify the version of Visual Studio to be used with this script (default: 2019)")
parser.add_argument("--toolchain", default="2019", choices=["2017", "2019", "2022"], help="specify the compiler toolchain to be used with this script (default: 2019)")
parser.add_argument("--vs", default="2022", choices=["2017", "2019", "2022"], help="specify the version of Visual Studio to be used with this script (default: 2022)")
parser.add_argument("--toolchain", default="2022", choices=["2017", "2019", "2022"], help="specify the compiler toolchain to be used with this script (default: 2022)")
parser.add_argument("--qt-root", default="C:\\Qt", help="specify the root directory for locating QT on this system (default: C:\\Qt\\)")
parser.add_argument("--qt-libver", default="2019", choices=["2017", "2019"], help="specify the Qt lib version to be used with this script (default: 2019)")
elif sys.platform == "darwin":
Expand Down
File renamed without changes.
25 changes: 20 additions & 5 deletions source/backend/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,20 @@ cmake_minimum_required(VERSION 3.10)
project(RmvBackend)

set(CMAKE_INCLUDE_CURRENT_DIR ON)
include_directories(AFTER ../backend ../parser)
include_directories(AFTER ../backend ../parser ../../external/rdf/rdf/inc)

IF(UNIX)
add_definitions(-DSYSTEM_INFO_ENABLE_RDF)
add_definitions(-DRDF_CXX_BINDINGS)
IF(WIN32)
# Warnings as errors for Windows
add_compile_options(/W4 /WX)
ELSEIF(UNIX)
# Remove warnings for Linux in backend
add_compile_options(-std=c++11 -D_LINUX -Wall -Wextra -Werror -Wno-missing-field-initializers -Wno-sign-compare -Wno-uninitialized)
ENDIF(UNIX)
add_compile_options(-D_LINUX -Wall -Wextra -Werror)
ENDIF(WIN32)

# List of all source files. It may be possible to have the build process call cmake to update the makefiles
# only when this file has changed (ie source files have been added or removed)

set( SOURCES
"rmt_adapter_info.cpp"
"rmt_adapter_info.h"
Expand All @@ -30,6 +34,8 @@ set( SOURCES
"rmt_job_system.h"
"rmt_linear_buffer.cpp"
"rmt_linear_buffer.h"
"rmt_legacy_snapshot_writer.cpp"
"rmt_legacy_snapshot_writer.h"
"rmt_mutex.cpp"
"rmt_mutex.h"
"rmt_page_table.cpp"
Expand All @@ -41,15 +47,24 @@ set( SOURCES
"rmt_process_map.cpp"
"rmt_process_map.h"
"rmt_process_start_info.h"
"rmt_rdf_file_parser.h"
"rmt_rdf_file_parser.cpp"
"rmt_rdf_snapshot_writer.cpp"
"rmt_rdf_snapshot_writer.h"
"rmt_rdf_system_info.h"
"rmt_resource_history.cpp"
"rmt_resource_history.h"
"rmt_resource_list.cpp"
"rmt_resource_list.h"
"rmt_segment_info.h"
"rmt_snapshot_writer.cpp"
"rmt_snapshot_writer.h"
"rmt_thread.cpp"
"rmt_thread.h"
"rmt_thread_event.cpp"
"rmt_thread_event.h"
"rmt_trace_loader.cpp"
"rmt_trace_loader.h"
"rmt_virtual_allocation_list.cpp"
"rmt_virtual_allocation_list.h"
"rmt_warnings.cpp"
Expand Down
10 changes: 4 additions & 6 deletions source/backend/rmt_adapter_info.cpp
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
//=============================================================================
// Copyright (c) 2020-2021 Advanced Micro Devices, Inc. All rights reserved.
// Copyright (c) 2020-2023 Advanced Micro Devices, Inc. All rights reserved.
/// @author AMD Developer Tools Team
/// @file
/// @brief The adapter information captured for the target process.
/// @brief Helper function for legacy adapter information captured for the target process.
//=============================================================================

#include "rmt_adapter_info.h"
#include "rmt_assert.h"

const char* RmtAdapterInfoGetVideoMemoryType(const RmtAdapterInfo* adapter_info)
const char* RmtAdapterInfoGetVideoMemoryType(const RmtAdapterInfoMemoryType memory_type)
{
RMT_ASSERT(adapter_info);

switch (adapter_info->memory_type)
switch (memory_type)
{
case kRmtAdapterInfoMemoryTypeUnknown:
return "Unknown";
Expand Down
49 changes: 16 additions & 33 deletions source/backend/rmt_adapter_info.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
//=============================================================================
// Copyright (c) 2020-2021 Advanced Micro Devices, Inc. All rights reserved.
// Copyright (c) 2020-2023 Advanced Micro Devices, Inc. All rights reserved.
/// @author AMD Developer Tools Team
/// @file
/// @brief The adapter information captured for the target process.
/// @brief Helper function for legacy adapter information captured for the target process.
//=============================================================================

#ifndef RMV_BACKEND_RMT_ADAPTER_INFO_H_
Expand All @@ -20,44 +20,27 @@ extern "C" {
/// @brief An enumeration of memory types that can be used with an adapter.
typedef enum RmtAdapterInfoMemoryType
{
kRmtAdapterInfoMemoryTypeUnknown = 0, ///< Memory is unknown.
kRmtAdapterInfoMemoryTypeDdr2 = 1, ///< System DDR2.
kRmtAdapterInfoMemoryTypeDdr3 = 2, ///< System DDR3.
kRmtAdapterInfoMemoryTypeDdr4 = 3, ///< System DDR4.
kRmtAdapterInfoMemoryTypeGddr5 = 4, ///< Graphics DDR 5.
kRmtAdapterInfoMemoryTypeGddr6 = 5, ///< Graphics DDR 6.
kRmtAdapterInfoMemoryTypeHbm = 6, ///< First version of High-Bandwidth Memory.
kRmtAdapterInfoMemoryTypeHbm2 = 7, ///< Second version of High-Bandwidth Memory.
kRmtAdapterInfoMemoryTypeHbm3 = 8, ///< Third version of High-Bandwidth Memory.
kRmtAdapterInfoMemoryTypeLpddr4 = 9, ///< Low power DDR4.
kRmtAdapterInfoMemoryTypeLpddr5 = 10, ///< Low power DDR5.
kRmtAdapterInfoMemoryTypeDdr5 = 11 ///< System DDR5.
kRmtAdapterInfoMemoryTypeUnknown = 0, ///< Memory is unknown.
kRmtAdapterInfoMemoryTypeDdr2 = 1, ///< System DDR2.
kRmtAdapterInfoMemoryTypeDdr3 = 2, ///< System DDR3.
kRmtAdapterInfoMemoryTypeDdr4 = 3, ///< System DDR4.
kRmtAdapterInfoMemoryTypeGddr5 = 4, ///< Graphics DDR 5.
kRmtAdapterInfoMemoryTypeGddr6 = 5, ///< Graphics DDR 6.
kRmtAdapterInfoMemoryTypeHbm = 6, ///< First version of High-Bandwidth Memory.
kRmtAdapterInfoMemoryTypeHbm2 = 7, ///< Second version of High-Bandwidth Memory.
kRmtAdapterInfoMemoryTypeHbm3 = 8, ///< Third version of High-Bandwidth Memory.
kRmtAdapterInfoMemoryTypeLpddr4 = 9, ///< Low power DDR4.
kRmtAdapterInfoMemoryTypeLpddr5 = 10, ///< Low power DDR5.
kRmtAdapterInfoMemoryTypeDdr5 = 11 ///< System DDR5.
} RmtAdapterInfoMemoryType;

/// @brief A structure encapsulating the information about the adapter.
typedef struct RmtAdapterInfo
{
char name[RMT_MAX_ADAPTER_NAME_LENGTH]; ///< The name of the adapter as a NULL terminated string.
uint32_t pcie_family_id; ///< The PCIe family ID of the adapater.
uint32_t pcie_revision_id; ///< The PCIe revision ID of the adapter.
uint32_t device_id; ///< The PCIe device ID of the adapter.
uint32_t minimum_engine_clock; ///< The minimum engine clock (in MHz).
uint32_t maximum_engine_clock; ///< The maximum engine clock (in MHz).
RmtAdapterInfoMemoryType memory_type; ///< The memory type.
uint32_t memory_operations_per_clock; ///< The number of memory operations that can be performed per clock.
uint32_t memory_bus_width; ///< The width of the memory bus (in bits).
uint32_t memory_bandwidth; ///< Bandwidth of the memory system (in MB/s).
uint32_t minimum_memory_clock; ///< The minimum memory clock (in MHz).
uint32_t maximum_memory_clock; ///< The maximum memory clock (in MHz).
} RmtAdapterInfo;

/// @brief Get the chip type (in string) of the video memory.
///
/// @param [in] adapter_info A pointer to a <c><i>RmtAdapterInfo</i></c> structure.
/// @param [in] memory_type The memory type enumerator.
///
/// @returns
/// Pointer to the memory chip type string.
const char* RmtAdapterInfoGetVideoMemoryType(const RmtAdapterInfo* adapter_info);
const char* RmtAdapterInfoGetVideoMemoryType(const RmtAdapterInfoMemoryType memory_type);

#ifdef __cplusplus
}
Expand Down
2 changes: 1 addition & 1 deletion source/backend/rmt_atomic.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//=============================================================================
// Copyright (c) 2019-2021 Advanced Micro Devices, Inc. All rights reserved.
// Copyright (c) 2019-2023 Advanced Micro Devices, Inc. All rights reserved.
/// @author AMD Developer Tools Team
/// @file
/// @brief Implementation of atomic helper functions.
Expand Down
2 changes: 1 addition & 1 deletion source/backend/rmt_atomic.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//=============================================================================
// Copyright (c) 2019-2021 Advanced Micro Devices, Inc. All rights reserved.
// Copyright (c) 2019-2023 Advanced Micro Devices, Inc. All rights reserved.
/// @author AMD Developer Tools Team
/// @file
/// @brief Definition of platform-abstracted atomic functions.
Expand Down
2 changes: 1 addition & 1 deletion source/backend/rmt_configuration.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//=============================================================================
// Copyright (c) 2019-2021 Advanced Micro Devices, Inc. All rights reserved.
// Copyright (c) 2019-2023 Advanced Micro Devices, Inc. All rights reserved.
/// @author AMD Developer Tools Team
/// @file
/// @brief Global configuration values for the RMT backend.
Expand Down
2 changes: 1 addition & 1 deletion source/backend/rmt_data_profile.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//=============================================================================
// Copyright (c) 2019-2021 Advanced Micro Devices, Inc. All rights reserved.
// Copyright (c) 2019-2023 Advanced Micro Devices, Inc. All rights reserved.
/// @author AMD Developer Tools Team
/// @file
/// @brief Structures for profiling the RMT data for future parsing.
Expand Down
Loading

0 comments on commit 2a91cef

Please sign in to comment.