Gráfico de commits

101 Commits

Autor SHA1 Mensaje Fecha
Ammar ELWazir 1db8cdf99a Adding backward compatability
Adding roctracer_hcc.h for backward compatability to enable multiple components using it as tensorflow

Change-Id: Idfcdda9207277866e629e7bb9bfc0da835481217
2022-05-13 09:35:28 -05:00
Laurent Morichetti 3d0198c395 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
2022-05-10 12:08:06 -07:00
Laurent Morichetti 713db1fce5 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
2022-05-10 12:08:06 -07:00
Laurent Morichetti f8462b8637 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
2022-05-10 08:13:09 -07:00
Laurent Morichetti 61f35b0204 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
2022-05-03 21:56:28 -04:00
Tony Tye 1f630a9291 Add doxygen to roctracer.h
Change-Id: Ie542399e990e02482ed740d99c6afe4b95b1f6f4
2022-04-30 00:33:05 +00:00
Laurent Morichetti 18f60efe05 Fix typos/spelling errors
Change-Id: Idec1cb8fab91c30f99563bc7dd4db1faeb2db954
2022-04-26 12:39:38 -07:00
Laurent Morichetti 85552ea3a0 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
2022-04-22 11:22:07 -07:00
Laurent Morichetti d3b166cf01 Remove roctracer_hcc.h
roctracer_hip.h now contains the definitions for the HCC_OPS domain.

Change-Id: I132c993110254050aaa68828f3ca80f368ad24bc
2022-04-20 22:00:59 -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 15ab5d9cda Run clang-format on all source files
Change-Id: Ifb52ca306286b6b2d473821bed9db28e9f616d50
2022-04-20 22:45:54 -04:00
Laurent Morichetti 06a3da7c63 Fix copyright headers
Change-Id: I380d867fa5fb04e68b5b332e9abf33fbeb1e9418
2022-04-19 09:30:45 -07:00
Saravanan Solaiyappan bfea525ff3 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
2022-03-21 23:43:19 -04:00
Christophe Paquot e5e1258ef8 SWDEV-295205 - Remove KFD domain from roctracer
Change-Id: I2771cf43aa115bb466531bf887f7cc75e187f2ef
2021-07-22 10:12:45 -07:00
Rachida Kebichi 6267df36e4 SWDEV-281008 replace hcc_detail by amd_detail
Change-Id: I180b18f9e1fae40c923d6210901f06cba14e8f13
2021-04-14 11:18:38 -04: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 29c63c5281 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
2020-10-09 08:36:12 -04:00
Evgeny 6567c48e98 codeobj tracing prof protocol
Change-Id: Ib49c8ee034fb7481b21f950490e10b350f2a1b79
2020-09-19 16:49:46 -05:00
Evgeny e9b8de644e Format ostream ops
Change-Id: I8c609b1ef82e02f3547541c2cc47dec3a4f1c7b3
2020-08-28 11:30:18 -05:00
Evgeny 2f608e067a incrementing API version because of HIP API changes
Change-Id: I19e42ca75d8050b44b1cdf70cac7dfdff1ab5d57
2020-08-15 03:25:57 -04:00
Rachida Kebichi d3406bdb7b Merge "Added roctxRangeStart and roctxRangeEnd" into amd-master 2020-08-12 10:32:29 -04:00
Rachida Kebichi da17a158f8 Added roctxRangeStart and roctxRangeEnd
Change-Id: Id7f81c5a7d7f231c8f0e2323d31c37c827687189

Added roctxRangeStart and roctxRangeEnd

Change-Id: Id7f81c5a7d7f231c8f0e2323d31c37c827687189
2020-08-11 17:28:03 -04:00
Rachida Kebichi bac4bae41c Added hsa ostream ops generation
Change-Id: Icc68e136d22b05b35d6adaff56e090272633d760
2020-07-29 10:41:32 -04:00
Evgeny 07479cf881 adding tracer flush/unload stage unloading
Change-Id: Id84774b2ce20b261a9a84d2ad802b76093a748d4
2020-06-02 05:10:02 -05:00
Evgeny da4b244887 renaming PCSAMPLE API as RESERVED1
Change-Id: I0f95e4be5b359dc36fc3542bf0e321094db78a79
2020-05-21 11:51:17 -05:00
Evgeny 074306d997 SWDEV-236864 : packaging of generated headers
Change-Id: Ifda69eecf3697f6b69c978b3c4c2ffe9835edeb8
2020-05-18 18:08:06 -05:00
Evgeny eebde5e82e increasing API version
Change-Id: I30c1b5b22d0bef8cf57e9703261e397f3d2fa77a
2020-05-12 12:45:18 -04: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
Evgeny 0cd31f8295 adding HIP_PROF_HIP_API_STRING macro 2020-04-14 13:12:52 -05:00
Evgeny fc79e36928 adding ROCP_WITH_HIP_API_STRING macro 2020-04-10 12:52:51 -05:00
Evgeny a46c6984a2 using hipApiString() if defined 2020-04-10 01:15:20 -05:00
Evgeny c1455827b7 activity entry struct fix 2020-03-07 20:35:24 -06:00
Evgeny d2243ef1ec pc sampling integration fix 2020-03-07 19:09:54 -06:00
Evgeny 8b63135ced PC sampling initial bringup 2020-02-28 14:01:40 -06:00
Evgeny f214221bb2 control of trace buffer thread start 2020-01-27 14:31:24 -06:00
Evgeny abe07f7b4d fixing link errors 2020-01-13 12:19:04 -06:00
Evgeny f8e0039f39 cosmetic change 2020-01-13 12:09:33 -06:00
Evgeny b2d124d2be adding API specification 2019-12-31 07:05:32 -06:00
Evgeny b82a21056e normalizing C API: HSA domain 2019-12-30 20:09:41 -06:00
Evgeny 077f8ec6b6 normalizing C API 2019-12-29 03:06:11 -06:00
Wen-Heng (Jack) Chung b7aa8fedb7 Introduce a new API roctracer_get_timestamp().
roctracer_status_t roctracer_get_timestamp(uint64_t* timestamp);

Get system timestamp for roctracer clients.

The API could be used to help roctracer clients understand the reference frame
of timestamps when receiving activity callbacks, as the nanoseconds reported in
the activity callbacks are not in the same reference frame as CPU walltime
clock.
2019-12-19 18:05:33 +00:00
eshcherb fb0140ec66 Merge pull request #25 from whchung/revise-if
Revise the return type of roctracer_next_record to roctracer_status_t.
2019-11-20 20:21:41 -06:00
eshcherb 2bcf1c5554 Merge branch 'amd-master' into rkebichi-patch-kfd-1 2019-11-11 19:05:50 -06:00
Wen-Heng (Jack) Chung f730fb6a4e Revise the return type of roctracer_next_record to roctracer_status_t. 2019-11-06 10:54:45 -06:00
rkebichi 1a62e18593 Update roctracer_kfd.h 2019-10-31 10:48:42 -04:00
rkebichi 0aa6df2b52 Update roctracer_kfd.h 2019-10-30 17:26:57 -04:00
rkebichi b9e7638ef9 Update roctracer_kfd.h 2019-10-30 17:16:54 -04:00
rkebichi 5ae9aa1492 Update roctracer_kfd.h 2019-10-22 15:18:45 -04:00
Evgeny 72a2571b22 hip-vdi support 2019-10-21 23:03:20 -05:00
Evgeny 57051220a1 roctx/start/stop interaction 2019-10-21 21:18:54 -05:00