35 Commits

Autor SHA1 Nachricht Datum
Laurent Morichetti f262501ed3 Clean up logger.h
Change-Id: Ibcb58d2236b012d00c3fc421a425c03093de5d50


[ROCm/roctracer commit: bb98bc7d85]
2022-09-16 09:55:09 -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 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 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 23893311af Move exception.h to the roctracer
Only the roctracer API is using exceptions to return error codes to the
client application.

Change-Id: I92e5bd1a044dbde0c80dd9ef87e606550c3ff790


[ROCm/roctracer commit: 1e8e53da1d]
2022-05-24 23:52:07 -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
Tony Tye ae7e7e8b1b Improve error reporting and error codes
Make error codes more informative and have negative values. This is an
ABI break but it does not appear known tools are relying on the exact
error codes.

Use logging for all errors so that roctracer_error_string will be able
to return last error message.

Make internal errors fatal and abort.

Do not use the tracer API exceptions in the tracer tool.

Change-Id: Ie8ed3d50e5ad26625ac9d1263f7e048edb5584c0


[ROCm/roctracer commit: a4db4084db]
2022-05-24 15:32:56 -04: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 ef47516a88 Remove now unused hsa_rsrc_factory
Change-Id: I66175eb9fae2e7e61400af77a0c89be9c39e770e


[ROCm/roctracer commit: 4ced94b9a2]
2022-05-10 08:13:18 -07:00
Laurent Morichetti 6eb1d34cda Fix assertions
Replace EXC_ABORT() checks with assertions.

Rewrite the exception class to use std::runtime_error (as it
already handles the std::string/char* message argument).

Change-Id: I48e31924f3aea1328e6562ab6bb06ec373fd5d5e


[ROCm/roctracer commit: 5963363484]
2022-04-27 11:24:26 -07:00
Ammar ELWazir 9dd5a58e3e SWDEV-295522: Fixing Performance Issue
Removing DEBUG_TRACES and the unnecessary use of roctracer_op_string, made the MS app reporting 78 to 81 stable samples per second, depending on the type of the trace, while the main app without rocprof reports 100 to 106. More detailed numbers will be posted in the ticket.

Change-Id: Ifbc529278cea54dd23e6086aa9b9ea2df952d5dd


[ROCm/roctracer commit: e4569c41fe]
2022-04-22 18:51:49 -04:00
Laurent Morichetti 1aaed4c508 Remove HCC_EXC_RAISING and HIP_EXC_RAISING
HCC_EXC_RAISING and HIP_EXC_RAISING don't add much value, so to
simplify, only keep EXC_RAISING and EXC_ABORT.

Change-Id: Ifdc54981bb682fe68b418cdc95ecebe668e3dcf6


[ROCm/roctracer commit: 121a84b449]
2022-04-22 11:22:23 -07:00
Laurent Morichetti 2a2852048f Address review comments from previous commit
Change-Id: I6629dd911de0d7fd08d7a863c172ec73f35fa3d1


[ROCm/roctracer commit: dc22139977]
2022-04-20 22:46:15 -04:00
Laurent Morichetti 23528f51e0 Run clang-format on all source files
Change-Id: Ifb52ca306286b6b2d473821bed9db28e9f616d50


[ROCm/roctracer commit: 15ab5d9cda]
2022-04-20 22:45:54 -04:00
Laurent Morichetti 80c01a27c0 Fix copyright headers
Change-Id: I380d867fa5fb04e68b5b332e9abf33fbeb1e9418


[ROCm/roctracer commit: 06a3da7c63]
2022-04-19 09:30:45 -07:00
Rachida Kebichi 99ae6ad86a SWDEV-284863 Fixed several issues preventing memcpy info dump in csv
Change-Id: I4c6323311ce8314296e81a9b9b5d8adb485e0aa8


[ROCm/roctracer commit: e5dd1e9b85]
2021-05-25 11:10:52 -04:00
Laurent Morichetti 77c83db3ef Fix random bugs discovered while reading the code
In HsaTimer::correlated_pair_ns, the time ID should be used to
select the clock ID passed to clock_gettime.

In MemoryPool::allocator_default, pass the correct value to realloc.

Change-Id: I5d10c0994c07fdeadd99c81deba4e71a4f579523


[ROCm/roctracer commit: 297b613604]
2021-05-20 21:22:16 -04:00
Laurent Morichetti aa5937fbe1 Fix a compilation error with gcc-9.3.0
On Ubuntu 20.04, in Release mode, gcc fails with this error:

In file included from /usr/include/string.h:495,
                 from /opt/rocm/include/hsa/hsa_api_trace.h:57,
                 from ../roctracer/src/util/hsa_rsrc_factory.h:29,
                 from ../roctracer/src/util/hsa_rsrc_factory.cpp:25:
In function ‘char* strncpy(char*, const char*, size_t)’,
    inlined from ‘const util::AgentInfo* util::HsaRsrcFactory::AddAgentInfo(hsa_agent_t)’ at ../roctracer/src/util/hsa_rsrc_factory.cpp:323:12:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:106:34: error: ‘char* __builtin___strncpy_chk(char*, const char*, long unsigned int, long unsigned int)’ specified bound depends on the length of the source argument [-Werror=stringop-overflow=]
  106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
      |          ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../roctracer/src/util/hsa_rsrc_factory.cpp: In member function ‘const util::AgentInfo* util::HsaRsrcFactory::AddAgentInfo(hsa_agent_t)’:
../roctracer/src/util/hsa_rsrc_factory.cpp:322:39: note: length computed here
  322 |     const int gfxip_label_len = strlen(agent_info->name) - 2;
      |                                 ~~~~~~^~~~~~~~~~~~~~~~~~

The error is caused by the following 2 lines:

    const int gfxip_label_len = strlen(agent_info->name) - 2;
    strncpy(agent_info->gfxip, agent_info->name, gfxip_label_len);

The size argument to strncpy should not depend on the input string.

Since the terminating character is not considered (the copy is at
most len - 2 bytes), using memcpy is preferable. Also, make sure
the destination does not overflow by clamping the size.

Change-Id: I37c5c45418e7c31a017581b6c16e5d47cd61aec5


[ROCm/roctracer commit: 38009bfba4]
2021-04-19 22:57:51 -07:00
Evgeny 1eeb601150 fxing gfxip label
Change-Id: Ic22d828b38da8afc5a232c2f2eb5de5410844b70


[ROCm/roctracer commit: 2287da5e28]
2021-03-28 08:11:58 +00:00
Evgeny 76f7c9a5fd SWDEV-267198 : adding gpu index to hsa_handles file
Change-Id: I6ddba45ab31fff97a1f85f889c56693accf8f5bc


[ROCm/roctracer commit: 1c77416a6c]
2021-03-09 15:37:44 -06:00
Evgeny e6a0c8a665 Adding dumping of HSA handles
Change-Id: I18e2cfdf2574110bffa09d30c7ac1d3941252939


[ROCm/roctracer commit: 7d8fd0606d]
2020-12-01 16:45:33 -05:00
Evgeny 65928ee9d1 SWDEV-249924 : hip correlation id explicite propogation; tracer debug instrumentation;
Change-Id: Ibbc411541f5610ce739f3fc1efa1ab7f605220f5

initial commmit

Change-Id: I34b360be62c2083819dc5c3acc8268bd69f2f58a


[ROCm/roctracer commit: ef61a39603]
2020-10-06 13:25:51 -04:00
Evgeny d7c7cb0809 saving time for roctx records
[ROCm/roctracer commit: e9087dcd86]
2020-01-29 23:39:08 -06:00
Evgeny da6feb0220 hsa_rsrc_factory sync
[ROCm/roctracer commit: 05315465cf]
2020-01-29 22:39:22 -06:00
Evgeny d64b02c012 fixing clang error
[ROCm/roctracer commit: a8c5e2edce]
2019-10-02 15:29:09 -05:00
Evgeny 1e9061fe56 roctx marka implementation
[ROCm/roctracer commit: 231e25747f]
2019-08-30 08:53:34 -05:00
Evgeny 7a00dcb37e multiple changes update
[ROCm/roctracer commit: c1cca98a71]
2019-06-28 12:47:06 -05:00
Evgeny afe36cf4a0 explicitely resolving the types scope
[ROCm/roctracer commit: 429a660dce]
2019-04-26 11:50:34 -05:00
Evgeny fd5a64f310 instance creation fix
[ROCm/roctracer commit: 69a480a971]
2019-03-13 15:54:47 -05:00
Evgeny a60563fda1 async copy activity handling
[ROCm/roctracer commit: a996505c2e]
2019-01-22 03:55:03 -06:00
Evgeny b8d4223665 licensing annotation
[ROCm/roctracer commit: a27f63b110]
2018-08-08 15:47:30 -05:00
Evgeny 1a465687a1 adding prof-protocol layer
[ROCm/roctracer commit: c7f4758675]
2018-08-07 03:25:55 -05:00
Evgeny a5fa052876 betta version
[ROCm/roctracer commit: 5151f6ce04]
2018-05-25 01:56:25 -05:00
Evgeny 6afc93f4bf Initial commit
[ROCm/roctracer commit: 0a934cff68]
2018-05-10 13:19:10 -05:00