[docs] Improve readability of ROCprofiler-SDK API library documentation (#359)

* Use custom .rst to make api doc more readable.

* Update index.rst

* Misc docs updates

- doxygen source code fixes
- updated doxygen files
- fixed conf.py (does not generate code in source tree)

* Update source/docs/api-reference/rocprofiler-sdk_api_reference.rst

Co-authored-by: Rawat, Swati <Swati.Rawat@amd.com>

* Update source/docs/api-reference/rocprofiler-sdk_api_reference.rst

Co-authored-by: Rawat, Swati <Swati.Rawat@amd.com>

* Update source/docs/api-reference/rocprofiler-sdk_api/modules.rst

Co-authored-by: Rawat, Swati <Swati.Rawat@amd.com>

* Update source/docs/api-reference/rocprofiler-sdk_api/global_data_structures_topics_files.rst

Co-authored-by: Rawat, Swati <Swati.Rawat@amd.com>

* Duplicate

* test warnings

* Update CMakeLists.txt

* Update rocprofiler-sdk.dox.in

* Update update-docs.sh

* fix docs build failures by -q -T flags.

* set warn_as_error to NO.

* test -W to suppress warnings.

* remove -q flag from make.

* reduce dot graph depth to 100

* Update custom docs target

- docs target is now no longer part of the dependency list for the all target
- installation of docs requires explicitly building the docs target (i.e. OPTIONAL install of _build/html/ folder)

* add quit and trace mode back.

* increase DOT_GRAPH_MAX_NODES to 500 back.

* Format.

---------

Co-authored-by: Venkateshwar Reddy Kandula <vkandula@amd.com>
Co-authored-by: Jonathan R. Madsen <jonathanrmadsen@gmail.com>
Co-authored-by: Bhardwaj, Gopesh <Gopesh.Bhardwaj@amd.com>
Co-authored-by: Rawat, Swati <Swati.Rawat@amd.com>
Co-authored-by: Madsen, Jonathan <Jonathan.Madsen@amd.com>

[ROCm/rocprofiler-sdk commit: 6ec9526475]
This commit is contained in:
Kandula, Venkateshwar reddy
2025-05-14 00:47:51 -05:00
committed by GitHub
szülő c47e5838f1
commit 89fbdeb196
43 fájl változott, egészen pontosan 491 új sor hozzáadva és 182 régi sor törölve
@@ -5,7 +5,7 @@ if(NOT ROCPROFILER_BUILD_DOCS)
return()
endif()
set(PACKAGE_NAME ${PROJECT_NAME}-sdk)
set(PACKAGE_NAME ${PROJECT_NAME})
include(FetchContent)
@@ -124,23 +124,23 @@ doxygen rocprofiler-sdk-roctx.dox
doxysphinx build \${WORK_DIR} \${WORK_DIR}/_build/html \${WORK_DIR}/_doxygen/rocprofiler-sdk/html
doxysphinx build \${WORK_DIR} \${WORK_DIR}/_build/html \${WORK_DIR}/_doxygen/roctx/html
make html SPHINXOPTS=\"-W --keep-going ${DOCS_BUILD_JOBS} -n\"
make html SPHINXOPTS=\"--keep-going -n -q -T ${DOCS_BUILD_JOBS}\"
rm -rf ${PROJECT_SOURCE_DIR}/build-docs
")
if(CHMOD_CMD)
docs_execute_process(${CHMOD_CMD} +x ${CMAKE_CURRENT_BINARY_DIR}/build-docs.sh)
add_custom_target(docs ALL ${CMAKE_COMMAND} -E env HOME=${DOCS_WD}
${CMAKE_CURRENT_BINARY_DIR}/build-docs.sh)
add_custom_target(docs ${CMAKE_COMMAND} -E env HOME=${DOCS_WD}
${CMAKE_CURRENT_BINARY_DIR}/build-docs.sh)
else()
add_custom_target(docs ALL ${CMAKE_COMMAND} -E env HOME=${DOCS_WD} ${SHELL_CMD}
${CMAKE_CURRENT_BINARY_DIR}/build-docs.sh)
add_custom_target(docs ${CMAKE_COMMAND} -E env HOME=${DOCS_WD} ${SHELL_CMD}
${CMAKE_CURRENT_BINARY_DIR}/build-docs.sh)
endif()
install(
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/_build/html/
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/html/${PACKAGE_NAME}
COMPONENT docs
USE_SOURCE_PERMISSIONS FILES_MATCHING
OPTIONAL USE_SOURCE_PERMISSIONS FILES_MATCHING
PATTERN "*")
@@ -31,8 +31,35 @@ subtrees:
title: Counter collection services
- file: api-reference/pc_sampling
title: PC sampling
- file: _doxygen/rocprofiler-sdk/html/index
title: ROCprofiler-SDK API library
- file: api-reference/rocprofiler-sdk_api_reference
subtrees:
- entries:
- file: api-reference/rocprofiler-sdk_api/modules
subtrees:
- entries:
- file: api-reference/rocprofiler-sdk_api/modules/agent_information
- file: api-reference/rocprofiler-sdk_api/modules/buffer_handling
- file: api-reference/rocprofiler-sdk_api/modules/buffer_tracing
- file: api-reference/rocprofiler-sdk_api/modules/callback_tracing
- file: api-reference/rocprofiler-sdk_api/modules/context_management
- file: api-reference/rocprofiler-sdk_api/modules/counter_config
- file: api-reference/rocprofiler-sdk_api/modules/counters
- file: api-reference/rocprofiler-sdk_api/modules/device_counting_service
- file: api-reference/rocprofiler-sdk_api/modules/dispatch_counting_service
- file: api-reference/rocprofiler-sdk_api/modules/external_correalation
- file: api-reference/rocprofiler-sdk_api/modules/intercept_table
- file: api-reference/rocprofiler-sdk_api/modules/internal_threading_management
- file: api-reference/rocprofiler-sdk_api/modules/ompt_registration
- file: api-reference/rocprofiler-sdk_api/modules/pc_sampling_service
- file: api-reference/rocprofiler-sdk_api/modules/thread_trace
- file: api-reference/rocprofiler-sdk_api/modules/tool_registration
- file: api-reference/rocprofiler-sdk_api/global_data_structures_topics_files
subtrees:
- entries:
- file: api-reference/rocprofiler-sdk_api/global_data_structures_topics_files/global_basic_data_types
- file: _doxygen/rocprofiler-sdk/html/topics
- file: _doxygen/rocprofiler-sdk/html/annotated
- file: _doxygen/rocprofiler-sdk/html/files
- file: _doxygen/roctx/html/index
title: ROCTx API library
- caption: Conceptual
@@ -0,0 +1,15 @@
.. meta::
:description: The Global Data structures, topics and files reference page.
.. _global_data_structures_topics_files_reference:
*******************************************************************************
Global Data structures, topics, files
*******************************************************************************
This ROCprofiler-SDK API topic covers:
* :ref:`global_basic_data_types_reference`
* :doc:`../../_doxygen/rocprofiler-sdk/html/topics`
* :doc:`../../_doxygen/rocprofiler-sdk/html/annotated`
* :doc:`../../_doxygen/rocprofiler-sdk/html/files`
@@ -0,0 +1,11 @@
.. meta::
:description: The global basic data types reference page.
.. _global_basic_data_types_reference:
*******************************************************************************
Global Basic Data Types
*******************************************************************************
.. doxygengroup:: BASIC_DATA_TYPES
:content-only:
@@ -0,0 +1,28 @@
.. meta::
:description: The ROCprofiler-SDK API modules reference page.
:keywords: AMD, ROCm, modules
.. _modules_reference:
*******************************************************************************
Modules
*******************************************************************************
The ROCprofiler-SDK API is organized into the following modules based on functionality:
* :ref:`agent_information_reference`
* :ref:`buffer_handling_reference`
* :ref:`buffer_tracing_reference`
* :ref:`callback_tracing_reference`
* :ref:`context_management_reference`
* :ref:`counters_reference`
* :ref:`counter_config_reference`
* :ref:`device_counting_service_reference`
* :ref:`dispatch_counting_service_reference`
* :ref:`external_correlation_reference`
* :ref:`intercept_table_reference`
* :ref:`internal_threading_management_reference`
* :ref:`ompt_registration_reference`
* :ref:`pc_sampling_service_reference`
* :ref:`thread_trace_reference`
* :ref:`tool_registration_reference`
@@ -0,0 +1,11 @@
.. meta::
:description: The Agent Information reference page.
.. _agent_information_reference:
*******************************************************************************
Agent Information
*******************************************************************************
.. doxygengroup:: AGENTS
:content-only:
@@ -0,0 +1,11 @@
.. meta::
:description: The buffer handling reference page.
.. _buffer_handling_reference:
*******************************************************************************
Buffer handling
*******************************************************************************
.. doxygengroup:: BUFFER_HANDLING
:content-only:
@@ -0,0 +1,11 @@
.. meta::
:description: The buffer tracing reference page.
.. _buffer_tracing_reference:
*******************************************************************************
Buffer tracing
*******************************************************************************
.. doxygengroup:: BUFFER_TRACING_SERVICE
:content-only:
@@ -0,0 +1,11 @@
.. meta::
:description: The callback tracing reference page.
.. _callback_tracing_reference:
*******************************************************************************
Callback tracing
*******************************************************************************
.. doxygengroup:: CALLBACK_TRACING_SERVICE
:content-only:
@@ -0,0 +1,11 @@
.. meta::
:description: The context management reference page.
.. _context_management_reference:
*******************************************************************************
Context management
*******************************************************************************
.. doxygengroup:: CONTEXT_OPERATIONS
:content-only:
@@ -0,0 +1,11 @@
.. meta::
:description: The counter config reference page.
.. _counter_config_reference:
*******************************************************************************
Counter config
*******************************************************************************
.. doxygengroup:: COUNTER_CONFIG
:content-only:
@@ -0,0 +1,11 @@
.. meta::
:description: The counters reference page.
.. _counters_reference:
*******************************************************************************
Counters
*******************************************************************************
.. doxygengroup:: COUNTERS
:content-only:
@@ -0,0 +1,11 @@
.. meta::
:description: The device counting service reference page.
.. _device_counting_service_reference:
*******************************************************************************
Device counting service
*******************************************************************************
.. doxygengroup:: device_counting_service
:content-only:
@@ -0,0 +1,11 @@
.. meta::
:description: The dispatch counting service reference page.
.. _dispatch_counting_service_reference:
*******************************************************************************
Dispatch counting service
*******************************************************************************
.. doxygengroup:: dispatch_counting_service
:content-only:
@@ -0,0 +1,11 @@
.. meta::
:description: The external correlation reference page.
.. _external_correlation_reference:
*******************************************************************************
External correlation
*******************************************************************************
.. doxygengroup:: EXTERNAL_CORRELATION
:content-only:
@@ -0,0 +1,11 @@
.. meta::
:description: The Intercept table reference page.
.. _intercept_table_reference:
*******************************************************************************
Intercept table
*******************************************************************************
.. doxygengroup:: INTERCEPT_TABLE
:content-only:
@@ -0,0 +1,11 @@
.. meta::
:description: The intenal threading management reference page.
.. _internal_threading_management_reference:
*******************************************************************************
Internal threading management
*******************************************************************************
.. doxygengroup:: INTERNAL_THREADING
:content-only:
@@ -0,0 +1,11 @@
.. meta::
:description: The OMPT Registration reference page.
.. _ompt_registration_reference:
*******************************************************************************
OMPT Registration
*******************************************************************************
.. doxygengroup:: OMPT_REGISTRATION
:content-only:
@@ -0,0 +1,11 @@
.. meta::
:description: The PC Sampling service reference page.
.. _pc_sampling_service_reference:
*******************************************************************************
PC Sampling service
*******************************************************************************
.. doxygengroup:: PC_SAMPLING_SERVICE
:content-only:
@@ -0,0 +1,11 @@
.. meta::
:description: The thread trace reference page.
.. _thread_trace_reference:
*******************************************************************************
Thread trace
*******************************************************************************
.. doxygengroup:: THREAD_TRACE
:content-only:
@@ -0,0 +1,11 @@
.. meta::
:description: The tool registration reference page.
.. _tool_registration_reference:
*******************************************************************************
Tool registration
*******************************************************************************
.. doxygengroup:: REGISTRATION_GROUP
:content-only:
@@ -0,0 +1,14 @@
.. meta::
:description: ROCprofiler-SDK API reference page
:keywords: AMD, ROCm, HSA
.. _rocprofiler_sdk_api_reference:
********************************************************************************
ROCprofiler-SDK API library
********************************************************************************
This ROCprofiler-SDK API topic covers:
* :ref:`modules_reference`
* :ref:`global_data_structures_topics_files_reference`
@@ -41,17 +41,6 @@ def build_doxyfile():
)
def configure_version_header():
sp.run(
[
"cmake",
f"-S {_srcdir}/source/include/rocprofiler-sdk",
f"-B {_srcdir}/source/include/rocprofiler-sdk",
]
)
configure_version_header()
build_doxyfile()
# -- Project information -----------------------------------------------------
@@ -78,7 +67,7 @@ doxygen_root = "."
doxysphinx_enabled = True
doxygen_project = {
"name": "rocprofiler-sdk",
"path": "_doxygen",
"path": "_doxygen/rocprofiler-sdk/xml",
}
doxyfile = "rocprofiler-sdk.dox"
@@ -43,7 +43,7 @@ The documentation is structured as follows:
* :doc:`Callback services <api-reference/callback_services>`
* :doc:`Counter collection services <api-reference/counter_collection_services>`
* :doc:`PC sampling <api-reference/pc_sampling>`
* :doc:`ROCprofiler-SDK API library <_doxygen/rocprofiler-sdk/html/index>`
* :doc:`ROCprofiler-SDK API <api-reference/rocprofiler-sdk_api_reference>`
* :doc:`ROCTx API library <_doxygen/roctx/html/index>`
.. grid-item-card:: Conceptual
@@ -65,7 +65,7 @@ TIMESTAMP = NO
#---------------------------------------------------------------------------
# Build related configuration options
#---------------------------------------------------------------------------
EXTRACT_ALL = YES
EXTRACT_ALL = NO
EXTRACT_PRIVATE = NO
EXTRACT_PRIV_VIRTUAL = NO
EXTRACT_PACKAGE = NO
@@ -73,9 +73,9 @@ EXTRACT_STATIC = NO
EXTRACT_LOCAL_CLASSES = YES
EXTRACT_LOCAL_METHODS = NO
EXTRACT_ANON_NSPACES = NO
RESOLVE_UNNAMED_PARAMS = YES
RESOLVE_UNNAMED_PARAMS = NO
HIDE_UNDOC_MEMBERS = NO
HIDE_UNDOC_CLASSES = YES
HIDE_UNDOC_CLASSES = NO
HIDE_FRIEND_COMPOUNDS = NO
HIDE_IN_BODY_DOCS = NO
INTERNAL_DOCS = NO
@@ -84,8 +84,8 @@ HIDE_SCOPE_NAMES = NO
HIDE_COMPOUND_REFERENCE= NO
SHOW_HEADERFILE = YES
SHOW_INCLUDE_FILES = YES
SHOW_GROUPED_MEMB_INC = NO
FORCE_LOCAL_INCLUDES = YES
SHOW_GROUPED_MEMB_INC = YES
FORCE_LOCAL_INCLUDES = NO
INLINE_INFO = YES
SORT_MEMBER_DOCS = YES
SORT_BRIEF_DOCS = NO
@@ -110,12 +110,12 @@ CITE_BIB_FILES =
#---------------------------------------------------------------------------
QUIET = YES
WARNINGS = YES
WARN_IF_UNDOCUMENTED = YES
WARN_IF_UNDOCUMENTED = NO
WARN_IF_DOC_ERROR = YES
WARN_IF_INCOMPLETE_DOC = YES
WARN_NO_PARAMDOC = YES
WARN_IF_UNDOC_ENUM_VAL = NO
WARN_AS_ERROR = NO
WARN_AS_ERROR = YES
WARN_FORMAT = "---> WARNING! $file:$line: $text"
WARN_LINE_FORMAT = "at line $line of file $file"
WARN_LOGFILE =
@@ -148,21 +148,22 @@ EXCLUDE_PATTERNS = */.git/* \
@SOURCE_DIR@/**/cmake/* \
@SOURCE_DIR@/**/external/* \
@SOURCE_DIR@/**/RPM/* \
@SOURCE_DIR@/**/ISSUE_TEMPLATE/*
@SOURCE_DIR@/**/ISSUE_TEMPLATE/* \
@SOURCE_DIR@/**/rocprofiler-sdk/**/* \
@SOURCE_DIR@/**/rocprofiler-sdk-roctx/api_trace.h
EXCLUDE_SYMBOLS = "std::*" \
"ROCPROFILER_ATTRIBUTE" \
"ROCPROFILER_API" \
"ROCPROFILER_NONNULL" \
"ROCPROFILER_PUBLIC_API" \
"ROCPROFILER_HIDDEN_API" \
"ROCPROFILER_EXPORT_DECORATOR" \
"ROCPROFILER_IMPORT_DECORATOR" \
"ROCPROFILER_EXPORT" \
"ROCPROFILER_IMPORT" \
"ROCPROFILER_HANDLE_LITERAL" \
"ROCPROFILER_EXTERN_C_INIT" \
"ROCPROFILER_EXTERN_C_FINI"
"ROCTX_ATTRIBUTE" \
"ROCTX_API" \
"ROCTX_NONNULL" \
"ROCTX_PUBLIC_API" \
"ROCTX_HIDDEN_API" \
"ROCTX_EXPORT_DECORATOR" \
"ROCTX_IMPORT_DECORATOR" \
"ROCTX_EXPORT" \
"ROCTX_IMPORT" \
"ROCTX_HANDLE_LITERAL" \
"ROCTX_EXTERN_C_INIT" \
"ROCTX_EXTERN_C_FINI"
EXAMPLE_PATH = @SOURCE_DIR@/samples
EXAMPLE_PATTERNS = *.h \
*.hh \
@@ -177,7 +178,7 @@ INPUT_FILTER =
FILTER_PATTERNS =
FILTER_SOURCE_FILES = NO
FILTER_SOURCE_PATTERNS =
USE_MDFILE_AS_MAINPAGE =
USE_MDFILE_AS_MAINPAGE =
FORTRAN_COMMENT_AFTER = 72
#---------------------------------------------------------------------------
# Configuration options related to source browsing
@@ -202,10 +203,10 @@ IGNORE_PREFIX =
GENERATE_HTML = YES
HTML_OUTPUT = html
HTML_FILE_EXTENSION = .html
HTML_HEADER =
HTML_FOOTER =
HTML_STYLESHEET =
HTML_EXTRA_STYLESHEET =
HTML_HEADER =
HTML_FOOTER =
HTML_STYLESHEET =
HTML_EXTRA_STYLESHEET =
HTML_EXTRA_FILES =
HTML_COLORSTYLE = LIGHT
HTML_COLORSTYLE_HUE = 220
@@ -339,17 +340,17 @@ SEARCH_INCLUDES = NO
INCLUDE_PATH = @SOURCE_DIR@/source/include
INCLUDE_FILE_PATTERNS = *.h \
*.hpp
PREDEFINED = "ROCPROFILER_API=" \
"ROCPROFILER_EXPORT=" \
"ROCPROFILER_IMPORT=" \
"ROCPROFILER_NONNULL(...)=" \
"ROCPROFILER_PUBLIC_API=" \
"ROCPROFILER_HIDDEN_API=" \
"ROCPROFILER_EXPORT_DECORATOR=" \
"ROCPROFILER_IMPORT_DECORATOR=" \
"ROCPROFILER_HANDLE_LITERAL=" \
"ROCPROFILER_EXTERN_C_INIT=" \
"ROCPROFILER_EXTERN_C_FINI=" \
PREDEFINED = "ROCTX_API=" \
"ROCTX_EXPORT=" \
"ROCTX_IMPORT=" \
"ROCTX_NONNULL(...)=" \
"ROCTX_PUBLIC_API=" \
"ROCTX_HIDDEN_API=" \
"ROCTX_EXPORT_DECORATOR=" \
"ROCTX_IMPORT_DECORATOR=" \
"ROCTX_HANDLE_LITERAL=" \
"ROCTX_EXTERN_C_INIT=" \
"ROCTX_EXTERN_C_FINI=" \
"__attribute__(x)=" \
"__declspec(x)=" \
"size_t=unsigned long" \
@@ -65,7 +65,7 @@ TIMESTAMP = NO
#---------------------------------------------------------------------------
# Build related configuration options
#---------------------------------------------------------------------------
EXTRACT_ALL = YES
EXTRACT_ALL = NO
EXTRACT_PRIVATE = NO
EXTRACT_PRIV_VIRTUAL = NO
EXTRACT_PACKAGE = NO
@@ -73,7 +73,7 @@ EXTRACT_STATIC = NO
EXTRACT_LOCAL_CLASSES = YES
EXTRACT_LOCAL_METHODS = NO
EXTRACT_ANON_NSPACES = NO
RESOLVE_UNNAMED_PARAMS = YES
RESOLVE_UNNAMED_PARAMS = NO
HIDE_UNDOC_MEMBERS = NO
HIDE_UNDOC_CLASSES = YES
HIDE_FRIEND_COMPOUNDS = NO
@@ -84,8 +84,8 @@ HIDE_SCOPE_NAMES = NO
HIDE_COMPOUND_REFERENCE= NO
SHOW_HEADERFILE = YES
SHOW_INCLUDE_FILES = YES
SHOW_GROUPED_MEMB_INC = NO
FORCE_LOCAL_INCLUDES = YES
SHOW_GROUPED_MEMB_INC = YES
FORCE_LOCAL_INCLUDES = NO
INLINE_INFO = YES
SORT_MEMBER_DOCS = YES
SORT_BRIEF_DOCS = NO
@@ -110,7 +110,7 @@ CITE_BIB_FILES =
#---------------------------------------------------------------------------
QUIET = YES
WARNINGS = YES
WARN_IF_UNDOCUMENTED = YES
WARN_IF_UNDOCUMENTED = NO
WARN_IF_DOC_ERROR = YES
WARN_IF_INCOMPLETE_DOC = YES
WARN_NO_PARAMDOC = YES
@@ -140,8 +140,7 @@ FILE_PATTERNS = *.h \
*.tcc \
conf.py
RECURSIVE = YES
EXCLUDE = @SOURCE_DIR@/README.md \
@SOURCE_DIR@/include/rocprofiler-sdk/rccl/details/rccl.h
EXCLUDE = @SOURCE_DIR@/README.md
EXCLUDE_SYMLINKS = YES
EXCLUDE_PATTERNS = */.git/* \
@SOURCE_DIR@/**/tests/* \
@@ -150,7 +149,11 @@ EXCLUDE_PATTERNS = */.git/* \
@SOURCE_DIR@/**/cmake/* \
@SOURCE_DIR@/**/external/* \
@SOURCE_DIR@/**/RPM/* \
@SOURCE_DIR@/**/ISSUE_TEMPLATE/*
@SOURCE_DIR@/**/ISSUE_TEMPLATE/* \
@SOURCE_DIR@/**/rocprofiler-sdk/ompt/omp-tools.h \
@SOURCE_DIR@/**/rocprofiler-sdk/rccl/details/* \
@SOURCE_DIR@/**/rocprofiler-sdk/rocdecode/details/* \
@SOURCE_DIR@/**/rocprofiler-sdk/rocjpeg/details/*
EXCLUDE_SYMBOLS = "std::*" \
"ROCPROFILER_ATTRIBUTE" \
"ROCPROFILER_API" \
@@ -163,7 +166,10 @@ EXCLUDE_SYMBOLS = "std::*" \
"ROCPROFILER_IMPORT" \
"ROCPROFILER_HANDLE_LITERAL" \
"ROCPROFILER_EXTERN_C_INIT" \
"ROCPROFILER_EXTERN_C_FINI"
"ROCPROFILER_EXTERN_C_FINI" \
"ROCPROFILER_SDK_DEPRECATED_WARNINGS" \
"ROCPROFILER_SDK_EXPERIMENTAL_WARNINGS" \
"ROCPROFILER_*_LAST"
EXAMPLE_PATH = @SOURCE_DIR@/samples
EXAMPLE_PATTERNS = *.h \
*.hh \
@@ -351,6 +357,8 @@ PREDEFINED = "ROCPROFILER_API=" \
"ROCPROFILER_HANDLE_LITERAL=" \
"ROCPROFILER_EXTERN_C_INIT=" \
"ROCPROFILER_EXTERN_C_FINI=" \
"ROCPROFILER_SDK_DEPRECATED(...)=" \
"ROCPROFILER_SDK_EXPERIMENTAL=" \
"__attribute__(x)=" \
"__declspec(x)=" \
"size_t=unsigned long" \
@@ -400,7 +408,7 @@ DIAFILE_DIRS =
PLANTUML_JAR_PATH =
PLANTUML_CFG_FILE =
PLANTUML_INCLUDE_PATH =
DOT_GRAPH_MAX_NODES = 100
DOT_GRAPH_MAX_NODES = 500
MAX_DOT_GRAPH_DEPTH = 0
DOT_MULTI_TARGETS = YES
GENERATE_LEGEND = YES
@@ -23,12 +23,12 @@
#pragma once
/**
* \file roctx.h
* \brief ROCTx API interface for AMD code annotation and profiling
* @file roctx.h
* @brief ROCTx API interface for AMD code annotation and profiling
*
* \mainpage ROCTx API Specification
* @mainpage ROCTx API Specification
*
* \section introduction Introduction
* @section introduction Introduction
* ROCTx is a comprehensive library that implements the AMD code annotation API. It provides
* essential functionality for:
* - Event annotation and marking
@@ -64,8 +64,8 @@
* - Thread-local storage for efficient range stacking
* - Lightweight profiler control mechanisms
*
* \note All string parameters must be null-terminated
* \warning Proper nesting of range push/pop operations is user's responsibility
* @note All string parameters must be null-terminated
* @warning Proper nesting of range push/pop operations is user's responsibility
*/
#include <stddef.h>
@@ -77,7 +77,7 @@
ROCTX_EXTERN_C_INIT
/** \defgroup marker_group ROCTx Markers
/** @defgroup marker_group ROCTx Markers
*
* Marker annotations are used to describe events in a ROCm application.
*
@@ -87,14 +87,14 @@ ROCTX_EXTERN_C_INIT
/**
* Mark an event.
*
* \param[in] message The message associated with the event.
* @param[in] message The message associated with the event.
*/
void
roctxMarkA(const char* message) ROCTX_API ROCTX_NONNULL(1);
/** @} */
/** \defgroup range_group ROCTx Ranges
/** @defgroup range_group ROCTx Ranges
*
* Range annotations are used to describe events in a ROCm application.
*
@@ -106,9 +106,9 @@ roctxMarkA(const char* message) ROCTX_API ROCTX_NONNULL(1);
*
* Nested ranges are stacked and local to the current CPU thread.
*
* \param[in] message The message associated with this range.
* @param[in] message The message associated with this range.
*
* \return Returns the level this nested range is started at. Nested range
* @return Returns the level this nested range is started at. Nested range
* levels are 0 based.
*/
int
@@ -121,7 +121,7 @@ roctxRangePushA(const char* message) ROCTX_API ROCTX_NONNULL(1);
* was active before the last one was started, it becomes again the current
* nested range.
*
* \return Returns the level the stopped nested range was started at, or a
* @return Returns the level the stopped nested range was started at, or a
* negative value if there was no nested range active.
*/
int
@@ -142,13 +142,15 @@ roctxRangeStartA(const char* message) ROCTX_API ROCTX_NONNULL(1);
/**
* Stop a process range.
*
* @param [in] id ::roctx_range_id_t returned from ::roctxRangeStartA to stop
*/
void
roctxRangeStop(roctx_range_id_t id) ROCTX_API;
/** @} */
/** \defgroup PROFILER_COMM ROCTx Application control/customization of profiling tools
/** @defgroup PROFILER_COMM ROCTx Application control/customization of profiling tools
*
* Applications can invoke these functions to control/customize profiling tool behavior.
*
@@ -204,7 +206,7 @@ roctxProfilerResume(roctx_thread_id_t tid) ROCTX_API;
* failure while executing the request or lack of support
*/
int
roctxNameOsThread(const char*) ROCTX_API ROCTX_NONNULL(1);
roctxNameOsThread(const char* name) ROCTX_API ROCTX_NONNULL(1);
/**
* @brief Indicate to a profiling tool that, where possible, you would like the given HSA agent
@@ -214,13 +216,13 @@ roctxNameOsThread(const char*) ROCTX_API ROCTX_NONNULL(1);
* support for this capability is tool specific.
*
* @param [in] name Name for the specified agent
* @param [in] stream Pointer to a HSA agent identifier
* @param [in] agent Pointer to a HSA agent identifier
*
* @return int A profiling tool may choose to set this value to a non-zero value to indicate a
* failure while executing the request or lack of support
*/
int
roctxNameHsaAgent(const char* name, const struct hsa_agent_s*) ROCTX_API ROCTX_NONNULL(1, 2);
roctxNameHsaAgent(const char* name, const struct hsa_agent_s* agent) ROCTX_API ROCTX_NONNULL(1, 2);
/**
* @brief Indicate to a profiling tool that, where possible, you would like the given HIP device id
@@ -256,7 +258,7 @@ roctxNameHipStream(const char* name, const struct ihipStream_t* stream) ROCTX_AP
/** @} */
/** \defgroup UTILITIES ROCTx Utility functions
/** @defgroup UTILITIES ROCTx Utility functions
*
* @{
*/
@@ -278,13 +280,16 @@ roctxGetThreadId(roctx_thread_id_t* tid) ROCTX_API ROCTX_NONNULL(1);
ROCTX_EXTERN_C_FINI
#if !defined(roctxRangeStart)
/** @brief For future compatibility */
# define roctxRangeStart(message) roctxRangeStartA(message)
#endif
#if !defined(roctxMark)
/** @brief For future compatibility */
# define roctxMark(message) roctxMarkA(message)
#endif
#if !defined(roctxRangePush)
/** @brief For future compatibility */
# define roctxRangePush(message) roctxRangePushA(message)
#endif
@@ -26,7 +26,7 @@
#include <stdint.h>
/** \defgroup DATA_TYPE ROCTx Data types
/** @defgroup DATA_TYPE ROCTx Data types
*
* Data types defined or aliased by ROCTx
*
@@ -72,8 +72,8 @@ typedef struct rocprofiler_agent_io_link_t
HSA_IOLINKTYPE type; ///< Discoverable IoLink Properties (optional)
uint32_t version_major; ///< Bus interface version (optional)
uint32_t version_minor; ///< Bus interface version (optional)
uint32_t node_from; ///< See @ref rocprofiler_agent_id_t
uint32_t node_to; ///< See @ref rocprofiler_agent_id_t
uint32_t node_from; ///< See ::rocprofiler_agent_id_t
uint32_t node_to; ///< See ::rocprofiler_agent_id_t
uint32_t weight; ///< weight factor (derived from CDIT)
uint32_t min_latency; ///< minimum cost of time to transfer (rounded to ns)
uint32_t max_latency; ///< maximum cost of time to transfer (rounded to ns)
@@ -183,27 +183,25 @@ typedef struct rocprofiler_agent_v0_t
uint32_t max_engine_clk_fcompute; ///< GPU only. Maximum engine clocks for GPU, including any
///< boost capabilities
HSA_ENGINE_VERSION sdma_fw_version; ///< GPU only
HSA_ENGINE_ID
fw_version; ///< GPU only. Identifier (rev) of the GPU uEngine or Firmware, may be 0
HSA_CAPABILITY capability; ///< GPU only
uint32_t cu_per_engine; ///< computed
uint32_t max_waves_per_cu; ///< computed
uint32_t family_id; ///< Family code
HSA_ENGINE_ID fw_version;
HSA_CAPABILITY capability; ///< GPU only
uint32_t cu_per_engine; ///< computed
uint32_t max_waves_per_cu; ///< computed
uint32_t family_id; ///< Family code
uint32_t workgroup_max_size; ///< GPU only. Maximum total number of work-items in a work-group.
uint32_t grid_max_size; ///< GPU only. Maximum number of fbarriers per work-group. Must be at
///< least 32.
uint64_t local_mem_size; ///< GPU only. Local memory size
uint64_t hive_id; ///< XGMI Hive the GPU node belongs to in the system. It is an opaque and
///< static number hash created by the PSP
uint32_t grid_max_size; ///< GPU only. Maximum number of fbarriers per work-group. Must be at
///< least 32.
uint64_t local_mem_size; ///< GPU only. Local memory size
uint64_t hive_id;
uint64_t gpu_id; ///< GPU only. KFD identifier
rocprofiler_dim3_t workgroup_max_dim; ///< GPU only. Maximum number of work-items of each
///< dimension of a work-group.
rocprofiler_dim3_t grid_max_dim; ///< GPU only. Maximum number of work-items of each dimension
///< of a grid.
const rocprofiler_agent_mem_bank_t* mem_banks;
const rocprofiler_agent_cache_t* caches;
const rocprofiler_agent_io_link_t* io_links;
const char* name;
const rocprofiler_agent_mem_bank_t* mem_banks; ///< array of memory bank info
const rocprofiler_agent_cache_t* caches; ///< array of cache info
const rocprofiler_agent_io_link_t* io_links; ///< array of IO link info
const char* name; ///< name of the agent
const char* vendor_name; ///< Vendor of agent (will be AMD)
const char* product_name; ///< Marketing name
const char* model_name;
@@ -213,6 +211,13 @@ typedef struct rocprofiler_agent_v0_t
rocprofiler_agent_runtime_visiblity_t runtime_visibility;
rocprofiler_uuid_t uuid; ///< GPU only. Universally unique identifier.
/// @var fw_version
/// @brief GPU only. Identifier (rev) of the GPU uEngine or Firmware, may be 0
///
/// @var hive_id
/// @brief XGMI Hive the GPU node belongs to in the system. It is an opaque and
/// static number hash created by the PSP
///
/// @var name
/// @brief Name of the agent. Will be identical to product name for CPU
///
@@ -234,7 +239,8 @@ typedef struct rocprofiler_agent_v0_t
/// at runtime (i.e. HIP_VISIBLE_DEVICES and ROCR_VISIBLE_DEVICES) which start at zero and only
/// apply to GPUs, e.g., logical_node_type_id value for first GPU will be 0, second GPU will
/// have value of 1, etc., regardless of however many agents of a different type preceeded (and
/// thus increased the ::node_id or ::logical_node_id).
/// thus increased the ::rocprofiler_agent_v0_t.node_id or
/// ::rocprofiler_agent_v0_t.logical_node_id).
///
/// Example: a system with 2 CPUs and 2 GPUs, where the node ids are 0=CPU, 1=GPU, 2=CPU, 3=GPU,
/// then then CPU node_ids 0 and 2 would have logical_node_type_id values of 0 and 1,
@@ -242,13 +248,17 @@ typedef struct rocprofiler_agent_v0_t
/// and 1.
///
/// @var runtime_visibility
/// @brief See @rocprofiler_runtime_library_t. This is an estimate about whether this agent will
/// be visible for the runtimes, e.g. if (agent.runtime_visibility & ROCPROFILER_HIP_LIBRARY) !=
/// 0 then we believe this agent will be visible to the HIP library. However, this is an
/// estimate and we cannot be certain until the HIP runtime is initialized. This will always be
/// true for CPU agents.
/// @brief See ::rocprofiler_runtime_library_t. This is an estimate about whether this agent
/// will be visible for the runtimes, e.g. if (`::rocprofiler_agent_t.runtime_visibility &
/// ::ROCPROFILER_HIP_LIBRARY) != 0` then we believe this agent will be visible to the HIP
/// library. However, this is an estimate and we cannot be certain until the HIP runtime is
/// initialized. This will always be true for CPU agents.
} rocprofiler_agent_v0_t;
/**
* @brief Typedef for the current ::rocprofiler_agent_version_t
*
*/
typedef rocprofiler_agent_v0_t rocprofiler_agent_t;
/**
@@ -422,7 +422,7 @@ typedef struct rocprofiler_buffer_tracing_runtime_initialization_record_t
} rocprofiler_buffer_tracing_runtime_initialization_record_t;
/**
* @brief Callback function for mapping @ref rocprofiler_buffer_tracing_kind_t ids to
* @brief Callback function for mapping ::rocprofiler_buffer_tracing_kind_t ids to
* string names. @see rocprofiler_iterate_buffer_trace_kind_names.
*/
typedef int (*rocprofiler_buffer_tracing_kind_cb_t)(rocprofiler_buffer_tracing_kind_t kind,
@@ -522,6 +522,7 @@ rocprofiler_query_buffer_tracing_kind_operation_name(rocprofiler_buffer_tracing_
* @param [in] callback Callback function invoked for each enumeration value in @ref
* rocprofiler_buffer_tracing_kind_t with the exception of the `NONE` and `LAST` values.
* @param [in] data User data passed back into the callback
* @return ::rocprofiler_status_t
*/
rocprofiler_status_t
rocprofiler_iterate_buffer_tracing_kinds(rocprofiler_buffer_tracing_kind_cb_t callback,
@@ -537,6 +538,7 @@ rocprofiler_iterate_buffer_tracing_kinds(rocprofiler_buffer_tracing_kind_cb_t ca
* @param [in] callback Callback function invoked for each operation associated with @ref
* rocprofiler_buffer_tracing_kind_t with the exception of the `NONE` and `LAST` values.
* @param [in] data User data passed back into the callback
* @return ::rocprofiler_status_t
*/
rocprofiler_status_t
rocprofiler_iterate_buffer_tracing_kind_operations(
@@ -574,16 +576,17 @@ typedef int (*rocprofiler_buffer_tracing_operation_args_cb_t)(
/**
* @brief Iterates over all the arguments for the traced function (when available). This is
* particularly useful when tools want to annotate traces with the function arguments. See
* @example samples/api_buffer_tracing/client.cpp for a usage example.
* @example samples/api_buffered_tracing/client.cpp for a usage example.
*
* In contrast to ::rocprofiler_iterate_callback_tracing_kind_operation_args, this function
* cannot dereference pointer arguments since there is a high probability that the pointer
* address references the stack and the buffer tracing record is delivered after the
* stack variables of the corresponding function have been destroyed.
*
* @param[in] record Buffer record
* @param[in] callback The callback function which will be invoked for each argument
* @param[in] user_data Data to be passed to each invocation of the callback
* @param [in] record Buffer record
* @param [in] callback The callback function which will be invoked for each argument
* @param [in] user_data Data to be passed to each invocation of the callback
* @return ::rocprofiler_status_t
*/
rocprofiler_status_t
rocprofiler_iterate_buffer_tracing_record_args(
@@ -175,19 +175,19 @@ typedef struct rocprofiler_callback_tracing_code_object_load_data_t
struct
{
int storage_file; ///< file descriptor of the code object that was loaded. Access this
///< field if @ref rocprofiler_code_object_storage_type_t is
///< @ref ROCPROFILER_CODE_OBJECT_STORAGE_TYPE_FILE
///< field if ::rocprofiler_code_object_storage_type_t is
///< ::ROCPROFILER_CODE_OBJECT_STORAGE_TYPE_FILE
};
struct
{
uint64_t memory_base; ///< The memory address of the first byte of the code object that
///< was loaded. Access this
///< field if @ref rocprofiler_code_object_storage_type_t is
///< @ref ROCPROFILER_CODE_OBJECT_STORAGE_TYPE_MEMORY
uint64_t memory_size; ///< The memory size in bytes of the code object that was loaded.
///< Access this field if @ref
///< rocprofiler_code_object_storage_type_t is
///< @ref ROCPROFILER_CODE_OBJECT_STORAGE_TYPE_MEMORY
///< field if ::rocprofiler_code_object_storage_type_t is
///< ::ROCPROFILER_CODE_OBJECT_STORAGE_TYPE_MEMORY
uint64_t
memory_size; ///< The memory size in bytes of the code object that was loaded.
///< Access this field if ::rocprofiler_code_object_storage_type_t is
///< ::ROCPROFILER_CODE_OBJECT_STORAGE_TYPE_MEMORY
};
};
} rocprofiler_callback_tracing_code_object_load_data_t;
@@ -349,7 +349,7 @@ typedef struct rocprofiler_callback_tracing_hip_stream_data_t
* @brief API Tracing callback function. This function is invoked twice per API function: once
* before the function is invoked and once after the function is invoked. The external correlation
* id value within the record is assigned the value at the top of the external correlation id stack.
* It is permissible to invoke @ref rocprofiler_push_external_correlation_id within the enter phase;
* It is permissible to invoke ::rocprofiler_push_external_correlation_id within the enter phase;
* when a new external correlation id is pushed during the enter phase, rocprofiler will use that
* external correlation id for any async events and provide the new external correlation id during
* the exit callback... In other words, pushing a new external correlation id within the enter
@@ -368,15 +368,15 @@ typedef void (*rocprofiler_callback_tracing_cb_t)(rocprofiler_callback_tracing_r
void* callback_data) ROCPROFILER_NONNULL(2);
/**
* @brief Callback function for mapping @ref rocprofiler_callback_tracing_kind_t ids to
* @brief Callback function for mapping ::rocprofiler_callback_tracing_kind_t ids to
* string names. @see rocprofiler_iterate_callback_tracing_kind_names.
*/
typedef int (*rocprofiler_callback_tracing_kind_cb_t)(rocprofiler_callback_tracing_kind_t kind,
void* data);
/**
* @brief Callback function for mapping the operations of a given @ref
* rocprofiler_callback_tracing_kind_t to string names. @see
* @brief Callback function for mapping the operations of a given
* ::rocprofiler_callback_tracing_kind_t to string names. @see
* rocprofiler_iterate_callback_tracing_kind_operation_names.
*/
typedef int (*rocprofiler_callback_tracing_kind_operation_cb_t)(
@@ -417,12 +417,12 @@ typedef int (*rocprofiler_callback_tracing_operation_args_cb_t)(
/**
* @brief Configure Callback Tracing Service. The callback tracing service provides two synchronous
* callbacks around an API function on the same thread as the application which is invoking the API
* function. This function can only be invoked once per @ref
* rocprofiler_callback_tracing_kind_t value, i.e. it can be invoked once for the HSA API,
* once for the HIP API, and so on but it will fail if it is invoked for the HSA API twice. Please
* note, the callback API does have the potentially non-trivial overhead of copying the function
* arguments into the record. If you are willing to let rocprofiler record the timestamps, do not
* require synchronous notifications of the API calls, and want to lowest possible overhead, use the
* function. This function can only be invoked once per ::rocprofiler_callback_tracing_kind_t value,
* i.e. it can be invoked once for the HSA API, once for the HIP API, and so on but it will fail if
* it is invoked for the HSA API twice. Please note, the callback API does have the potentially
* non-trivial overhead of copying the function arguments into the record. If you are willing to let
* rocprofiler record the timestamps, do not require synchronous notifications of the API calls, and
* want to lowest possible overhead, use the
* @see BUFFER_TRACING_SERVICE.
*
* @param [in] context_id Context to associate the service with
@@ -435,12 +435,12 @@ typedef int (*rocprofiler_callback_tracing_operation_args_cb_t)(
* @param [in] callback_args Data provided to every invocation of the callback function
* @return ::rocprofiler_status_t
* @retval ::ROCPROFILER_STATUS_ERROR_CONFIGURATION_LOCKED Invoked outside of the initialization
* function in @ref rocprofiler_tool_configure_result_t provided to rocprofiler via @ref
* rocprofiler_configure function
* function in ::rocprofiler_tool_configure_result_t provided to rocprofiler via
* ::rocprofiler_configure function
* @retval ::ROCPROFILER_STATUS_ERROR_CONTEXT_NOT_FOUND The provided context is not valid/registered
* @retval ::ROCPROFILER_STATUS_ERROR_SERVICE_ALREADY_CONFIGURED if the same @ref
* rocprofiler_callback_tracing_kind_t value is provided more than once (per context) -- in
* other words, we do not support overriding or combining the operations in separate function calls.
* @retval ::ROCPROFILER_STATUS_ERROR_SERVICE_ALREADY_CONFIGURED if the same
* ::rocprofiler_callback_tracing_kind_t value is provided more than once (per context) -- in other
* words, we do not support overriding or combining the operations in separate function calls.
*
*/
rocprofiler_status_t
@@ -496,8 +496,8 @@ rocprofiler_query_callback_tracing_kind_operation_name(rocprofiler_callback_trac
* @brief Iterate over all the mappings of the callback tracing kinds and get a callback for each
* kind.
*
* @param [in] callback Callback function invoked for each enumeration value in @ref
* rocprofiler_callback_tracing_kind_t with the exception of the `NONE` and `LAST` values.
* @param [in] callback Callback function invoked for each enumeration value in
* ::rocprofiler_callback_tracing_kind_t with the exception of the `NONE` and `LAST` values.
* @param [in] data User data passed back into the callback
* @return ::rocprofiler_status_t
*/
@@ -506,13 +506,13 @@ rocprofiler_iterate_callback_tracing_kinds(rocprofiler_callback_tracing_kind_cb_
void* data) ROCPROFILER_API ROCPROFILER_NONNULL(1);
/**
* @brief Iterates over all the mappings of the operations for a given @ref
* rocprofiler_callback_tracing_kind_t and invokes the callback with the kind id, operation
* id, and user-provided data.
* @brief Iterates over all the mappings of the operations for a given
* ::rocprofiler_callback_tracing_kind_t and invokes the callback with the kind id, operation id,
* and user-provided data.
*
* @param [in] kind which tracing callback kind operations to iterate over
* @param [in] callback Callback function invoked for each operation associated with @ref
* rocprofiler_callback_tracing_kind_t with the exception of the `NONE` and `LAST` values.
* @param [in] callback Callback function invoked for each operation associated with
* ::rocprofiler_callback_tracing_kind_t with the exception of the `NONE` and `LAST` values.
* @param [in] data User data passed back into the callback
* @return ::rocprofiler_status_t
* @retval ::ROCPROFILER_STATUS_ERROR_KIND_NOT_FOUND Invalid domain id
@@ -40,7 +40,7 @@ ROCPROFILER_EXTERN_C_INIT
* be used across many contexts. The config has a fixed set of counters
* that are collected (and specified by counter_list). The available
* counters for an agent can be queried using
* @ref rocprofiler_iterate_agent_supported_counters. An existing config
* ::rocprofiler_iterate_agent_supported_counters. An existing config
* may be supplied via config_id to use as a base for the new config.
* All counters in the existing config will be copied over to the new
* config. The existing config will remain unmodified and usable with
@@ -99,7 +99,7 @@ rocprofiler_query_record_counter_id(rocprofiler_counter_instance_id_t id,
* @brief (experimental) Query dimension position from record_id. If the dimension does not exist
* in the counter, the return will be 0.
*
* @param [in] id record id from @ref rocprofiler_counter_record_t
* @param [in] id record id from ::rocprofiler_counter_record_t
* @param [in] dim dimension for which positional info is requested (currently only
* 0 is allowed, i.e. flat array without dimension).
* @param [out] pos value of the dimension in id
@@ -115,7 +115,7 @@ rocprofiler_query_record_dimension_position(rocprofiler_counter_instance_id_t i
* @brief (experimental) Query Counter info such as name or description.
*
* @param [in] counter_id counter to get info for
* @param [in] version Version of struct in info, see @ref rocprofiler_counter_info_version_id_t for
* @param [in] version Version of struct in info, see ::rocprofiler_counter_info_version_id_t for
* available types
* @param [out] info rocprofiler_counter_info_{version}_t struct to write info to.
* @return ::rocprofiler_status_t
@@ -134,10 +134,10 @@ rocprofiler_query_counter_info(rocprofiler_counter_id_t counter_id,
*
* @param [in] agent_id Agent ID of the current callback
* @param [in] counters An array of counters that are avialable on the agent
* @ref rocprofiler_iterate_agent_supported_counters was called on.
* ::rocprofiler_iterate_agent_supported_counters was called on.
* @param [in] num_counters Number of counters contained in counters
* @param [in] user_data User data supplied by
* @ref rocprofiler_iterate_agent_supported_counters
* ::rocprofiler_iterate_agent_supported_counters
*/
ROCPROFILER_SDK_EXPERIMENTAL typedef rocprofiler_status_t (*rocprofiler_available_counters_cb_t)(
rocprofiler_agent_id_t agent_id,
@@ -181,9 +181,13 @@
#endif
// TODO(jomadsen): uncomment below code before v1.0.0
// #if !defined(ROCPROFILER_SDK_DEPRECATED_WARNINGS)
// # define ROCPROFILER_SDK_DEPRECATED_WARNINGS 1
// #endif
#if !defined(ROCPROFILER_SDK_DEPRECATED_WARNINGS)
# define ROCPROFILER_SDK_DEPRECATED_WARNINGS 0
#endif
#if !defined(ROCPROFILER_SDK_EXPERIMENTAL_WARNINGS)
# define ROCPROFILER_SDK_EXPERIMENTAL_WARNINGS 0
#endif
#if defined(ROCPROFILER_SDK_DEPRECATED_WARNINGS) && ROCPROFILER_SDK_DEPRECATED_WARNINGS > 0
# define ROCPROFILER_SDK_DEPRECATED(...) ROCPROFILER_SDK_DEPRECATED_MESSAGE(__VA_ARGS__)
@@ -69,7 +69,7 @@ typedef struct ROCPROFILER_SDK_EXPERIMENTAL rocprofiler_dispatch_counting_servic
* @brief (experimental) Kernel Dispatch Callback. This is a callback that is invoked before the
* kernel is enqueued into the HSA queue. What counters to collect for a kernel are set via passing
* back a profile config (config) in this callback. These counters will be collected and emplaced in
* the buffer with @ref rocprofiler_buffer_id_t used when setting up this callback.
* the buffer with ::rocprofiler_buffer_id_t used when setting up this callback.
*
* @param [in] dispatch_data @see ::rocprofiler_dispatch_counting_service_data_t
* @param [out] config Profile config detailing the counters to collect for this kernel
@@ -86,8 +86,8 @@ typedef void (*rocprofiler_dispatch_counting_service_cb_t)(
/**
* @brief (experimental) Counting record callback. This is a callback is invoked when the kernel
* execution is complete and contains the counter profile data requested in
* @ref rocprofiler_dispatch_counting_service_cb_t. Only used with
* @ref rocprofiler_configure_callback_dispatch_counting_service.
* ::rocprofiler_dispatch_counting_service_cb_t. Only used with
* ::rocprofiler_configure_callback_dispatch_counting_service.
*
* @param [in] dispatch_data @see ::rocprofiler_dispatch_counting_service_data_t
* @param [in] record_data Counter record data.
@@ -113,14 +113,14 @@ typedef void (*rocprofiler_dispatch_counting_record_cb_t)(
* NOTE: Interface is up for comment as to whether restrictions
* on agent should be made here (limiting the CB based on agent)
* or if the restriction should be performed by the tool in
* @ref rocprofiler_dispatch_counting_service_cb_t (i.e.
* ::rocprofiler_dispatch_counting_service_cb_t (i.e.
* tool code checking the agent param to see if they want to profile
* it).
*
* Interface is up for comment as to whether restrictions
* on agent should be made here (limiting the CB based on agent)
* or if the restriction should be performed by the tool in
* @ref rocprofiler_dispatch_counting_service_cb_t (i.e.
* ::rocprofiler_dispatch_counting_service_cb_t (i.e.
* tool code checking the agent param to see if they want to profile
* it).
*
@@ -30,7 +30,7 @@ ROCPROFILER_EXTERN_C_INIT
/**
* @brief (experimental) Apply a custom counter definition (YAML). This function must be called
* before counter iteration functions like @ref rocprofiler_iterate_agent_supported_counters if
* before counter iteration functions like ::rocprofiler_iterate_agent_supported_counters if
* custom counter definitions are to be used. This function will return an error if the definition
* has already been loaded.
* @param [in] yaml YAML string containing counter definitions
@@ -46,6 +46,4 @@ rocprofiler_load_counter_definition(const char* yaml,
size_t size,
rocprofiler_counter_flag_t flags) ROCPROFILER_API;
/** @} */
ROCPROFILER_EXTERN_C_FINI
@@ -36,6 +36,10 @@ ROCPROFILER_EXTERN_C_INIT
* @{
*/
/**
* @brief Types of ATT parameters
*
*/
typedef enum rocprofiler_att_parameter_type_t
{
ROCPROFILER_ATT_PARAMETER_TARGET_CU = 0, ///< Select the Target CU or WGP
@@ -48,6 +52,10 @@ typedef enum rocprofiler_att_parameter_type_t
ROCPROFILER_ATT_PARAMETER_LAST
} rocprofiler_att_parameter_type_t;
/**
* @brief ATT parameter specification
*
*/
typedef struct rocprofiler_att_parameter_t
{
rocprofiler_att_parameter_type_t type;
@@ -64,6 +72,7 @@ typedef struct rocprofiler_att_parameter_t
/**
* @brief Callback to be triggered every time some ATT data is generated by the device
* @param [in] agent Identifier for the target agent (@see ::rocprofiler_agent_id_t)
* @param [in] shader_engine_id ID of shader engine, as enabled by SE_MASK
* @param [in] data Pointer to the buffer containing the ATT data
* @param [in] data_size Number of bytes in "data"
@@ -634,7 +634,7 @@ typedef struct rocprofiler_correlation_id_t
/// @brief An ID specified by tools to associate external events.
/// See include/rocprofiler-sdk/external_correlation.h
/// @var ancestor
/// @brief Stores the ::internal value of the API call that generated this
/// @brief Stores the @ref internal value of the API call that generated this
/// API call.
} rocprofiler_correlation_id_t;
@@ -694,7 +694,7 @@ typedef struct rocprofiler_counter_id_t
*/
typedef struct rocprofiler_counter_config_id_t
{
uint64_t handle; // Opaque handle
uint64_t handle; ///< Opaque handle
} rocprofiler_counter_config_id_t;
/**
@@ -757,12 +757,16 @@ typedef struct rocprofiler_record_header_t
{
struct
{
uint32_t category; ///< ::rocprofiler_buffer_category_t
uint32_t kind; ///< domain
/** @brief ::rocprofiler_buffer_category_t */
uint32_t category;
/** @brief domain */
uint32_t kind;
};
uint64_t hash; ///< generic identifier. You can compute this via: `uint64_t hash = category
///< | ((uint64_t)(kind) << 32)`, e.g.
/** @brief generic identifier. You can compute this via: `uint64_t hash = category |
* ((uint64_t)(kind) << 32)` */
uint64_t hash;
};
/** @brief Pointer to data. Should be casted to data type based on category + kind */
void* payload;
} rocprofiler_record_header_t;
@@ -80,7 +80,7 @@ typedef void (*rocprofiler_intercept_library_cb_t)(rocprofiler_intercept_table_t
* invocation of one of their public API functions), these runtimes will provide a table of function
* pointers to the rocprofiler library via the rocprofiler-register library if the
* `rocprofiler_configure` symbol is visible in the application's symbol table. The vast majority of
* tools will want to use the ::CALLBACK_TRACING_SERVICE to trace these runtime APIs, however,
* tools will want to use the @ref CALLBACK_TRACING_SERVICE to trace these runtime APIs, however,
* some tools may want or require installing their own intercept functions in lieu of receiving
* these callbacks and those tools should use the ::rocprofiler_at_intercept_table_registration
* to install their intercept functions. There are no restrictions to where or how early this
@@ -33,7 +33,7 @@ ROCPROFILER_EXTERN_C_INIT
*
* @{
* @example api_buffered_tracing/client.cpp
* Example demonstrating ::BUFFER_TRACING_SERVICE that includes usage of
* Example demonstrating @ref BUFFER_TRACING_SERVICE that includes usage of
* ::rocprofiler_at_internal_thread_create, ::rocprofiler_create_callback_thread, and
* ::rocprofiler_assign_callback_thread.
*/
@@ -255,10 +255,10 @@ typedef struct ROCPROFILER_SDK_EXPERIMENTAL rocprofiler_pc_t
/// @var code_object_offset
/// @brief If @ref code_object_id is different than ::ROCPROFILER_CODE_OBJECT_ID_NONE,
/// then this field contains the offset of the sampled PC relative to the
/// ::rocprofiler_callback_tracing_code_object_load_data_t::load_base
/// ::rocprofiler_callback_tracing_code_object_load_data_t.load_base
/// of the code object instance with @ref code_object_id.
/// To calculate the original virtual address of the sampled PC, one can add the value
/// of this field to the ::rocprofiler_callback_tracing_code_object_load_data_t::load_base.
/// of this field to the ::rocprofiler_callback_tracing_code_object_load_data_t.load_base.
/// The value of @ref code_object_offset matches
/// the virtual address of the sampled instruction (PC), only if the
/// @ref code_object_id is equal to the ::ROCPROFILER_CODE_OBJECT_ID_NONE.
@@ -270,7 +270,7 @@ typedef struct ROCPROFILER_SDK_EXPERIMENTAL rocprofiler_pc_t
typedef struct ROCPROFILER_SDK_EXPERIMENTAL rocprofiler_pc_sampling_record_host_trap_v0_t
{
uint64_t size; ///< Size of this struct
rocprofiler_pc_sampling_hw_id_v0_t hw_id; ///< @see ::rocprofiler_pc_sampling_hw_id_0_t
rocprofiler_pc_sampling_hw_id_v0_t hw_id; ///< @see ::rocprofiler_pc_sampling_hw_id_v0_t
rocprofiler_pc_t pc; ///< information about sampled program counter
uint64_t exec_mask; ///< active SIMD lanes when sampled
uint64_t timestamp; ///< timestamp when sample is generated
@@ -355,7 +355,6 @@ typedef enum ROCPROFILER_SDK_EXPERIMENTAL rocprofiler_pc_sampling_instruction_no
/// @brief Arbiter issued an instruction, but the execution pipe pushed it back from execution.
/// @var ROCPROFILER_PC_SAMPLING_INSTRUCTION_NOT_ISSUED_REASON_OTHER_WAIT
/// @brief Other types of wait (e.g., wait for XNACK acknowledgment).
} rocprofiler_pc_sampling_instruction_not_issued_reason_t;
/**
@@ -24,12 +24,12 @@
/**
*
* \file rocprofiler.h
* \brief ROCProfiler-SDK API interface.
* @file rocprofiler.h
* @brief ROCProfiler-SDK API interface.
*
* \mainpage ROCProfiler-SDK API Specification
* @mainpage ROCProfiler-SDK API Specification
*
* \section introduction Introduction
* @section introduction Introduction
* ROCprofiler-SDK is a library that implements the profiling and performance monitoring
* capabilities for AMD's ROCm platform. It provides a comprehensive set of APIs for:
*
@@ -84,6 +84,8 @@ ROCPROFILER_EXTERN_C_INIT
* @param [out] major The major version number is stored if non-NULL.
* @param [out] minor The minor version number is stored if non-NULL.
* @param [out] patch The patch version number is stored if non-NULL.
* @return ::rocprofiler_status_t
* @retval ::ROCPROFILER_STATUS_SUCCESS Always returned
*/
rocprofiler_status_t
rocprofiler_get_version(uint32_t* major, uint32_t* minor, uint32_t* patch) ROCPROFILER_API;
@@ -96,6 +98,8 @@ rocprofiler_get_version(uint32_t* major, uint32_t* minor, uint32_t* patch) ROCPR
* compilation time. This function can be invoked before tool initialization.
*
* @param [out] info Pointer to version triplet struct which will be populated by the function call.
* @return ::rocprofiler_status_t
* @retval ::ROCPROFILER_STATUS_SUCCESS Always returned
*/
rocprofiler_status_t
rocprofiler_get_version_triplet(rocprofiler_version_triplet_t* info) ROCPROFILER_API
@@ -142,6 +146,8 @@ ROCPROFILER_EXTERN_C_INIT
* @fn rocprofiler_status_t rocprofiler_get_timestamp(rocprofiler_timestamp_t* ts)
* @brief Get the timestamp value that rocprofiler uses
* @param [out] ts Output address of the rocprofiler timestamp value
* @return ::rocprofiler_status_t
* @retval ::ROCPROFILER_STATUS_SUCCESS Always returned
*/
rocprofiler_status_t
rocprofiler_get_timestamp(rocprofiler_timestamp_t* ts) ROCPROFILER_API ROCPROFILER_NONNULL(1);
@@ -150,24 +156,26 @@ rocprofiler_get_timestamp(rocprofiler_timestamp_t* ts) ROCPROFILER_API ROCPROFIL
* @fn rocprofiler_status_t rocprofiler_get_thread_id(rocprofiler_thread_id_t* tid)
* @brief Get the identifier value of the current thread that is used by rocprofiler
* @param [out] tid Output address of the rocprofiler thread id value
* @return ::rocprofiler_status_t
* @retval ::ROCPROFILER_STATUS_SUCCESS Always returned
*/
rocprofiler_status_t
rocprofiler_get_thread_id(rocprofiler_thread_id_t* tid) ROCPROFILER_API ROCPROFILER_NONNULL(1);
/**
* @fn const char* rocprofiler_get_status_name(rocprofiler_status_t status)
* @brief Return the string encoding of @ref rocprofiler_status_t value
* @brief Return the string encoding of ::rocprofiler_status_t value
* @param [in] status error code value
* @return Will return a nullptr if invalid/unsupported @ref rocprofiler_status_t value is provided.
* @return Will return a nullptr if invalid/unsupported ::rocprofiler_status_t value is provided.
*/
const char*
rocprofiler_get_status_name(rocprofiler_status_t status) ROCPROFILER_API;
/**
* @fn const char* rocprofiler_get_status_string(rocprofiler_status_t status)
* @brief Return the message associated with @ref rocprofiler_status_t value
* @brief Return the message associated with ::rocprofiler_status_t value
* @param [in] status error code value
* @return Will return a nullptr if invalid/unsupported @ref rocprofiler_status_t value is provided.
* @return Will return a nullptr if invalid/unsupported ::rocprofiler_status_t value is provided.
*/
const char*
rocprofiler_get_status_string(rocprofiler_status_t status) ROCPROFILER_API;
@@ -33,7 +33,7 @@ doxysphinx build ${WORK_DIR} ${WORK_DIR}/_build/html ${WORK_DIR}/_doxygen/rocpro
doxysphinx build ${WORK_DIR} ${WORK_DIR}/_build/html ${WORK_DIR}/_doxygen/roctx/html
message "Building html documentation"
make html SPHINXOPTS="--keep-going -n"
make html SPHINXOPTS="--keep-going -n -q -T"
if [ -d ${SOURCE_DIR}/docs ]; then
message "Removing stale documentation in ${SOURCE_DIR}/docs/"