نمودار کامیت

595 کامیت‌ها

مولف SHA1 پیام تاریخ
Laurent Morichetti fdda233292 Document the ROCTX API
Change-Id: I63a04139d1640ea5d52f6143cf2e9bfc0614a894


[ROCm/roctracer commit: 7ebae10571]
2022-05-23 23:10:02 -04:00
Ammar ELWazir 575fba151d fixing the build scripts
1- fix the usage of the deleted cmake_modules in build scripts
2- Remove the unused HIP_VDI

Change-Id: I7d8ea55b0722a746b192e090b76c71977d65f130


[ROCm/roctracer commit: 7a47505744]
2022-05-21 16:14:09 -04:00
Laurent Morichetti e2d5956703 Don't override the LD_LIBRARY_PATH if IS_CI=1
The tests should be using the newly built libraries in the cwd.

Change-Id: I993e74a6cdbfdc78cf226f3fa5e4b55555f27825


[ROCm/roctracer commit: c74bb1fced]
2022-05-20 14:49:58 -07:00
Laurent Morichetti 6962fe66bf Rename _clang-format -> .clang-format
Change-Id: Ifde9ccded6d4c4bb4be714057710f4d7bbcc262d


[ROCm/roctracer commit: de3506e0f1]
2022-05-20 17:08:41 -04:00
Laurent Morichetti 0bb77aa022 Fix CMakeLists.txt conventions
Fix indentation, quoting, and white spaces.

Change-Id: I5e5e95b961e83e5957bdd137ef9893615396bb53


[ROCm/roctracer commit: 13fe79ab09]
2022-05-20 12:31:25 -07:00
Laurent Morichetti e9a6364519 Replace the HSA standalone test
Change-Id: I89e6826eef412890185ec600cd806c7b516e62a9


[ROCm/roctracer commit: c66fc25741]
2022-05-20 10:36:38 -07: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 4cecd8b69d Add symbol versioning
Add symbol versioning to the roctracer64 and roctx64 library, and only
expose the OnLoad and OnUnload tracer_tool symbols.

Change-Id: I7f160fc3e568567fd1146ff5b9c0aef3bdcccf53


[ROCm/roctracer commit: 0377c5a191]
2022-05-20 10:36:38 -07:00
Laurent Morichetti 8b439bd2fa Enable the trace buffer directed test
Change-Id: Icddecf488f99c99434c7c690a9cb47d2d0ccbee6


[ROCm/roctracer commit: d42d7e7543]
2022-05-20 10:36:38 -07:00
Laurent Morichetti edfb1cbc44 CMakeLists.txt cleanup
Add custom_commands to generate the HSA code objects
Remove the configure time file generation and add custom commands to
generate them at build time.

Change-Id: I167dd9befc6c73f32224935eaab74510922b26f4


[ROCm/roctracer commit: 3773384af8]
2022-05-20 10:36:38 -07:00
Ammar ELWazir 0b9de5c48a fixing trace period test for gfx1031
The test was too fast and couldn't trace all the functions

Change-Id: I3e278f6af084a27490a354e7e409eb19e69a63e7


[ROCm/roctracer commit: edbd011bae]
2022-05-20 05:03:35 -04:00
Ammar ELWazir cf1336ba91 Checking for missing python packages
Reporting error in CMake if CppHeaderParser and argparse are not installed in the system

Change-Id: I7617f662bc061fde45ce9f72c08d80a5108766d9


[ROCm/roctracer commit: b88bbe155f]
2022-05-20 01:34:48 -04:00
Laurent Morichetti 9a799bc26f Remove ld_config
ROCtracer does not rely on the ld.so search path to load the tracer
tool library.

Change-Id: I19f69add4777c8c1b274db61906d4497997171ff


[ROCm/roctracer commit: c74b1fa8ff]
2022-05-18 16:17:05 -07:00
Laurent Morichetti 7a1369a099 Remove CMAKE_VERBOSE_MAKEFILE
This should be enabled at the command line during the cmake configure
step (-DCMAKE_VERBOSE_MAKEFILE=True).

Verbose output can also be enabled during the build by setting the
VERBOSE=1 GNU make variable, or using the -v Ninja option.

Change-Id: Ie842c900c83c8f9f1c3ab4119e3bbc7931d371f5


[ROCm/roctracer commit: 2b3dc8f20b]
2022-05-18 16:13:14 -07:00
Laurent Morichetti dc2107a433 Revert "Removing Backward compatability"
This reverts commit 3df8bc7c77.

Change-Id: I844bd5cb8d0cd6968f7a3a1913df6ca4adcfb125


[ROCm/roctracer commit: f906f53b20]
2022-05-18 19:06:16 -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 6b7415dc89 Fixing the issue with HSA Traces having core dumps
Global destructor issue, using atexit to run tool_unload once at the exit of the tracer tool.

Change-Id: I276f6d240cd312ba1eacaf52c38ef8fd1f607268


[ROCm/roctracer commit: ae1091d816]
2022-05-17 17:44:11 -05:00
Ammar ELWazir b2ce76f487 Adding requirements to Roctracer
Change-Id: If4e9879fd9c7d8b781b366a5728a9df98648b407


[ROCm/roctracer commit: e2e72c9047]
2022-05-16 13:30:49 -05: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
Ammar ELWazir fd9d6fb95d Trace Period Optimization
Optimizing trace period to use std::threads as well as std::chrono sleep instead of sleep and usleep and catching up corner cases for ending before the trace period duration and some cosmetic clean up

Change-Id: Ia99f346bf71a3faad5dfdfc8d7a08f6c2b2cc0b9


[ROCm/roctracer commit: 1f9efecd4a]
2022-05-13 00:11:02 -05:00
Laurent Morichetti fc397530cf run.sh: In case of error, also print the stderr log
Change-Id: I9a20bf2d755749b036788d7e2fce044a7f36eb2e


[ROCm/roctracer commit: e1fa2cb5d5]
2022-05-12 20:16:09 -04:00
Laurent Morichetti 8247d2ca18 Cleanup roctracer.cpp
Minor cosmetic changes.

Change-Id: Ie5a904c757aa933d83ca6e496726e47fe7032620


[ROCm/roctracer commit: 37ab921f02]
2022-05-12 20:15:54 -04:00
Laurent Morichetti 1eef82000d Fix an intermittent failure in "tool flushing test"
The test (MatrixTranspose) and the tracer tool both write to stdout
which sometime causes a trace corruption.

Change the test to emit info messages to stderr instead of stdout,
leaving stdout for the tracer tool's exclusive use.

Change-Id: I18047dbcd9039b70dd24ef6e7e8e9d89b40bedd2


[ROCm/roctracer commit: bbe1db3810]
2022-05-12 20:15:37 -04:00
Ammar ELWazir 10d27fb4a7 Removing missed backward compatability files
Change-Id: I4fdc69d508063e4ee3abdfa2d65ad5d3d64e68ca


[ROCm/roctracer commit: 24f8a50b20]
2022-05-12 10:03:17 -05:00
Ammar ELWazir 5a7a35bcc1 Fixing cmake_modules
Removing unused definitions and compile options
Using cmake variables to set the options needed
Changing the visibility to make it specific for the targets

Change-Id: I80cf0997cd28897d5a06a58c7225ba40dfc51e2d


[ROCm/roctracer commit: 2f5313a0c7]
2022-05-11 19:25:43 -04:00
Ammar Elwazir a2a83101da Merge "Flush function fix" into amd-staging
[ROCm/roctracer commit: 3882091c71]
2022-05-11 19:13:43 -04:00
Ammar ELWazir 407a31a78e Flush function fix
Using std::thread instead of pthreads and also atomic_bool to identify the end of the flush function so that the unload_tool can wait for it

Change-Id: Iea00d7e16c65d51db2d222e8b42f03f9caeb2067


[ROCm/roctracer commit: 80464525c7]
2022-05-11 17:20:39 -04:00
Ammar ELWazir 3df8bc7c77 Removing Backward compatability
removing the backward compatability file and making sure to use the right paths

Change-Id: I518d52c82e0c5878bd334713e7b1758bba79762d


[ROCm/roctracer commit: 6b16d37d65]
2022-05-11 14:43:35 -04:00
Ammar ELWazir 392e15598d Changing Installation docs
using build.sh rather than cmake in the readme

Change-Id: If3b80641497c0c967ec3340cb9ef546bf44824c3


[ROCm/roctracer commit: ed0e1f5cb8]
2022-05-11 01:31:52 -04:00
Ammar ELWazir dfe33f2c15 Changing the set CMAKE_CXX_FLAGS set for fPIC to known cmake ideal way
Change-Id: I898de3d05feffee2d7d37cf62ac33afe2ecde85a


[ROCm/roctracer commit: 7060b76927]
2022-05-10 22:38:13 -05:00
Laurent Morichetti 12623a5f24 Fix the roctracer tests
14/15 tests pass, 1/15 intermittent failure (tool flushing test).

Change-Id: I36ed2900a1c51e584718993badeaefd48ad450a2


[ROCm/roctracer commit: a98476fe11]
2022-05-10 14:58:08 -07:00
Laurent Morichetti 196af97ad6 Disallow copying or moving trace buffers
Change-Id: I104b8240a76c6d96ae176b0b26bdc2e4e5e3c180


[ROCm/roctracer commit: 3f402eb6e9]
2022-05-10 12:08:06 -07:00
Laurent Morichetti 9294225192 Fix memory leaks in roctracer
Each thread has a thread-local record_pair_stack. The stack is
dynamically allocated on first use, but is not detroyed when the
thread exits.

Replaced record_pair_stack pointers with record_pair_stack instances,
the intances are constructed on first odr-use, and destructed when the
thread exits.

Also, converted the cb_journal and act_journal to instances.

Change-Id: I186ac29da477f194880a1ab599f4be5715a23063


[ROCm/roctracer commit: 67481bd295]
2022-05-10 12:08:06 -07:00
Laurent Morichetti 4fddfcc5c5 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


[ROCm/roctracer commit: a794247c55]
2022-05-10 12:08:06 -07: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 bac7f1c162 Merge "Cleanup CallbackTable::Get" into amd-staging
[ROCm/roctracer commit: 6e4055503c]
2022-05-10 14:55:20 -04:00
Laurent Morichetti 08289f356a Merge "Remove unused open_output_file/close_output_file" into amd-staging
[ROCm/roctracer commit: e8909158b3]
2022-05-10 14:55:10 -04:00
Laurent Morichetti fb3cf218c9 Merge "Fix a hang in './test/hsa/ctrl ctrl_hsa_input_trace'" into amd-staging
[ROCm/roctracer commit: 9cecf30131]
2022-05-10 14:54:11 -04:00
Laurent Morichetti 8b98f245ad Merge "Remove now unused hsa_rsrc_factory" into amd-staging
[ROCm/roctracer commit: fe0adfd37b]
2022-05-10 14:54:01 -04:00
Laurent Morichetti 4e9c35c929 Merge "Consolidate all sources of timestamps" into amd-staging
[ROCm/roctracer commit: 7c4f7625b1]
2022-05-10 14:53:36 -04:00
Laurent Morichetti e309f4c5df 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


[ROCm/roctracer commit: 4aeb76f7a8]
2022-05-10 08:13:18 -07:00
Laurent Morichetti df767311e3 Remove unused open_output_file/close_output_file
Change-Id: I0e5118b814617cb605949c99e5f0dc235f6edac0


[ROCm/roctracer commit: cb040b7def]
2022-05-10 08:13:18 -07:00
Laurent Morichetti 63ead69012 Fix a hang in './test/hsa/ctrl ctrl_hsa_input_trace'
At the end of the test, the tracer tool is unloaded and the active
memory pools are flushed. In the flush callback, to get the activity
operation string, the RocpLoader instance is neeeded, and if the
RocpLoader is not already loaded, it attempts to dlopen the rocprofiler
library.

Calling dlopen from a global destructor hangs because the dynamic
loader lock is already owned (e.g. by dlclose).

To temporarily work around the issue, instanciate the RocpLoader when
the activities needing it are enabled.

Change-Id: I712c66d88c43694fe53a95d6a61d7b22abb75262


[ROCm/roctracer commit: 11887f596a]
2022-05-10 08:13:18 -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 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
Ammar ELWazir f15a0ec2f0 Solving issue with using clang as the compiler
Change-Id: I4fa7b24af7008a30b0300b57ccbf1bc82dbfd66e


[ROCm/roctracer commit: 502ea835b9]
2022-05-09 17:41:33 -05: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