The tracer tool needs to remember the begin timestamps for API
callbacks, and uses a thread_local std::stack for that purpose.
The issue with thread_local objects is that they are destructed
before anything else when the main thread exits. To work around
that issue, we use a "safe" stack in the roctracer API.
Use the same "safe" stack in the tracer tool.
Change-Id: I0d69d4eb44f0205f4102d0d5ef9803a1ec1800a5
[ROCm/roctracer commit: b664937ebd]
rocprof errors out with the following message:
symbol lookup 'KernelNameRef' failed: libamdhip64.so.5: undefined \
symbol: KernelNameRef
The HipLoader is incorrectly looking for a KernelNameRef symbol
instead of hipKernelNameRef.
Fixed the typo: KernelNameRef -> hipKernelNameRef.
Change-Id: Ia4860e1669707b0c83d67e71b78d362b07a6aaa7
[ROCm/roctracer commit: a287f20961]
Starting with gcc-11 (verified with gcc-12 as well), an array
out-of-bounds subscript error is reported for accessing the registration
table element at the operation ID index. Validating the index in the
function calling Register/Unregister does not quiet the warning/error
in release builds, so, for gcc-11 and gcc-12, we disable that warning
just for the RegistrationTable class.
Change-Id: I6bc4a02aa072cfa8905ecde5e3960aebf32fc912
[ROCm/roctracer commit: 67ce5fae13]
Use #include "header" instead of #include <header> so that the header
files are found when the application #includes <roctracer/roctracer.h>
with -I /opt/rocm/include.
Change-Id: I24feac9a5030d3600aee98084340e246c3990db5
[ROCm/roctracer commit: 05ee3ff973]
The post-processing script cannot handle HIP ops without a correlation
ID. The correlation ID is needed to connect the record to a HIP stream
and originating thread.
This issue was exposed by a change to the tracer API to report
asynchronous activities even if their originating synchronous API
activity (callback) is not enabled. This was a flow in the API.
Also fix an issue with the API filtering. Undefined API names should
not cause an exception, they should be ignored.
Change-Id: Iab2221af6180ade2b9c2eb10c256c3a73d872e9f
[ROCm/roctracer commit: 4856d33959]
Default to the HSA runtime's hsa_system_get_info if the saved HSA
functions table is not yet initialized.
Change-Id: I3659095a5ad662f7ca8b0d92bd035901c6d66bb0
[ROCm/roctracer commit: 87ffbd27f4]
Instead of dlopen'ing RTLD_NOLOAD a library (for example libamdhip64.so)
and rely on the dynamic linker search path, search through the already
loaded shared objects for a library with a matching name.
Change-Id: I3e74d432bd7ca68df8927ca435b290e86aaaf9e9
[ROCm/roctracer commit: db69cc1c9f]
Remove the hipInitActivityCallback and use the new hipRegister/
RemoveActivityCallback which allows distinct memory pools to be used
for HIP_OPS activities.
Enable the multi_pool_activities test.
Change-Id: I6f6feaedecc9c36285bea975caf24dbf8f5f624b
[ROCm/roctracer commit: 340c7cb553]
The code is easier to read if calling HIPActivityCallbackTracker
enable/disable_check directly. Both enable/disable_check return the
new mask, and the check whether a callback is already installed is
clearer.
Change-Id: Ic90d34489b5b4d9929dc08b4d9e93cc974b136b1
[ROCm/roctracer commit: f0e082feb1]
The HIP runtime is now allocating the hip_api_data and record on its
stack so we don't need the thread local record_data_pair stack anymore.
Refactor the API callback function to handle both the case where
synchronous user callbacks are requested and the case where asynchronous
records are requested (enable_callback & enable_activity respectively).
If the callback argument (memory pool) is not null, then activity
records are requested.
Remove CorrelationIdRegister and CorrelationIdLookup. These were used
by the HIP runtime to associate a HIP record id to a ROCtracer
correlation id. Instead, the HIP runtime is now using the correlation
ID returned in the hip_api_data_t.
Added a test to check enabling/disabling concurrent callbacks and
activities.
Change-Id: I5850cfead9861eb3602a3e8fcb7b22580d5fc979
[ROCm/roctracer commit: 88c6e0a700]
These functions have little value as it is very unlikely an application
would want to enable all the domains.
Change-Id: I4743e8ddf6743e60c95c7ba5240950d2ef734301
[ROCm/roctracer commit: ad01ba513a]
This test checks that asynchronous activities can be enabled in distinct
memory pools. It enables activity reporting for HIP kernel dispatches in
one memory pool, and memory copy reporting in another memory pool.
The output of this test to stdout should be a series of kernel dispatch
records (10) followed by a series of memory copy records (10). The
records should not be interleaved.
Change-Id: Idb5cca7e650b2312a1955909932364f914737856
[ROCm/roctracer commit: cfdfa2a2d4]
The plugin's file scope global variables destructors could be called
before roctracer_plugin_finalize is called, making the global variables
undefined by the time roctracer_plugin_finalize is called.
To avoid this issue, remove all non-pod global variables from the file
plugin.
Change-Id: I4b620d67d460d9c99adfd81cbf46b0e64540c503
[ROCm/roctracer commit: 006ce7b65d]
This function has been deprecated since ROCm-2.9, use ROCTX's
roctxMark(const char* message) as a replacement for roctracer_mark.
Change-Id: Ie4aeae1db238453fc4451746cc9a338032ba817f
[ROCm/roctracer commit: bddb9850de]
- Multithreaded Applications and plugin destruction
- Fixing Async-copy trace in file plugin
- Adding the assert checkups for every trace buffer flush function
Change-Id: I96e096fd7ee2604931200a0b446edb5ce49959dd
[ROCm/roctracer commit: 4cd7497a87]
Don't set the color variables if tput is not available, not working, or
if ncolors < 8.
Move the color variables outside of eval to avoid calling tput over and
over again.
Change-Id: Id51a742b77ad0f7c99c1c7c5d05bed0f423b75de
[ROCm/roctracer commit: 993dcf9503]
- Added File plugin as the default plugin
- Moved the flush functions to the plugins
- Improved the flush to file implementation
Change-Id: I80dd448eb8147a8ea4aa63b39bd1d0a4baf7252b
[ROCm/roctracer commit: b7e1f74054]
This test verifies that callback argument matches the callback function
as a race condition while setting and reading the pair could result in
mismatched arguments.
Change-Id: I2fe49d98d19bb780b6956ea6718762cfa0de93f8
[ROCm/roctracer commit: 602c67ee00]
Intercept the first call to hsa_iterate_agents in order to number them.
The index assigned to agents will be used by a future commit.
Change-Id: I8db365f8fe913b6cde16a4dccb9bf09600846521
[ROCm/roctracer commit: 84ad727c38]
Remove declarations that are not meant to be part of the public API.
Change-Id: I47d9e83bf41bdb2f7ac25a1507200b51c616049b
[ROCm/roctracer commit: 05d3cf3529]
Move the HSA intercept to the OnLoad function, so that it is available
as soon as the ROCR is loaded.
Layer the HSA API wrappers on top of the basic HSA activity intercept.
Change-Id: Ie636d59755543cda181e76ec29f0b55081136b63
[ROCm/roctracer commit: e282a82e29]
This commit is for code cleanup and for optimizing kernel name search
in the API callback, making sure to get the kernel name accurately
for the hip functions that have any kernel names
Change-Id: Ie9ab917c895748bfb8eee9ddfcbcad81a0b9a9fa
[ROCm/roctracer commit: 054456bcf8]
Making sure not to count duplicates for load_unload_reload_trace and
fixed the ignore-count option in check_trace.py.
Change-Id: I9e674aa624ec3b473bb7c6cc95260e240204627f
[ROCm/roctracer commit: c588c49743]
When separate debug info is requested, the test package
generation fails because /usr/bin/objcopy does not understand
the HSA code object format. We need a workaround to get
past this issue.
Change-Id: I9a307fcf532ce8219a9301850aae972303d19990
[ROCm/roctracer commit: c2ecd15197]
When ROCP_TRUNCATE_NAMES is not set, getenv returns NULL and std::atoi
crashes. Check that getenv returns a non-NULL string before calling
std::atoi.
Change-Id: Ie479a481f8d23f034b425d14e3cfefb3d62c84e8
[ROCm/roctracer commit: a7cac4b4c9]
Split the public and private HSA profiler/tracer interfaces. Only the
public interface should be exposed in include/roctracer.
Change-Id: I7e4424cd90023693350c31e6b02caca8c984ba84
[ROCm/roctracer commit: 96bcac0f47]
Added a function to truncate the kernel names in case of hip trace.
Change-Id: Ida769679ccc38432538ce74c11c395d6a930018e
[ROCm/roctracer commit: e3db2beca7]
Adding roctracer_timestamp_t to be unified type for every timestamp in the roctracer project
Change-Id: I22f18c303bd2d02d1e6079b76da6b128eb384fdd
[ROCm/roctracer commit: 581c37502f]
The roctracer-tests package contains all the roctracer test binaries
and scripts needed to run the testsuite outside of the build directory.
Change-Id: Id11f862fb4bdb2425d68f455074172c38814ec92
[ROCm/roctracer commit: 3adc56bd9b]
activity.h and rocprofiler.h are already exposed in rocprofiler
through the rocm installation directory.
Change-Id: Ia383d3818fd51452390d2217d82503af4d91aac6
[ROCm/roctracer commit: ee1b7e056e]
The ROCR now detects already loaded tool libraries and calls OnLoad/
OnUnload in the order specified with HSA_AMD_TOOL_ORDER.
It is no longer necessary to set the HSA_TOOLS_LIB environment variable
to load the roctracer API. The roctracer tool library should be
pre-loaded with LD_PRELOAD.
Change-Id: I6de1b1bd4f93caa08d3554aad2376d242c74fb7e
[ROCm/roctracer commit: d32cf96cd4]