123 Incheckningar

Upphovsman SHA1 Meddelande Datum
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
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 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 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 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 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
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
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 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
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
Laurent Morichetti 9ce94f467e Fix warnings due to deprecated include path
In file included from roctracer/src/roctracer/tracker.h:24,
                 from roctracer/src/roctracer/roctracer.cpp:44:
/opt/rocm/hsa/include/hsa/amd_hsa_signal.h:26:246: note: ‘#pragma message: amd_hsa_signal.h has moved to ...’
   26 | ssage("amd_hsa_signal.h has moved to ...")
      |                                          ^

Change-Id: I38d151d836688083a4fdb0e86a04fc40923a369f


[ROCm/roctracer commit: 44dbb56fce]
2022-06-18 13:50:33 -07:00
Laurent Morichetti c3e991dfb1 Remove EvtStats from the tracer_tool
The same information can be generated from the hcc_ops_trace.txt file,
so in a later commit, will add a stage to the tblextr.py script to
generate the .csv files when ROCP_STATS_OPT=1.

Change-Id: I3d1575e096bedf98c66068d9a4ca141421e5bb9d


[ROCm/roctracer commit: 836bab37d3]
2022-06-09 15:20:14 -07:00
Laurent Morichetti fbcb14fc09 Fix typos
Change-Id: I90df287a3b0f501a5dcb4b37a2bd3b9d5695f582


[ROCm/roctracer commit: 15f65a4d27]
2022-05-24 23:53:01 -04:00
Laurent Morichetti 338e3e1fab Fix ROCTX function attributes
Change-Id: I32ebbacba7df9059574c31831b13fb2a923fcc97


[ROCm/roctracer commit: 6d7a39ae7e]
2022-05-24 23:52:51 -04:00
Laurent Morichetti ef717b9a2a Add ROCtracer version information
Change-Id: I10b268790d2dc4f3a3ad8624b2f553da6f3ccc8e


[ROCm/roctracer commit: 1c450082af]
2022-05-24 23:52:29 -04:00
Laurent Morichetti 2603a49ce3 Remove internal functions from the ROCtracer API
The roctracer_load, roctracer_unload, and roctrace_flush_buf functions
are not part of the ROCtracer API, and should not be exposed in the API
header file, but keep the functions in the library for backward
compatibility.

Add src/roctracer/backward_compat.cpp to implement retired functions.

Add test/app/backward_compat_test.cpp to test that the retired functions
are still accessible in the latest roctracer library.

Change-Id: I4c94310a7bfccfeae9384dac5db18fc79b4c5b17


[ROCm/roctracer commit: 8ee9d859ed]
2022-05-24 15:52:29 -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 fdda233292 Document the ROCTX API
Change-Id: I63a04139d1640ea5d52f6143cf2e9bfc0614a894


[ROCm/roctracer commit: 7ebae10571]
2022-05-23 23:10:02 -04:00
Tony Tye 80e7494e72 Eliminate static inline in api
Change-Id: Ia25636ca4a7e4b6d763ef8d6003845e7d1df5f50


[ROCm/roctracer commit: c837bcad78]
2022-05-18 15:23:19 +00:00
Tony Tye 015ae464ec Improve pool error checking
Check if a default pool is defined when enabling activities.

Set default pool to undefined if it is deleted.

Disable activities associated with the pool when it is deleted.

Document restrictions on deleting pools.

Change-Id: Ide466b55cab12ca2dd67d9f26b578f421e45a376


[ROCm/roctracer commit: feb652e45d]
2022-05-18 15:23:19 +00:00
Ammar ELWazir 83de6a4714 Adding backward compatability
Adding roctracer_hcc.h for backward compatability to enable multiple components using it as tensorflow

Change-Id: Idfcdda9207277866e629e7bb9bfc0da835481217


[ROCm/roctracer commit: 1db8cdf99a]
2022-05-13 09:35:28 -05:00
Laurent Morichetti 9b78c65ce1 Remove the roctx range message stack
The range message stack is mirrored in case ranges are pushed or popped
while tracing is stopped (by the tracer tool?). When a stop event is
reported, the tracer tool emits RangePop events by unwinding the stack,
then when the start event is reported, it emits RangePush events again
by unwinding the stack. The issue is that the RangePush events should
be emitted in reverse order.

For example:

RangePush(M1); RangePush(M2); \
  TracerStop; RangePop; RangePop; \
...; \
  TracerStart; RangePush(M2); RangePush(M1); \ <- In the wrong order
RangePop; RangePop;

It could be fixed by reversing the stack in RangeStackIterate but is it
worth it? The roctx range markers are supposed to be unintrusive so that
they can be left in the application even when it isn't being traced.

Simplifying the roctx API and reducing its added latency by removing
the range message stack mirroring seems like the better choise.

TODO: A future change should make roctx events immune to tracer start
and tracer stop requests. Or simply remove roctracer_start/stop.

Change-Id: Ie4d76afb5ce8d263848dcf1b599af394db56ddab


[ROCm/roctracer commit: 3d0198c395]
2022-05-10 12:08:06 -07:00
Laurent Morichetti 4a04400f85 Cleanup ROCTX's implementation
Remove thread_data_init. The C++ standard guarantees that the thread
local variable is initialized before its first odr-use and destructed
when the thread exits. Use a global initializer to set the reference
from the message stack instance in the map.

Remove roctracer_error_string. This does not belong to this library.
ROCTX does not expose errors to the application. The only functions
returning errors are returning -1 (Push/Pop).

Remove memory leaks due to strdup on the ranges messages. The memory
for the messages is guaranteed to be valid for the duration of the
callback, and it is the application's responsibility to strdup the
strings if it needs to extend the message's lifetime.

Add a lock to the RegisterApiCallback implementation. Iterating the
message stack map must be synchronized as a new thread could be adding
a new value to the map.

Change-Id: Iaf5b07ebc9efe4061cb01327d4c7034888727816


[ROCm/roctracer commit: 713db1fce5]
2022-05-10 12:08:06 -07:00
Laurent Morichetti 19fbb76f1b Consolidate all sources of timestamps
System clock timestamps should only come from a single source:
util::timestamp_ns(). Externally, this function is exposed as
roctracer_get_timestamp() (used by the tracer tool).

Removed the now unused HSA Runtime Utilities which were never part
of the ROCtracer API.

Change-Id: I044b7f4da60fd8fdb771b0c877622a3143f0e815


[ROCm/roctracer commit: f8462b8637]
2022-05-10 08:13:09 -07:00
Laurent Morichetti 8502571ab7 Move trace_buffer.h to the tool directory
A trace buffer is used to efficiently store synchronous event records
so that they can be processed later, possibly in a different thread,
when the buffer is flushed. This helps reduce the latency added by
tracing API calls.

The API does not need to use trace buffers as synchronous events are
directly reported to the client with callbacks, and asynchronous events
(activities) are saved in memory pools.

The implentation of HSA asynchronous memory copy activities was using
a trace buffer shared with the tracer tool to write the records to a
file (async_copy_trace.txt), instead of using a memory pool and
reporting the activity to the client.

Removed the asynchronous memory copies trace buffer, and updated
hsa_async_copy_handler to use the pool specified when the activity
was enabled.

Updated the tracer tool to read HSA_OP_ID_COPY records out of the
default memory pool and write them to async_copy_trace.txt.

Move trace_buffer.h to test/tool as tracer_tool.cpp is now the only
file using it.

Change-Id: Ida95aba2eaf3c3f2a979ed6c2b060374017b7424


[ROCm/roctracer commit: 61f35b0204]
2022-05-03 21:56:28 -04:00
Tony Tye dd82162466 Add doxygen to roctracer.h
Change-Id: Ie542399e990e02482ed740d99c6afe4b95b1f6f4


[ROCm/roctracer commit: 1f630a9291]
2022-04-30 00:33:05 +00:00
Laurent Morichetti 6d8edf929f Fix typos/spelling errors
Change-Id: Idec1cb8fab91c30f99563bc7dd4db1faeb2db954


[ROCm/roctracer commit: 18f60efe05]
2022-04-26 12:39:38 -07:00
Laurent Morichetti 14f1d48482 Move the HccLoader activities into the HipLoader
The HCC runtime is no longer used, so move all the remaining
activities in the HipApi loader and remove the HccLoader.

Change-Id: I845c04ca275a474526840315bae0ad1a4ce02257


[ROCm/roctracer commit: 85552ea3a0]
2022-04-22 11:22:07 -07:00
Laurent Morichetti 83cf22a698 Remove roctracer_hcc.h
roctracer_hip.h now contains the definitions for the HCC_OPS domain.

Change-Id: I132c993110254050aaa68828f3ca80f368ad24bc


[ROCm/roctracer commit: d3b166cf01]
2022-04-20 22:00:59 -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 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
Saravanan Solaiyappan 127ab7646d roctracer: Consider apt upgrade operation check in package scripts.
Include the upgrade operation check in the prerm script
in package.

Signed-off-by: Saravanan Solaiyappan <saravanan.solaiyappan@amd.com>
Change-Id: I1504ce96a27d21d9c3d9bafc0dea8055398adc99


[ROCm/roctracer commit: bfea525ff3]
2022-03-21 23:43:19 -04:00
Christophe Paquot a9f6522a41 SWDEV-295205 - Remove KFD domain from roctracer
Change-Id: I2771cf43aa115bb466531bf887f7cc75e187f2ef


[ROCm/roctracer commit: e5e1258ef8]
2021-07-22 10:12:45 -07:00
Rachida Kebichi a5571976e5 SWDEV-281008 replace hcc_detail by amd_detail
Change-Id: I180b18f9e1fae40c923d6210901f06cba14e8f13


[ROCm/roctracer commit: 6267df36e4]
2021-04-14 11:18:38 -04: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 85e5cf8a93 SWDEV-213367 : codeobj event implementation
Change-Id: Ibcaca6869ce96d8802c5fa8ba241f43834d6f2a7

update - codeobj event implementation

Change-Id: I4c12f26a19f2b31d9ac2211c3426a0e587a332b3

update2 - codeobj event implementation

Change-Id: Ic877549a83542ae00352503471d881e847ebac9c

test - codeobj event implementation

Change-Id: I0618d3a93de94c3d7467372ba4a3d4ea5520bfc7

URI reference test - codeobj event implementation

Change-Id: I6cf7e8a648cf012cb0708058b118a75e58f992b9

adding test/app - codeobj event implementation

Change-Id: Idf4c197c7b9116ccde5ec50ff47a26a858bfab32

uri test fix - codeobj event implementation

Change-Id: I7c385f82f516d9d8f2cd726366f00be3664006e3

uri test cleanup - codeobj event implementation

Change-Id: I542d5baf88c048c8b4717af843b803cd93e8f3bc

URI buffer fix - codeobj event implementation

Change-Id: Iac65e04c03a0939935c10f53c6b580a2e33878f5

HSA events tests trace-check disabled

Change-Id: I0f4d13aeeceb1d1a6e2191673eacbf9c7ae2ae52


[ROCm/roctracer commit: 29c63c5281]
2020-10-09 08:36:12 -04:00
Evgeny f7549dfde3 codeobj tracing prof protocol
Change-Id: Ib49c8ee034fb7481b21f950490e10b350f2a1b79


[ROCm/roctracer commit: 6567c48e98]
2020-09-19 16:49:46 -05:00
Evgeny 1b73058fb7 Format ostream ops
Change-Id: I8c609b1ef82e02f3547541c2cc47dec3a4f1c7b3


[ROCm/roctracer commit: e9b8de644e]
2020-08-28 11:30:18 -05:00
Evgeny a098665435 incrementing API version because of HIP API changes
Change-Id: I19e42ca75d8050b44b1cdf70cac7dfdff1ab5d57


[ROCm/roctracer commit: 2f608e067a]
2020-08-15 03:25:57 -04:00
Rachida Kebichi 13e1208711 Merge "Added roctxRangeStart and roctxRangeEnd" into amd-master
[ROCm/roctracer commit: d3406bdb7b]
2020-08-12 10:32:29 -04:00
Rachida Kebichi 86954dba1f Added roctxRangeStart and roctxRangeEnd
Change-Id: Id7f81c5a7d7f231c8f0e2323d31c37c827687189

Added roctxRangeStart and roctxRangeEnd

Change-Id: Id7f81c5a7d7f231c8f0e2323d31c37c827687189


[ROCm/roctracer commit: da17a158f8]
2020-08-11 17:28:03 -04: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 edeec18db9 adding tracer flush/unload stage unloading
Change-Id: Id84774b2ce20b261a9a84d2ad802b76093a748d4


[ROCm/roctracer commit: 07479cf881]
2020-06-02 05:10:02 -05:00
Evgeny 755333d0b8 renaming PCSAMPLE API as RESERVED1
Change-Id: I0f95e4be5b359dc36fc3542bf0e321094db78a79


[ROCm/roctracer commit: da4b244887]
2020-05-21 11:51:17 -05:00
Evgeny 7c98010b44 SWDEV-236864 : packaging of generated headers
Change-Id: Ifda69eecf3697f6b69c978b3c4c2ffe9835edeb8


[ROCm/roctracer commit: 074306d997]
2020-05-18 18:08:06 -05:00
Evgeny 6bc043077d increasing API version
Change-Id: I30c1b5b22d0bef8cf57e9703261e397f3d2fa77a


[ROCm/roctracer commit: eebde5e82e]
2020-05-12 12:45:18 -04:00
Rachida Kebichi 99b6e667cf Added generation of hip ostream operators
Change-Id: I5d07ea07cdd94097cb44619c29d9deba54e5d6a5

ostream ops code cleanup

Change-Id: Ia4e287de1e1953f5d323a0066c29aa6056442139


[ROCm/roctracer commit: 72b0d25ea4]
2020-05-01 16:15:01 -04:00