İşleme Grafiği

654 İşleme

Yazar SHA1 Mesaj Tarih
Laurent Morichetti 006ce7b65d Remove global variables from the file plugin
The plugin's file scope global variables destructors could be called
before roctracer_plugin_finalize is called, making the global variables
undefined by the time roctracer_plugin_finalize is called.

To avoid this issue, remove all non-pod global variables from the file
plugin.

Change-Id: I4b620d67d460d9c99adfd81cbf46b0e64540c503
2022-08-23 16:34:08 -07:00
Laurent Morichetti bddb9850de Remove roctracer_mark
This function has been deprecated since ROCm-2.9, use ROCTX's
roctxMark(const char* message) as a replacement for roctracer_mark.

Change-Id: Ie4aeae1db238453fc4451746cc9a338032ba817f
2022-08-19 10:38:41 -07:00
Ammar ELWazir 4cd7497a87 Fixing issues caused by the plugin patches
- Multithreaded Applications and plugin destruction
- Fixing Async-copy trace in file plugin
- Adding the assert checkups for every trace buffer flush function

Change-Id: I96e096fd7ee2604931200a0b446edb5ce49959dd
2022-08-19 00:01:02 -04:00
Laurent Morichetti 753d543022 Use std::dec to print the begin_timestamp
Change-Id: I88377b840b2e2cce278575bc398cbdc296e6dfd7
2022-08-17 23:20:28 -07:00
Laurent Morichetti 80d363a4bc New util library
- Add string_printf/string_vprintf.
- Add warning and error with backtrace support.

Change-Id: I3dd73b4caed0d767bd9e39ffef15ff8484d0b0bf
2022-08-17 21:44:58 -07:00
Laurent Morichetti 993dcf9503 Fix tput
Don't set the color variables if tput is not available, not working, or
if ncolors < 8.

Move the color variables outside of eval to avoid calling tput over and
over again.

Change-Id: Id51a742b77ad0f7c99c1c7c5d05bed0f423b75de
2022-08-17 17:30:35 -07:00
Ammar ELWazir b7e1f74054 Adding File Plugin
- Added File plugin as the default plugin
- Moved the flush functions to the plugins
- Improved the flush to file implementation

Change-Id: I80dd448eb8147a8ea4aa63b39bd1d0a4baf7252b
2022-08-11 12:06:13 -05:00
Ammar ELWazir 1c7c5cc112 Adding Plugin Interface
- Add roctracer plugins hooks
- Add Roctracer plugin environment variable
- Add the plugin class
- Add the plugin implementation

Change-Id: I12ee2e2be035abac14864764fb76837a4533cf60
2022-08-11 10:13:36 -05:00
Ammar ELWazir 591db0b718 Changing NULL to nullptr (Tracer Tool)
Change-Id: I567bf7944599922e5d402e55142c2915ae24fb69
2022-08-08 20:45:34 -05:00
Laurent Morichetti 602c67ee00 Add a HIP domain callback stress test
This test verifies that callback argument matches the callback function
as a race condition while setting and reading the pair could result in
mismatched arguments.

Change-Id: I2fe49d98d19bb780b6956ea6718762cfa0de93f8
2022-07-30 02:51:37 -04:00
Ammar ELWazir 2e08b7d8f8 Fixing HIP Callback Data Arguments
Change-Id: I0bd9686024eed8fa757cb9fd7042b0f9508c5af5
2022-07-28 19:29:04 -05:00
Laurent Morichetti 84ad727c38 Add agent enumeration
Intercept the first call to hsa_iterate_agents in order to number them.
The index assigned to agents will be used by a future commit.

Change-Id: I8db365f8fe913b6cde16a4dccb9bf09600846521
2022-07-27 02:16:42 -04:00
Laurent Morichetti 05d3cf3529 Cleanup roctracer_hsa.h
Remove declarations that are not meant to be part of the public API.

Change-Id: I47d9e83bf41bdb2f7ac25a1507200b51c616049b
2022-07-27 02:16:15 -04:00
Laurent Morichetti e282a82e29 Fix HSA intercept
Move the HSA intercept to the OnLoad function, so that it is available
as soon as the ROCR is loaded.

Layer the HSA API wrappers on top of the basic HSA activity intercept.

Change-Id: Ie636d59755543cda181e76ec29f0b55081136b63
2022-07-27 02:15:43 -04:00
Ammar ELWazir 054456bcf8 SWDEV-342613: Tracer Tool Optimizations Ready for plugins
This commit is for code cleanup and for optimizing kernel name search
in the API callback, making sure to get the kernel name accurately
for the hip functions that have any kernel names

Change-Id: Ie9ab917c895748bfb8eee9ddfcbcad81a0b9a9fa
2022-07-26 18:58:31 -05:00
Laurent Morichetti 2513f9f51f Add TraceBuffer entry construction/destruction
Change-Id: I354f36b0d7a0baea0efb75d5e81f169b5f969542
2022-07-26 16:23:59 -07:00
Ammar ELWazir c588c49743 SWDEV-344206: Fixing Roctracer Tests
Making sure not to count duplicates for load_unload_reload_trace and
fixed the ignore-count option in check_trace.py.

Change-Id: I9e674aa624ec3b473bb7c6cc95260e240204627f
2022-07-15 12:39:55 -04:00
Ammar ELWazir c2ecd15197 Temporary: Disabling Roctracer test package
When separate debug info is requested, the test package
generation fails because /usr/bin/objcopy does not understand
the HSA code object format. We need a workaround to get
past this issue.

Change-Id: I9a307fcf532ce8219a9301850aae972303d19990
2022-07-15 09:33:08 -07:00
Laurent Morichetti a7cac4b4c9 Fix a SEGV in std::atoi
When ROCP_TRUNCATE_NAMES is not set, getenv returns NULL and std::atoi
crashes. Check that getenv returns a non-NULL string before calling
std::atoi.

Change-Id: Ie479a481f8d23f034b425d14e3cfefb3d62c84e8
2022-07-15 01:06:46 -07:00
Laurent Morichetti 96bcac0f47 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
2022-07-14 21:20:30 -04:00
Sriraksha Nagaraj e3db2beca7 SWDEV-342302 - Fixing basenames options in case of hip trace
Added a function to truncate the kernel names in case of hip trace.

Change-Id: Ida769679ccc38432538ce74c11c395d6a930018e
2022-07-13 08:20:36 -04:00
Ammar ELWazir 581c37502f SWDEV-342613: Adding typedef for timestamps
Adding roctracer_timestamp_t to be unified type for every timestamp in the roctracer project

Change-Id: I22f18c303bd2d02d1e6079b76da6b128eb384fdd
2022-07-08 21:08:35 -04:00
Ranjith Ramakrishnan 709e300d9b SWDEV-321112: Use GNUInstallDirs
Use GNUInstallDirs variables to determine the location of BINDIR,
LIBDIR, INCLUDEDIR, DATADIR, DOCDIR, LIBEXECDIR.

Depends-On: Id11f862fb4bdb2425d68f455074172c38814ec92
Change-Id: I6459a4531ef899321a5e2d8050cf8b553e89a968
2022-07-07 10:36:39 -07:00
Laurent Morichetti 3adc56bd9b 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
2022-07-05 17:03:21 -04:00
Laurent Morichetti 957084de07 Rename project ROCTRACER -> roctracer
Change-Id: I83d47025aad59dc37a53ec82452b639fc8ffb478
2022-07-02 22:05:25 -07:00
Ammar ELWazir ee1b7e056e 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
2022-06-28 18:41:13 -04:00
Sriraksha Nagaraj 4484718571 SWDEV-323976:Adding support to display correlation-ids in hsa-trace files
Change-Id: Ie01658c1f55624b4986542853a9a85a4ca40866d
2022-06-27 07:54:22 -04:00
Laurent Morichetti d32cf96cd4 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
2022-06-24 16:45:03 -07:00
Ammar ELWazir 8c28237a2c Changing hcc to hip in hip activity file handle
Change-Id: If4207b72757775d31404768807fe1ad1204521f6
2022-06-21 19:03:33 -04:00
Ammar ELWazir 7cbee920b7 Enabling ROCP_STATS_OPT
Enabling the new methodology of ROCP_STATS_OPT of getting HIP activities while the application is running

Change-Id: I94b3311b0740db804643dba0e4f77c1f9de0319b
2022-06-21 14:58:28 -05:00
Laurent Morichetti fd1469a573 Enable tests validation in the CI environment
Change-Id: Ied3d203db35083f0045fae052d82ec5e1a867581
2022-06-18 13:50:35 -07:00
Laurent Morichetti 44dbb56fce 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
2022-06-18 13:50:33 -07:00
Ranjith Ramakrishnan 0fa2808779 SWDEV-295886 - Replaced hard coded path /opt/rocm with ROCM_PATH
HIP cmake module path set to actual cmake file location

Change-Id: I7a3e6eec2b51d0e550e68496eecf268a01a2d015
2022-06-16 00:11:35 -07:00
Laurent Morichetti 836bab37d3 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
2022-06-09 15:20:14 -07:00
Laurent Morichetti ef3b2a8aa8 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
2022-06-08 18:34:23 -04:00
Laurent Morichetti 4c6f249cc1 Fix test errors
Check the HIP API calls status, and abort if != success.

Change-Id: Ifc38d8f28092ffdce1674a05a7886f7c0c97a885
2022-06-03 01:39:58 -04:00
Ammar ELWazir 1680d2c70e Adding missing commits
Adding commits found in mainline and not in staging

Change-Id: Ib146912d8131fd20c422d0911863faf885828733
2022-06-01 23:53:12 -04:00
Laurent Morichetti bdfa9fb9f7 Fix HIP cmake shared library linker flags
Change-Id: I026cc7a6bcf607e3f49c5ff76bc399cf2d8c8f0c
2022-06-01 18:36:59 -04:00
Laurent Morichetti 426c9def66 Fix building the tests with Clang
Change-Id: I85c5617221e6b27553a773e76a05be9409ed10ef
2022-06-01 16:05:43 -04:00
Tony Tye b63427d694 Disable CMAKE_HIP_ARCHITECTURES
Prevents cmake errors for the HIP targets such as:

  HIP_ARCHITECTURES is empty for target "MatrixTranspose".

Change-Id: I352916f6dccd22576e8b1482a41e2099b6d8a8d9
2022-06-01 11:17:58 -04:00
Laurent Morichetti e9b3b7c9a0 Remove the tracer tool's constructor and destructor functions
Change-Id: I12d88af726074fb15f8159580c85c12888f72172
2022-05-24 21:50:47 -07:00
Laurent Morichetti 15f65a4d27 Fix typos
Change-Id: I90df287a3b0f501a5dcb4b37a2bd3b9d5695f582
2022-05-24 23:53:01 -04:00
Laurent Morichetti 6d7a39ae7e Fix ROCTX function attributes
Change-Id: I32ebbacba7df9059574c31831b13fb2a923fcc97
2022-05-24 23:52:51 -04:00
Laurent Morichetti 1c450082af Add ROCtracer version information
Change-Id: I10b268790d2dc4f3a3ad8624b2f553da6f3ccc8e
2022-05-24 23:52:29 -04:00
Laurent Morichetti 1e8e53da1d Move exception.h to the roctracer
Only the roctracer API is using exceptions to return error codes to the
client application.

Change-Id: I92e5bd1a044dbde0c80dd9ef87e606550c3ff790
2022-05-24 23:52:07 -04:00
Laurent Morichetti c0cbcdff1d 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
2022-05-24 15:52:31 -07:00
Laurent Morichetti 8ee9d859ed 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
2022-05-24 15:52:29 -07:00
Tony Tye a4db4084db 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
2022-05-24 15:32:56 -04:00
Laurent Morichetti 1e7783af58 Add a ROCTX test
Change-Id: I90dab2f349ade6cbfc86f0399c8b9ca905de23b3
2022-05-23 23:10:26 -04:00
Laurent Morichetti 7ebae10571 Document the ROCTX API
Change-Id: I63a04139d1640ea5d52f6143cf2e9bfc0614a894
2022-05-23 23:10:02 -04:00