Граф коммитов

100 Коммитов

Автор SHA1 Сообщение Дата
Bhardwaj, Gopesh 074d9d95ec SWDEV-539836 Do not parse private/internal members (#56) 2025-06-27 20:47:30 +05:30
meserve-amd 9755c71cfc SWDEV-470344: Fix build time parsing of unions
- Fixes issue where types defined inside of a union were being skipped
  for ostream operator generation
- Also fixes issue where these types were not correctly defined in the
  resulting operators' parameters
- Fixes edge case where types with "union" in their name were being
  skipped as if they were union types

Change-Id: I717e56c1d0250eeae402bb83e39dec9990cff70d
2024-07-01 13:55:53 -05:00
Ammar ELWazir aa3c07c257 Fixing ROCTracer to match versioning changes in HIP Runtime
Change-Id: Ibde2419314824f12acb4cf51dc675cb14a51851c
2024-01-03 12:29:24 -06:00
Ammar ELWazir 2a9595bc8f SWDEV-340925 & ROCMOPS-4997: Fixing Tests package for roctracer
Change-Id: I9913e1df86398ef79a5afcf4b89b5a132d61422c
2023-06-08 14:48:28 +00:00
Kiumars Sabeti 397b3b10af SWDEV-360818: Reserved fields of hip structures are undefined. Because of that, reserved fields may contain special characters that are not readable by postprocessing Python script. To patch this issue, here we modify script that generates hip_ostream_ops.h to set reserved fields of hip structures to 0.
Change-Id: I0cda5cedfa30b140f121803dd8c066107ae0756e
2023-01-26 17:44:55 -05:00
Ranjith Ramakrishnan b1585c983d 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
2022-11-21 16:38:39 -08:00
Laurent Morichetti 0d6e5b1cea SWDEV-362165 - Escape strings in the API function's arguments
Also escape '\', '"', '\b', '\f', '\n', '\r' and '\t'.

Change-Id: I02cb1a0a511156661ff40700a81b0989a450aacc
2022-11-07 15:41:51 -08:00
Laurent Morichetti b556f8681e SWDEV-362165 - Escape strings in the API function's arguments
Strings ([const] char *, [const] char[]) passed as arguments to API
functions may not always contain printable characters. All string
arguments should be quoted and escaped in the trace logs.

Change-Id: Ie39058f2190048b1a0090df16d9ac6bc6507e28a
2022-10-15 19:03:36 -07:00
Laurent Morichetti 8a575d8d6e 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
2022-09-30 15:01:08 -07:00
Laurent Morichetti 6416434d3b 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
2022-09-30 13:36:48 -07:00
Laurent Morichetti 05ee3ff973 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
2022-09-13 08:23:40 -07:00
Laurent Morichetti 2673bf5e2c SWDEV-351980 - Consolidate registration tables in the roctracer
Change-Id: I44cd1cc81cf6a529aed89ee8db1377c0aa67f0dc
2022-09-08 20:58:05 -07:00
Laurent Morichetti c2b87b1fd7 Bring the HSA_EVT callbacks back to the roctracer
Change-Id: I26080b264d7989880ba7e9f00502cc680b2256d7
2022-09-06 19:38:12 -07:00
Laurent Morichetti ac3214d32a Use a global correlation_id for all records
Change-Id: I87fe16fefb52a95242bc64b7007b71c9d8978d44
2022-09-06 19:20:54 -07:00
Laurent Morichetti 05d3cf3529 Cleanup roctracer_hsa.h
Remove declarations that are not meant to be part of the public API.

Change-Id: I47d9e83bf41bdb2f7ac25a1507200b51c616049b
2022-07-27 02:16:15 -04:00
Laurent Morichetti e282a82e29 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
2022-07-27 02:15:43 -04:00
Ammar ELWazir c588c49743 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
2022-07-15 12:39:55 -04:00
Laurent Morichetti 96bcac0f47 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
2022-07-14 21:20:30 -04:00
Laurent Morichetti 3adc56bd9b 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
2022-07-05 17:03:21 -04:00
Sriraksha Nagaraj 4484718571 SWDEV-323976:Adding support to display correlation-ids in hsa-trace files
Change-Id: Ie01658c1f55624b4986542853a9a85a4ca40866d
2022-06-27 07:54:22 -04:00
Laurent Morichetti c0cbcdff1d 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
2022-05-24 15:52:31 -07:00
Laurent Morichetti 1e7783af58 Add a ROCTX test
Change-Id: I90dab2f349ade6cbfc86f0399c8b9ca905de23b3
2022-05-23 23:10:26 -04:00
Laurent Morichetti 13fe79ab09 Fix CMakeLists.txt conventions
Fix indentation, quoting, and white spaces.

Change-Id: I5e5e95b961e83e5957bdd137ef9893615396bb53
2022-05-20 12:31:25 -07:00
Laurent Morichetti b34e9c2ee4 File reorganization
Move the tracer_tool from the 'test' directory to the 'src' directory.

Change-Id: I13768b9610cd359f78a66147f0255ab1e4c657e9
2022-05-20 10:36:38 -07:00
Laurent Morichetti a794247c55 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
2022-05-10 12:08:06 -07:00
Laurent Morichetti 4aeb76f7a8 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
2022-05-10 08:13:18 -07:00
Laurent Morichetti cd62d841fa 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
2022-04-20 19:47:43 -07:00
Laurent Morichetti 06a3da7c63 Fix copyright headers
Change-Id: I380d867fa5fb04e68b5b332e9abf33fbeb1e9418
2022-04-19 09:30:45 -07:00
Christophe Paquot e5e1258ef8 SWDEV-295205 - Remove KFD domain from roctracer
Change-Id: I2771cf43aa115bb466531bf887f7cc75e187f2ef
2021-07-22 10:12:45 -07:00
Rachida Kebichi e5dd1e9b85 SWDEV-284863 Fixed several issues preventing memcpy info dump in csv
Change-Id: I4c6323311ce8314296e81a9b9b5d8adb485e0aa8
2021-05-25 11:10:52 -04:00
Rachida Kebichi faada3e569 SWDEV-283958 Workaround for unnamed structs
CppHeaderParser has limited support for unnamed structs. It leaves the
name empty so this results in classes (a.k.a structs) having trailing '::'
characters, also giving no way to distingush two unnamed structs at the
same level of nesting. An example are the inner structs of
hipExternalSemaphoreSignalParams. The workaround consists in skipping
over these, so they are not generated in the output header file
which lists all ostream ops<<. Only the inner unnamed structs are skipped,
the rest is processed as it should.

Change-Id: I17439c46095469b7adb7aee0b0f0b3d234aabc11
2021-05-07 15:57:30 -04:00
Rachida Kebichi 06271806d4 SWDEV-255637 support for hsa_amd_memory_async_copy_rect
Change-Id: I5db6484c30427712c56b59862e748118a3f079c2
2021-03-31 10:02:06 -04:00
Rachida Kebichi ad5b463912 SWDEV-271503 Fixed core dump
Change-Id: Ia582a27482581c3b81c42da0add9f6743898da6c
2021-03-30 14:06:56 -04:00
Evgeny bb5f2231a1 calling python3 explictely
Change-Id: I3dda55865bafa41cc6670e414b213f13a2a2a7ac
2020-12-16 14:29:12 -05:00
Rachida Kebichi ef36218286 SWDEV-255938 NEW - added regex and depth support to ostream ops
Change-Id: I292255adab3a70fa00a1dd5685b788521687f35b
2020-11-18 16:48:50 -05:00
Evgeny 9562675382 SWDEV-251491 : gen_ostream_ops.py porting to python3
Change-Id: I7081b6ad21b038040267067bd73d8a44df46e4ff
2020-10-01 00:52:23 -05:00
Rachida Kebichi 29da9a744d Fix for trace checker
Change-Id: Ib8a0df7b7bb0da2e68b5b4d99ce8025de169f317
2020-09-11 14:26:47 -04:00
Evgeny Shcherbakov 361f099847 Merge "build normalizing - generating under build directory" into amd-staging 2020-09-11 09:42:28 -04:00
Evgeny c9ed0f067d gen_ostream_ops.py fix - ostream operators as inline static
Change-Id: I9688236b06dd167960662b8eecf1a07c93b43fff
2020-09-09 01:46:23 -05:00
Evgeny ed1f1b66ac build normalizing - generating under build directory
Change-Id: Id9203aec7800024bd749059a415fb29b8051005a
2020-09-07 15:24:58 -05:00
Evgeny e9b8de644e Format ostream ops
Change-Id: I8c609b1ef82e02f3547541c2cc47dec3a4f1c7b3
2020-08-28 11:30:18 -05:00
Evgeny ac59f349d4 enabling hipIpcEventHandle_t
Change-Id: Iaf973567298d5ef8450e14e869b5f837e0620022
2020-08-03 13:04:05 -05:00
Evgeny Shcherbakov de338b02e6 Merge "Added hsa ostream ops generation" into amd-master 2020-07-30 11:24:32 -04:00
Rachida Kebichi bac4bae41c Added hsa ostream ops generation
Change-Id: Icc68e136d22b05b35d6adaff56e090272633d760
2020-07-29 10:41:32 -04:00
Rachida Kebichi 0502f196d9 more verbosity in trace diffs
Change-Id: I1e3f6c8ee126ca4470f0846aabab19d18397dd64
2020-07-29 03:00:16 -05:00
Evgeny 264e3d816d fixing ostreams linking as inline static
Change-Id: Idbfac3e5220acd62500cd4c204a5bd9a9461c8fc
2020-06-19 12:54:12 -05:00
Evgeny 9d4a58f6da disabling kernel name printing for kernel launches by func pointer and ostream operator template
Change-Id: Icbcedafb1812a1be03837f6cb47283eb0d382ad2
2020-05-27 05:23:29 -04:00
Rachida Kebichi 8cece61689 Added check trace with config.
Change-Id: I1c71793c4c6f512288e92f70105f428c3f8671c4
2020-05-19 09:47:19 -05:00
Evgeny 074306d997 SWDEV-236864 : packaging of generated headers
Change-Id: Ifda69eecf3697f6b69c978b3c4c2ffe9835edeb8
2020-05-18 18:08:06 -05:00
Rachida Kebichi 72b0d25ea4 Added generation of hip ostream operators
Change-Id: I5d07ea07cdd94097cb44619c29d9deba54e5d6a5

ostream ops code cleanup

Change-Id: Ia4e287de1e1953f5d323a0066c29aa6056442139
2020-05-01 16:15:01 -04:00