نمودار کامیت

666 کامیت‌ها

مولف SHA1 پیام تاریخ
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 e8cb732660 Cleanup the include files
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]
2022-09-13 08:23: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 179e03c172 Add multi_pool_activities test
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]
2022-08-26 19:28:19 -07:00
Laurent Morichetti d2e1384c40 Remove global variables from the file plugin
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]
2022-08-23 16:34:08 -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 dfc856d164 Use std::dec to print the begin_timestamp
Change-Id: I88377b840b2e2cce278575bc398cbdc296e6dfd7


[ROCm/roctracer commit: 753d543022]
2022-08-17 23:20:28 -07: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
Laurent Morichetti 690df5dfcb Fix tput
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]
2022-08-17 17:30:35 -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
Laurent Morichetti 6d856ddf53 Add a HIP domain callback stress test
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]
2022-07-30 02:51:37 -04: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
Laurent Morichetti 09472d6563 Fix HSA intercept
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]
2022-07-27 02:15:43 -04:00
Ammar ELWazir 0c3a97a5db SWDEV-342613: Tracer Tool Optimizations Ready for plugins
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]
2022-07-26 18:58:31 -05:00
Laurent Morichetti 7f47eb9d02 Add TraceBuffer entry construction/destruction
Change-Id: I354f36b0d7a0baea0efb75d5e81f169b5f969542


[ROCm/roctracer commit: 2513f9f51f]
2022-07-26 16:23:59 -07:00
Ammar ELWazir b2b252ba31 SWDEV-344206: Fixing Roctracer Tests
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]
2022-07-15 12:39:55 -04:00
Ammar ELWazir dc269b6c7e Temporary: Disabling Roctracer test package
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]
2022-07-15 09:33:08 -07:00
Laurent Morichetti 68daae8c75 Fix a SEGV in std::atoi
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]
2022-07-15 01:06:46 -07:00
Laurent Morichetti 71469dfc97 Split hsa_prof_str.h
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]
2022-07-14 21:20:30 -04:00
Sriraksha Nagaraj b1c2e08191 SWDEV-342302 - Fixing basenames options in case of hip trace
Added a function to truncate the kernel names in case of hip trace.

Change-Id: Ida769679ccc38432538ce74c11c395d6a930018e


[ROCm/roctracer commit: e3db2beca7]
2022-07-13 08:20:36 -04:00
Ammar ELWazir 0d5a4c80a3 SWDEV-342613: Adding typedef for timestamps
Adding roctracer_timestamp_t to be unified type for every timestamp in the roctracer project

Change-Id: I22f18c303bd2d02d1e6079b76da6b128eb384fdd


[ROCm/roctracer commit: 581c37502f]
2022-07-08 21:08:35 -04:00
Ranjith Ramakrishnan d351cbf0a7 SWDEV-321112: Use GNUInstallDirs
Use GNUInstallDirs variables to determine the location of BINDIR,
LIBDIR, INCLUDEDIR, DATADIR, DOCDIR, LIBEXECDIR.

Depends-On: Id11f862fb4bdb2425d68f455074172c38814ec92
Change-Id: I6459a4531ef899321a5e2d8050cf8b553e89a968


[ROCm/roctracer commit: 709e300d9b]
2022-07-07 10:36:39 -07:00
Laurent Morichetti f76ed5eb8e Add the roctracer-tests package
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]
2022-07-05 17:03:21 -04:00
Laurent Morichetti b25a931ff4 Rename project ROCTRACER -> roctracer
Change-Id: I83d47025aad59dc37a53ec82452b639fc8ffb478


[ROCm/roctracer commit: 957084de07]
2022-07-02 22:05:25 -07:00
Ammar ELWazir 724a21efea SWDEV-307399: Updating CMAKE dependency on rocprofiler
activity.h and rocprofiler.h are already exposed in rocprofiler
through the rocm installation directory.

Change-Id: Ia383d3818fd51452390d2217d82503af4d91aac6


[ROCm/roctracer commit: ee1b7e056e]
2022-06-28 18:41:13 -04:00
Sriraksha Nagaraj 927d2f45c4 SWDEV-323976:Adding support to display correlation-ids in hsa-trace files
Change-Id: Ie01658c1f55624b4986542853a9a85a4ca40866d


[ROCm/roctracer commit: 4484718571]
2022-06-27 07:54:22 -04:00
Laurent Morichetti 46061428fa Use the new ROCR support to automatically load tool libraries
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]
2022-06-24 16:45:03 -07:00