32 Commits

Author SHA1 Message Date
Ranjith Ramakrishnan 1d4e650841 SWDEV-369226 - Correct the usage of include file
In the generated header file hsa_prof_str.h , the header file hsa_ostream_ops.h was included using angle brackets
This results in compilation with include path /opt/rocm-ver/include. Corrected the usage by using double quotes

Change-Id: Ie9f1fff78d16a6953a2c99056b2acef42e577204


[ROCm/roctracer commit: b1585c983d]
2022-11-21 16:38:39 -08: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 549d6a5ec5 Fix a profiling data corrupted error
Using rocprof with ROCP_MCOPY_DATA=1 while tracing HSA produces the
following error:

tblextr.py: Memcpy args "(0x7feb16a00000, 123handle=28593376125, 0x7feb12a00010, 123handle=27558560125, 4194304, 0, 0, 123handle=140661639440000125) = 1" cannot be identified
Profiling data corrupted: ' ./out/rpl_data_220930_143009_1826700/input_results_220930_143009/results.txt'

There are two issues:

1) The hsa_agent_t handle argument is misprinted: "123handle=...125"
  Instead of printing '{' and '}', it prints '123' and '125'. The wrong
  operator<<(unsigned char) is used and an integer value is printed
  instead of a char.

  Use std::operator<< instead of hsa_support::detail::operator<< to
  print '{' and '}'

2) The result value is unitialized and in some cases printed as a
  negative integer value. The leading '-' is not matched by the
  mem_manager regular expresion for HSA api calls.

  Correctly capture the HSA function's return value.

Change-Id: If13a1e62eeb4e598447c4b90d53d1b2e3b408696


[ROCm/roctracer commit: 6416434d3b]
2022-09-30 13:36:48 -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 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 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
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
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
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 1418bca17c Move callback_table.h to the util directory
The CallbackTable utility is shared by multiple APIs, so move it out
of the roctracer directory.

Change-Id: Ie2378dca8a4f90bd334dbe2d39ced37c9e790ed0


[ROCm/roctracer commit: c0cbcdff1d]
2022-05-24 15:52:31 -07:00
Laurent Morichetti 0bb77aa022 Fix CMakeLists.txt conventions
Fix indentation, quoting, and white spaces.

Change-Id: I5e5e95b961e83e5957bdd137ef9893615396bb53


[ROCm/roctracer commit: 13fe79ab09]
2022-05-20 12:31:25 -07:00
Laurent Morichetti 7e11a61f6f File reorganization
Move the tracer_tool from the 'test' directory to the 'src' directory.

Change-Id: I13768b9610cd359f78a66147f0255ab1e4c657e9


[ROCm/roctracer commit: b34e9c2ee4]
2022-05-20 10:36:38 -07:00
Laurent Morichetti 4fddfcc5c5 Optimize rotcx markers
Improve the roctx markers performance when the tracer is not engaged
(the application is not running with rocprof).

The performance of roctx push/pop, measured with:

-----------------------------------------------------------------------
  auto start = std::chrono::steady_clock::now();
  for (int i = 0; i < 10000000; ++i) {
    roctxRangePush ("A");
    roctxRangePop ();
  }
  auto end = std::chrono::steady_clock::now();
  std::cout << "ns = " << std::chrono::nanoseconds(end - start).count()
      / 10000000 << std::endl;
-----------------------------------------------------------------------

w/o rocprof | with rocprof | commit
       92ns |       770ns  | 0d6e132: Cleanup CallbackTable::Get
       28ns |       712ns  | 6421bd5: Cleanup ROCTX's implementation
       20ns |       664ns  | 7f0e5e5: Remove the roctx range message...
        6ns |       665ns  | this commit

Change-Id: Id679dcbd0fb190a3179be98a9b2c1db151efee3d


[ROCm/roctracer commit: a794247c55]
2022-05-10 12:08:06 -07:00
Laurent Morichetti e309f4c5df Cleanup CallbackTable::Get
Make CallbackTable::Get return the callback_function/user_arg pair
as an actual return value instead of returning it through arguments
pointers.

Change-Id: Ia2dfcdad8c237a09620518ad67af94add47220da


[ROCm/roctracer commit: 4aeb76f7a8]
2022-05-10 08:13:18 -07:00
Laurent Morichetti 45deedf43a Make roctracer_cb_table.h a private header
Move roctracer_cb_table.h to the src/core directory, as it should not
be exposed as a public header, and rename it callback_table.h

Change-Id: Ib448cbd32a275df0268d53bd8d1da0bdc9201470


[ROCm/roctracer commit: cd62d841fa]
2022-04-20 19:47:43 -07:00
Laurent Morichetti 80c01a27c0 Fix copyright headers
Change-Id: I380d867fa5fb04e68b5b332e9abf33fbeb1e9418


[ROCm/roctracer commit: 06a3da7c63]
2022-04-19 09:30:45 -07:00
Rachida Kebichi d78eaf664f SWDEV-255637 support for hsa_amd_memory_async_copy_rect
Change-Id: I5db6484c30427712c56b59862e748118a3f079c2


[ROCm/roctracer commit: 06271806d4]
2021-03-31 10:02:06 -04:00
Evgeny f1458a97fb calling python3 explictely
Change-Id: I3dda55865bafa41cc6670e414b213f13a2a2a7ac


[ROCm/roctracer commit: bb5f2231a1]
2020-12-16 14:29:12 -05:00
Rachida Kebichi 4b6d702a39 SWDEV-255938 NEW - added regex and depth support to ostream ops
Change-Id: I292255adab3a70fa00a1dd5685b788521687f35b


[ROCm/roctracer commit: ef36218286]
2020-11-18 16:48:50 -05:00
Evgeny a547e615e3 build normalizing - generating under build directory
Change-Id: Id9203aec7800024bd749059a415fb29b8051005a


[ROCm/roctracer commit: ed1f1b66ac]
2020-09-07 15:24:58 -05:00
Rachida Kebichi 127ae39c5a Added hsa ostream ops generation
Change-Id: Icc68e136d22b05b35d6adaff56e090272633d760


[ROCm/roctracer commit: bac4bae41c]
2020-07-29 10:41:32 -04:00
Evgeny e6a61fc63e enable tool reloading
[ROCm/roctracer commit: 1be273a1b4]
2020-03-14 00:13:22 -05:00
Evgeny acb2bcc0fe PC sampling initial bringup
[ROCm/roctracer commit: 8b63135ced]
2020-02-28 14:01:40 -06:00
Evgeny a19f02263e normalizing C API: HSA domain
[ROCm/roctracer commit: b82a21056e]
2019-12-30 20:09:41 -06:00
Evgeny 5f9e74caca unloading and flush fix
[ROCm/roctracer commit: 4dfd1bb692]
2019-08-19 23:18:07 -05:00
Evgeny 0321409269 strdup isa_from_name:name
[ROCm/roctracer commit: de7076b7b8]
2019-07-16 02:13:00 -05:00
Evgeny 4047175972 disabling hsa_shut_down intercepting
[ROCm/roctracer commit: e08789a78d]
2019-01-30 22:06:07 -06:00
Evgeny be1f38cf2a tool xml input
[ROCm/roctracer commit: a530e509fe]
2019-01-17 22:39:53 -06:00
Evgeny d95635dce0 trace HSA API args
[ROCm/roctracer commit: cb8334f4d5]
2018-12-03 08:29:29 -06:00
Evgeny 6d9d1ccb24 HSA API callbacks and hsa test
[ROCm/roctracer commit: 8f4cece27e]
2018-11-28 12:36:11 -06:00