Commit Graph

621 Commits

Author SHA1 Message Date
Laurent Morichetti f76ed5eb8e Add the roctracer-tests package
The roctracer-tests package contains all the roctracer test binaries
and scripts needed to run the testsuite outside of the build directory.

Change-Id: Id11f862fb4bdb2425d68f455074172c38814ec92


[ROCm/roctracer commit: 3adc56bd9b]
2022-07-05 17:03:21 -04:00
Laurent Morichetti b25a931ff4 Rename project ROCTRACER -> roctracer
Change-Id: I83d47025aad59dc37a53ec82452b639fc8ffb478


[ROCm/roctracer commit: 957084de07]
2022-07-02 22:05:25 -07:00
Ammar ELWazir 724a21efea SWDEV-307399: Updating CMAKE dependency on rocprofiler
activity.h and rocprofiler.h are already exposed in rocprofiler
through the rocm installation directory.

Change-Id: Ia383d3818fd51452390d2217d82503af4d91aac6


[ROCm/roctracer commit: ee1b7e056e]
2022-06-28 18:41:13 -04:00
Sriraksha Nagaraj 927d2f45c4 SWDEV-323976:Adding support to display correlation-ids in hsa-trace files
Change-Id: Ie01658c1f55624b4986542853a9a85a4ca40866d


[ROCm/roctracer commit: 4484718571]
2022-06-27 07:54:22 -04:00
Laurent Morichetti 46061428fa Use the new ROCR support to automatically load tool libraries
The ROCR now detects already loaded tool libraries and calls OnLoad/
OnUnload in the order specified with HSA_AMD_TOOL_ORDER.

It is no longer necessary to set the HSA_TOOLS_LIB environment variable
to load the roctracer API. The roctracer tool library should be
pre-loaded with LD_PRELOAD.

Change-Id: I6de1b1bd4f93caa08d3554aad2376d242c74fb7e


[ROCm/roctracer commit: d32cf96cd4]
2022-06-24 16:45:03 -07:00
Ammar ELWazir c723ecf12e Changing hcc to hip in hip activity file handle
Change-Id: If4207b72757775d31404768807fe1ad1204521f6


[ROCm/roctracer commit: 8c28237a2c]
2022-06-21 19:03:33 -04:00
Ammar ELWazir 7cce3923ac Enabling ROCP_STATS_OPT
Enabling the new methodology of ROCP_STATS_OPT of getting HIP activities while the application is running

Change-Id: I94b3311b0740db804643dba0e4f77c1f9de0319b


[ROCm/roctracer commit: 7cbee920b7]
2022-06-21 14:58:28 -05:00
Laurent Morichetti 67fb1f56b3 Enable tests validation in the CI environment
Change-Id: Ied3d203db35083f0045fae052d82ec5e1a867581


[ROCm/roctracer commit: fd1469a573]
2022-06-18 13:50:35 -07: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
Ranjith Ramakrishnan 7aca8b3f1a SWDEV-295886 - Replaced hard coded path /opt/rocm with ROCM_PATH
HIP cmake module path set to actual cmake file location

Change-Id: I7a3e6eec2b51d0e550e68496eecf268a01a2d015


[ROCm/roctracer commit: 0fa2808779]
2022-06-16 00:11:35 -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 4af9cdc409 Add a data region to the memory pool
Some records may need to point to data with the same lifetime as the
records themselves. One solution is to store the data at the end of
the memory pool buffer. Records in the buffer grow up, and the data
grows down. When the buffer is flushed both records and data are
recycled.

Change-Id: I278fa84478236bf895f7c2d152d47d4256987392


[ROCm/roctracer commit: ef3b2a8aa8]
2022-06-08 18:34:23 -04:00
Laurent Morichetti af5722a2ce Fix test errors
Check the HIP API calls status, and abort if != success.

Change-Id: Ifc38d8f28092ffdce1674a05a7886f7c0c97a885


[ROCm/roctracer commit: 4c6f249cc1]
2022-06-03 01:39:58 -04:00
Ammar ELWazir e8d53a31ee Adding missing commits
Adding commits found in mainline and not in staging

Change-Id: Ib146912d8131fd20c422d0911863faf885828733


[ROCm/roctracer commit: 1680d2c70e]
2022-06-01 23:53:12 -04:00
Laurent Morichetti d9d54df2e6 Fix HIP cmake shared library linker flags
Change-Id: I026cc7a6bcf607e3f49c5ff76bc399cf2d8c8f0c


[ROCm/roctracer commit: bdfa9fb9f7]
2022-06-01 18:36:59 -04:00
Laurent Morichetti 9bd36c0f9e Fix building the tests with Clang
Change-Id: I85c5617221e6b27553a773e76a05be9409ed10ef


[ROCm/roctracer commit: 426c9def66]
2022-06-01 16:05:43 -04:00
Tony Tye c1cf479c38 Disable CMAKE_HIP_ARCHITECTURES
Prevents cmake errors for the HIP targets such as:

  HIP_ARCHITECTURES is empty for target "MatrixTranspose".

Change-Id: I352916f6dccd22576e8b1482a41e2099b6d8a8d9


[ROCm/roctracer commit: b63427d694]
2022-06-01 11:17:58 -04:00
Laurent Morichetti b67c618f49 Remove the tracer tool's constructor and destructor functions
Change-Id: I12d88af726074fb15f8159580c85c12888f72172


[ROCm/roctracer commit: e9b3b7c9a0]
2022-05-24 21:50:47 -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 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
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 2db9dc7f66 Add a ROCTX test
Change-Id: I90dab2f349ade6cbfc86f0399c8b9ca905de23b3


[ROCm/roctracer commit: 1e7783af58]
2022-05-23 23:10:26 -04:00
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