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

549 Коммитов

Автор SHA1 Сообщение Дата
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 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 efe7000e7b Remove unused ROCTX_CLOCK_TIME
Change-Id: I9696bb2892fe6fe21089462d624643b7a782fb71


[ROCm/roctracer commit: f46d1717cc]
2022-05-04 19:30:37 -04:00
Laurent Morichetti 2c4f347c0a Remove the tracer tool's dependency on hsa_rsrc_factory
hsa_rsrc_factory was only used to enumerate the agents types and pools.
The pools don't seem to be used by bin/mem_manager.py, so I only
ported the agent enumeration using hsa_iterate_agents.

Change-Id: Idd586aa13db303cf92962a6392771b7bf38b758f


[ROCm/roctracer commit: 6d6017249a]
2022-05-04 19:28:53 -04:00
Ammar ELWazir 5f2a988464 SWDEV-335490: Unused variables
Compilers doesn't see assert as a usage of the variables, I added [[maybe_unused]] to the variables that are used only in assert to make sure that the compiler is skipping them in the check. Note: [[maybe_unused]] is introduced in C++17

Change-Id: I96bb53cb2ab55ee7120681c2d279271c0075095d


[ROCm/roctracer commit: 78869032ad]
2022-05-04 11:24:28 -04:00
Ammar ELWazir e0aaaf4636 Removing HIP_API_PROF_STRING from the tracer_tool
The else part was not used as it was only using the hipApiString to format the data to string

Change-Id: I376721c478cffba0890436ca8895dfe2a7641570


[ROCm/roctracer commit: 5e012541c5]
2022-05-04 09:46:56 -04:00
Laurent Morichetti f1bce685df Fix race conditions in TraceBuffer
1) The Entry's state was published after making the record avaiable,
   so a thread flushing the records could see an unitialized record.
2) data_ and write_pointer_ could become out of sync. write_pointer_
   could be indexing into another buffer than what data_ was pointing
   to.
3) GetEntry could get a nullptr free_buffer_ because multiple threads
   could acquire the work_mutex_ before the work_thread_ could wake up,
   or between allocate_worker's loop iterations.

Change-Id: I6f0a015557888eeeaa75a8bce7fde8de276d11dd


[ROCm/roctracer commit: 046df32729]
2022-05-03 21:56:46 -04: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 3417afa07f Merge "Add doxygen to roctracer.h" into amd-staging
[ROCm/roctracer commit: 48f4c82685]
2022-05-03 20:00:10 -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 7746758ed7 Add a trace_buffer directed test
This test stresses the concurrent writing of trace buffer records while
frequently allocating new storage to hold the records.

Due to race conditions, this test fails with the current trace buffer
implementation.

Change-Id: I0b77c64005e776319bf21f1ee1e6d7c99ddccfff


[ROCm/roctracer commit: 200e27f12d]
2022-04-29 08:52:13 -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
Laurent Morichetti 576554dcea Fix a SEGV when running --roctx-trace
There's a typo in RegisterApiCallback, roctx::cb_table.Get should be
roctx::cb_table.Set.

Change-Id: I47ec8ac666f783ff4e03f35d13e375e645899900


[ROCm/roctracer commit: 0d7d56eea5]
2022-04-27 12:14:32 -04:00
Ranjith Ramakrishnan 140d2d4bc2 Merge "Populate roctracer.h wrapper file with orginal file contents as dead code" into amd-staging
[ROCm/roctracer commit: 7f05496a87]
2022-04-27 02:20:26 -04: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 159a56ffff Remove unused proxy utilities
The proxy queue implements packet interception to enable timestamps
collection. As it is, the roctracer is not intercepting packets, and
instead relies on the rocprofiler tool to collect the timestamps for
kernel dispatches.

This is an issue as the roctracer API does not implement HSA_OPS
activities for kernel dispatches. This will be addressed in a future
commit.

Change-Id: Ib6a778a513410bec4579f223a9d9e9fd9b6054df


[ROCm/roctracer commit: 6b06322578]
2022-04-26 15:26:26 -04:00
Laurent Morichetti 4a50f3b88f Fix the static library build
Building with -DLIBRARY_TYPE=STATIC fails with 3 undefined symbols.
Add weak symbols to satisfy the linker (mirror what is done for the
other Loader symbols).

Change-Id: I8a2878def21d5f500b0764ceacb4e5255e1111c5


[ROCm/roctracer commit: b352eedac6]
2022-04-26 15:26:10 -04:00
Ranjith Ramakrishnan 75fadc28dd Populate roctracer.h wrapper file with orginal file contents as dead code
Backward comaptibility for components that search for  contents in roctracer.h
Improvements: Removed redundant code for setting and unsetting variables
Added header template file in source code instead of generating it on build time

Change-Id: I96aeb7f2a6d53d45eb5aeb5300024cd22dad1324


[ROCm/roctracer commit: 8ca752ce2c]
2022-04-26 03:09:35 -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 0fd8cd7895 Allow MemoryPool::Write while Flushing
Before this change, when a producer was blocked by a flush operation,
no other producer could write to the memory pool.  This change allows
other producer threads to continue to write by releasing the producer
lock before waiting on the consumer condition variable.

Change-Id: Idc1c07173d2edb18fbe1a61961f10c02e7ca8c20


[ROCm/roctracer commit: dc8717a6b5]
2022-04-22 11:22:23 -07: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 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 33d8437801 Use ACTIVITY_DOMAIN_HIP_OPS instead of ACTIVITY_DOMAIN_HCC_OPS
Change-Id: I43fbac3d02011f74bf7b597519148ed0bd68ff98


[ROCm/roctracer commit: abf1b90017]
2022-04-20 22:00:59 -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 57304225d9 Remove hip_act_cb_tracker.h
It only defines one class (hip_act_cb_tracker_t) that is only used
by roctracer.cpp.

Change-Id: I375a25bd363770d70a7b3b713223484a498cc3d1


[ROCm/roctracer commit: c009df3327]
2022-04-20 19:48:24 -07:00
Laurent Morichetti f8cc0d58a8 Close the default pool on exit
Change-Id: I388ea4d4f06c1818312a72185ef55b615c730509


[ROCm/roctracer commit: a0fd1e7c4b]
2022-04-20 19:48:24 -07:00
Laurent Morichetti 3c18fb9f01 Simplify memory_pool.h
Use the standard concurrent support library (std::thread, std::mutex,
st::condition_variable) instead of pthread.

Fix a mismatched memory allocation/deallocation when a custom allocator
is provided. The MemoryPool destructor was always using the default
allocator (using malloc/realloc/free) even if the pool memory was
allocated with the custom allocator.

Fix various thread safety issues and inefficiencies (spin loops).

Change-Id: I97592caa947f63463041bf43e00af9ebb5ff5886


[ROCm/roctracer commit: 9d728f74a1]
2022-04-20 19:48:24 -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 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 b9bbce0017 Simplify journal.h
Simplify implementation of journal.h.

Change-Id: I9e2e93fd3cd3391fdf182249f5c4c5ef3debae03


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


[ROCm/roctracer commit: 06a3da7c63]
2022-04-19 09:30:45 -07:00
Laurent Morichetti ebf0985173 Switch roctracer to C++17
Change-Id: Ic8dee7dddaac2e7cca6e055f3c5f717f162f1eed


[ROCm/roctracer commit: 31365f3076]
2022-04-18 15:02:49 -07:00
Tony Tye 713a0c30c9 Update README.md
Improve formating and correct build directions.

Change-Id: I06b97e206e014c29c0c9f3b34dedd683448728f2


[ROCm/roctracer commit: b30b5b84e7]
2022-04-15 20:34:21 +00:00
Ammar Elwazir d69070a133 Revert "SWDEV-295522: Fixing Performance Issue"
This reverts commit 35ea06abd0.

Reason for revert: Merged by mistake

Change-Id: I8c39c823d92cc20a238ca6120dde4b2fa9121e85


[ROCm/roctracer commit: 57add1a6fa]
2022-04-07 06:55:34 -04:00
Ammar ELWazir 35ea06abd0 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: Ida25d3bfc72047afaa27326d697be76d97564334


[ROCm/roctracer commit: e7327aaac7]
2022-04-07 00:07:24 +00:00
Ammar ELWazir f1de3ae0e5 SWDEV-307394: Fixing Download HSA-Class Issue
Exchanging the git clone of the hsa-class to a local downloaded version pushed to the roctracer repo

Change-Id: Id45a38b2d355102c2e0dee1e4bfde50398369047


[ROCm/roctracer commit: 7ee4f87b73]
2022-03-29 22:27:25 +00: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
Saurabh Verma 553d8a0da3 Merge "SWDEV-295871: [MSRCHA-130] Unable to filter API using .txt or .xml -Part-2 of MSRCHA-128. Made xml input more robust to accept both spaces and commas in xml array." into amd-staging
[ROCm/roctracer commit: 43657de4d2]
2022-03-18 10:13:31 -04:00
Ammar ELWazir 1029cc418e SWDEV-328300: supporting centos-9 for roctracer
Changing pthread_yield() to sched_yield() as pthread_yield() is deprecated in CentOS 9

Change-Id: I2961b61374e36995d0835f0e65b26c35f5eb8715


[ROCm/roctracer commit: 43a36f8dd5]
2022-03-18 01:26:39 +00:00
Saurabh Verma e1f9f82198 SWDEV-295871: [MSRCHA-130] Unable to filter API using .txt or .xml -Part-2 of MSRCHA-128. Made xml input more robust to accept both spaces and commas in xml array.
Change-Id: I3900fdf91cd0b893fadd9dfc958030effc5663db


[ROCm/roctracer commit: 37ed31087a]
2022-03-17 17:16:17 -05:00
Saurabh Verma daa23130ad SWDEV-295871 : [MSRCHA-130] Unable to filter API using .txt or .xml - Part-2 of MSRCHA-128. Fixed constructor ordering issue of global variables hip_api_vec and hsa_api_vec by wrapping themin static getter functions
Change-Id: I2dae5e196118fcab696b2365b24281f05d9d0f88


[ROCm/roctracer commit: aee8102fa6]
2022-03-14 16:07:58 -04:00
Ammar ELWazir 5daf0bcd13 SWDEV-296010: Fixing RPATH & CMAKE files
Removing the RPATH skip & Removing the install path that was defined CMakelist

Change-Id: Icf374b9548fc7b24e99a1b5ab9720ce6d775abf8


[ROCm/roctracer commit: 8098ec6acf]
2022-03-09 19:16:08 -06:00
Ranjith Ramakrishnan 472330b728 File reorganization with backward compatibility
Package installed /opt/rocm
Soft links and wrapper header files installed /opt/rocm/roctracer for backward compatibility
tracer_tool library renamed to roctracer_tool and installed in /opt/rocm/lib/roctracer

Change-Id: Ica7518c5ef2e591715121cbc942b69dff29233d3


[ROCm/roctracer commit: bc19ae71eb]
2022-03-04 04:03:51 -08:00
Ranjith Ramakrishnan 9b1793bd39 Merge "SWDEV-291455: Prefer rocm include path to hip include path" into amd-staging
[ROCm/roctracer commit: c037ccb95e]
2022-02-15 14:43:32 -05:00
Ranjith Ramakrishnan a3c738ff30 SWDEV-291455: Prefer rocm include path to hip include path
Change-Id: I1fa96e72169fac689a3a2ed38e988d7f5d18bf04


[ROCm/roctracer commit: ebda880c4a]
2022-02-14 14:21:32 -08:00
Kiumars Sabeti 55299c1d75 SWDEV-322312 [ASAN] [roctracer] RPM packages are generated while building roctracer for UBUNTU
To fix the issue we modified CMakeLists.txt as described in Sparry Icarus comment

Change-Id: Ie9ca16cfcfb7b7a9a858f0fb1f5071923c787313


[ROCm/roctracer commit: 554011e767]
2022-02-11 19:21:17 +00:00
Kiumars Sabeti fa57056629 SWDEV-322312: RPM packages are generated while build roctracer for UBUNTU
replaced -DCPACK_GENERATOR=DEB

Change-Id: I9f6d4d652e7cad510343731948675f0cd4398ef4


[ROCm/roctracer commit: cec4cb2538]
2022-02-11 08:33:17 +00:00
kiumars f7c3908e62 replace the set of CMAKE_SHARED_LINKER_FLAGS with add_link_options.
Change-Id: I2696ccd53b234e700e1464b0b3852aac1e3fc3b3


[ROCm/roctracer commit: e56146ff7c]
2022-02-03 12:55:15 -05:00
Ammar ELWazir 4cca362f20 SWDEV-318551: Adding License file for tracer
Making the new License file, Adding support in the CMakeLists.txt

Change-Id: I43862b8b7f3025ae6200aeb442ea70c7993a7349


[ROCm/roctracer commit: b721e3209e]
2022-01-26 13:39:31 -05:00