286 Коммитов

Автор SHA1 Сообщение Дата
Luu, Jonathan 337cbeba6f SWDEV-531400 - Remove File reorganization backward computability (roctracer) (#40)
* SWDEV-531400 - Remove File reorganization backward computability (roctracer)

* removing no longer needed files

---------

Co-authored-by: Jonathan Luu <jonatluu@amd.com>

[ROCm/roctracer commit: 9a620d64d9]
2025-06-18 13:33:41 -04:00
Gopesh b9bc6d7bd5 Revert " SWDEV-477849: Remove dependency of libatomic from roctracer"
This reverts commit 3c4467274f.

Change-Id: I63a0166f629fa6f3b71f03b4e540e4d8ee160910


[ROCm/roctracer commit: 82ebb1c3ec]
2024-10-28 01:20:02 -05:00
itrowbri 3c4467274f SWDEV-477849: Remove dependency of libatomic from roctracer
Change-Id: I2d94218936d33d832d1fddfe14454de5c1bc64f5


[ROCm/roctracer commit: 4ca1a68fd9]
2024-10-16 13:49:52 -05:00
Giovanni LB c53b6ff6f7 SWDEV-448279: Workaround for UB24 compiler errors
Change-Id: I01e880502edac8e8b941d199e08bc8f1eded0a89


[ROCm/roctracer commit: 4bc8dbd029]
2024-02-28 23:56:14 -03:00
Ammar ELWazir d20003ed92 Fixing ROCTracer to match versioning changes in HIP Runtime
Change-Id: Ibde2419314824f12acb4cf51dc675cb14a51851c


[ROCm/roctracer commit: aa3c07c257]
2024-01-03 12:29:24 -06:00
Ammar ELWazir 56d5b93339 Fixing initialization of ROCTx for the tool in the default constructor
Change-Id: I12a3bbde4420a9eb8d734c546169a11cb23237dd


[ROCm/roctracer commit: dbfe955d57]
2023-10-30 16:53:21 +00:00
gobhardw ec8c8ccc44 SWDEV-408936 solving rocprof hang due to early initialization
Change-Id: Ia9c52f3b4c7ff191054cef40208f26b28f021378


[ROCm/roctracer commit: d4c2546336]
2023-10-25 20:02:27 +05:30
Benjamin Welton f15bf42e72 Added ROCTRACER_BUFFER_SIZE to set buffer size
[SWDEV-418917] reported that timing skew was being introduced by
roctracer. Most of the cause of this problem seems to stem from outrunning
the double buffering scheme that we use in memory_pool (part of the
reason for this outrun is due to File writing being slow). A semi-quick
fix that may be able to last until RocProf v2 is complete is to allow
adjustment of the buffer size. ROCTRACER_BUFFER_SIZE env variable was
introduced here which allows setting the buffer size of tracer tool.

By increasing the buffer size, an ~8% reduction in execution time when timing
on the program side. This should also reduce the frequency of large delays
when we outrun the buffer. Note: increasing this size dramatically can cause
slow startups (i.e. above 50MB).

Change-Id: I98c4316cfe93a043623ae2669cfe1a5abb55c990


[ROCm/roctracer commit: 38ba63030d]
2023-10-18 18:06:54 +00:00
Ammar ELWazir 2b78928d60 SWDEV-415259: Replacing HCC with AMD
__HIP_PLATFORM_HCC__ with __HIP_PLATFORM_AMD__

Change-Id: I2e79cff5a0216125b4ce2aa90104d4a1696bad08


[ROCm/roctracer commit: 67b3717da9]
2023-08-17 09:23:45 -04:00
Ranjith Ramakrishnan 5c6492d1ec SWDEV-366827 - Disable file reorg backward compatibility support by default
Change-Id: Ibf3c409c1741211ea86d52a90227c64ef47ee54b


[ROCm/roctracer commit: 6ab944c009]
2023-08-07 11:01:11 -07:00
Ranjith Ramakrishnan 2d06c8c312 SWDEV-409575 - Append additional RPATH to libraries installed in /opt/rocm-ver/lib/roctracer
RPATH in libraries installed in /opt/rocm-ver/lib/roctracer should be: $ORIGIN:$ORIGIN/..
cmake shared linker flags will provide the rpath $ORIGIN
The patch will append the rpath $ORIGIN/.. to the component specific libraries

Change-Id: Ied2bcb57bf0dd38ee3d1a946a5afc1bb182ff619


[ROCm/roctracer commit: 6fbf7673aa]
2023-07-13 16:43:46 -07:00
Ammar ELWazir e3a756d8f7 SWDEV-288134: Workaround to enable roctracer early
Change-Id: Iae21dbfd9f50dcf2e317130c6dc8328f17eba553


[ROCm/roctracer commit: 04d0bd4874]
2023-06-20 21:59:19 +00:00
gobhardw 56a2989ffa SWDEV-398161, SWDEV-398764 Fixed hsa-trace failures for profiling data corrupted
Change-Id: I3d8dbb2a40d948cd06cb1278acc50dc5be4ca0ef


[ROCm/roctracer commit: ee713682a1]
2023-05-15 22:38:23 +05:30
Ranjith Ramakrishnan a53f6af29e SWDEV-383221 - Set the default value of ROCM_HEADER_WRAPPER_WERROR to OFF
Using wrapper header files will result in #warning message by default

Change-Id: Ib8a05d11f2391dfcdac8601da26e1096821cd555


[ROCm/roctracer commit: 245eafea4c]
2023-05-08 16:28:19 -07:00
Ranjith Ramakrishnan 70eb1706af SWDEV-366831 - Compile time flag to switch between #warning and #error message
Using backward compatibility paths will provide an #error message. Compile time option added to enable/disable the #error message.
Disabling the same will provide a #warning message

Change-Id: I6abc236e810ccc38d3636074e0e8f5a9657c2e9a


[ROCm/roctracer commit: ea061be2d1]
2023-03-10 09:12:20 -08:00
AravindanC 5019a364c8 SWDEV-351540 - ASAN packaging for roctracer
Change-Id: If23c92e785fbbeb27034a8958568dd86b847beed


[ROCm/roctracer commit: 4edc9727bd]
2023-02-27 11:32:39 -08:00
Ranjith Ramakrishnan 9ee831c09f Split roctracer to runtime and dev/devel package
SWDEV-356024 - Development package name will have suffix dev or devel based on OS
Devel package contents - Header files, name link of public library files, html files and roctracer manual file
Runtime package contents - Versioned public library files, private library files and license file

Change-Id: I8ced3eab5d8824a66be39b9e777368506516b155


[ROCm/roctracer commit: 9acba8b4a1]
2023-01-17 14:10:58 -08:00
Laurent Morichetti 644e3b5253 Report HSA_OPS activities using the ROCr driver_node_id instead of the device's index
When multiple ranks are used, each rank's first logical device always
has GPU ID 0, regardless of which physical device is selected with
CUDA_VISIBLE_DEVICES. Because of this, when merging trace files from
multiple ranks, GPU IDs from different processes may overlap.

The long term solution is to use the KFD's gpu_id which is stable
across APIs and processes. Unfortunately the gpu_id is not yet exposed
by the ROCr, so for now use the driver's node id.

Change-Id: I2f5af8d2a7e8a89efeb5e0a1b86bdfa547b25fc8


[ROCm/roctracer commit: 799f0323cd]
2022-10-18 20:08:09 -07:00
Laurent Morichetti 4f0a4afd95 Fix a build error when compiling with clang
Fix the following error:

roctx.cpp:91:25: error: reinterpret_cast from 'const void *' to 'decltype(report_activity.load())' (aka 'int (*)(activity_domain_t, unsigned int, void *)') casts away qualifiers
  report_activity.store(reinterpret_cast<decltype(report_activity.load())>(function),
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

by replacing the 'const void *function' argument with the correct type.

Change-Id: I912239daf6f4a3f00fc753306b84833e5c75f74b


[ROCm/roctracer commit: c95d5dd96f]
2022-10-18 18:20:58 -07:00
Laurent Morichetti aaf512c9ad Remove the thread local begin_timestamp stack
Using a thread_local object is problematic as the thread local
destructors are called first before any global destructor, making
the object invalid while tearing down the process.

rocblas uses a global destructor to clean up the loaded HIP modules
and ends up calling hip_executable_destroy after the timestamp stack
is destructed. As a result the begin timestamp for that API function
is 0.

The solution is to store the phase_enter timestamp in the phase_data.

Change-Id: If143f4d123dfb111c72fb20365431d07e73fc570


[ROCm/roctracer commit: 8a575d8d6e]
2022-09-30 15:01:08 -07:00
Laurent Morichetti f36f7e1b3e Fix an issue with aync copy timestamps
The timestamps coming from the HIP runtime for asynchronus memory
copies are corrupted (begin > end) because the HSA setting to record
timestamps is turned off by the tracer's HSA intercept.

The solution is to intercept hsa_amd_profiling_async_copy_enable and
remember the application/runtime's request so that it can be ORed with
IsEnabled(ACTIVITY_DOMAIN_HSA_OPS, HSA_OP_ID_COPY).

Change-Id: Ib687cbf36711563e86c2bb8bc934c7c51572bfde


[ROCm/roctracer commit: 329c0467cb]
2022-09-28 15:44:40 -07:00
Laurent Morichetti 6ea76c581b Use the "safe" Stack for begin_timestamp
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]
2022-09-26 13:44:55 -07:00
Laurent Morichetti e8dc8de195 Fix a typo in HipLoader
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]
2022-09-26 09:31:14 -07:00
Laurent Morichetti f262501ed3 Clean up logger.h
Change-Id: Ibcb58d2236b012d00c3fc421a425c03093de5d50


[ROCm/roctracer commit: bb98bc7d85]
2022-09-16 09:55:09 -07:00
Laurent Morichetti 6dea5c5e3d Fix an array subscript out-of-bounds error
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]
2022-09-16 09:54:40 -07:00
Laurent Morichetti 14c153601d SWDEV-355896 - Fix a data corruption error in post processing
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]
2022-09-13 08:21:13 -07:00
Laurent Morichetti 1d0f27e2c8 Fix the symbol name for deprecated functions
Change-Id: I53c0af1d1f6a3998992bdaa737e9b10829e5abc3


[ROCm/roctracer commit: 900d5e0a64]
2022-09-08 21:04:41 -07:00
Laurent Morichetti cb7d599829 Fix hsa_support::timestamp_ns if HSA is not yet initialized
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]
2022-09-08 21:02:31 -07:00
Laurent Morichetti fe526e0c36 Fix the Loader
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]
2022-09-08 20:58:07 -07:00
Laurent Morichetti 7ea1dbafd2 SWDEV-351980 - Remove the ROCtracer private interface from the public header
Change-Id: Ib3183e87d0c2bd1679926a4da9bbb6e46d70fb9f


[ROCm/roctracer commit: ab3f361f61]
2022-09-08 20:58:07 -07:00
Laurent Morichetti 3d46d2d5cb SWDEV-351980 - Consolidate registration tables in the roctracer
Change-Id: I44cd1cc81cf6a529aed89ee8db1377c0aa67f0dc


[ROCm/roctracer commit: 2673bf5e2c]
2022-09-08 20:58:05 -07:00
Laurent Morichetti a7700afbf6 Use fatal() and warning() for logging errors
Change-Id: I4d525ed2a7dba72beff6fbe43383015e55465fcd


[ROCm/roctracer commit: 57867e4803]
2022-09-06 19:38:16 -07:00
Laurent Morichetti f4ef972b10 Remove tracker.h
Change-Id: I74860431c5f4c4954ddb79fb7e2a613fecc8793b


[ROCm/roctracer commit: 9d69e7d49a]
2022-09-06 19:38:16 -07:00
Laurent Morichetti 4b82df9748 Fix nested timestamps
Change-Id: I6385d52cc858670a116f5c2eb65e4f19be73190f


[ROCm/roctracer commit: 61c232bc69]
2022-09-06 19:38:16 -07:00
Laurent Morichetti 981bf5f75a Remove the ROCprofiler loader
Was used for the HSA_EVT activities, so no longer needed.

Change-Id: I7729fb4519f2e3cee73776264647381cb5826067


[ROCm/roctracer commit: 9c57b150af]
2022-09-06 19:38:16 -07:00
Laurent Morichetti 8548060d8d Bring the HSA_EVT callbacks back to the roctracer
Change-Id: I26080b264d7989880ba7e9f00502cc680b2256d7


[ROCm/roctracer commit: c2b87b1fd7]
2022-09-06 19:38:12 -07:00
Laurent Morichetti 0197ed4253 Use a global correlation_id for all records
Change-Id: I87fe16fefb52a95242bc64b7007b71c9d8978d44


[ROCm/roctracer commit: ac3214d32a]
2022-09-06 19:20:54 -07:00
Laurent Morichetti f7c8382e33 SWDEV-351980 - Use the new hipRegister/RemoveAsyncActivityCallback
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]
2022-09-06 19:11:11 -07:00
Laurent Morichetti 9528bf6128 SWDEV-351980 - Remove HipApi{Callback|Activity}{Enable|Disable}Check
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]
2022-09-06 19:11:11 -07:00
Laurent Morichetti f50c9d4149 SWDEV-351980 - Don't allocate hip_api_data and record
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]
2022-09-06 19:11:11 -07:00
Laurent Morichetti 9674c2b11a Deprecate enable/disable_callback/activity[_expl]
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]
2022-09-06 19:11:09 -07:00
Laurent Morichetti 2a5452dbec Remove roctracer_mark
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]
2022-08-19 10:38:41 -07:00
Ammar ELWazir 699d17b733 Fixing issues caused by the plugin patches
- 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]
2022-08-19 00:01:02 -04:00
Laurent Morichetti fb7a9e383a New util library
- Add string_printf/string_vprintf.
- Add warning and error with backtrace support.

Change-Id: I3dd73b4caed0d767bd9e39ffef15ff8484d0b0bf


[ROCm/roctracer commit: 80d363a4bc]
2022-08-17 21:44:58 -07:00
Ammar ELWazir 88a630102c Adding File Plugin
- 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]
2022-08-11 12:06:13 -05:00
Ammar ELWazir 386847b9f4 Adding Plugin Interface
- Add roctracer plugins hooks
- Add Roctracer plugin environment variable
- Add the plugin class
- Add the plugin implementation

Change-Id: I12ee2e2be035abac14864764fb76837a4533cf60


[ROCm/roctracer commit: 1c7c5cc112]
2022-08-11 10:13:36 -05:00
Ammar ELWazir 157417bdf5 Changing NULL to nullptr (Tracer Tool)
Change-Id: I567bf7944599922e5d402e55142c2915ae24fb69


[ROCm/roctracer commit: 591db0b718]
2022-08-08 20:45:34 -05:00
Ammar ELWazir 7164518a4c Fixing HIP Callback Data Arguments
Change-Id: I0bd9686024eed8fa757cb9fd7042b0f9508c5af5


[ROCm/roctracer commit: 2e08b7d8f8]
2022-07-28 19:29:04 -05:00
Laurent Morichetti 24fc862144 Add agent enumeration
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]
2022-07-27 02:16:42 -04:00
Laurent Morichetti 748d8b5cec Cleanup roctracer_hsa.h
Remove declarations that are not meant to be part of the public API.

Change-Id: I47d9e83bf41bdb2f7ac25a1507200b51c616049b


[ROCm/roctracer commit: 05d3cf3529]
2022-07-27 02:16:15 -04:00