Graf commitů

532 Commity

Autor SHA1 Zpráva Datum
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 dc22139977 Address review comments from previous commit
Change-Id: I6629dd911de0d7fd08d7a863c172ec73f35fa3d1
2022-04-20 22:46:15 -04:00
Laurent Morichetti 15ab5d9cda Run clang-format on all source files
Change-Id: Ifb52ca306286b6b2d473821bed9db28e9f616d50
2022-04-20 22:45:54 -04:00
Laurent Morichetti 89f6880371 Simplify journal.h
Simplify implementation of journal.h.

Change-Id: I9e2e93fd3cd3391fdf182249f5c4c5ef3debae03
2022-04-20 19:43:16 -07:00
Laurent Morichetti 06a3da7c63 Fix copyright headers
Change-Id: I380d867fa5fb04e68b5b332e9abf33fbeb1e9418
2022-04-19 09:30:45 -07:00
Laurent Morichetti 31365f3076 Switch roctracer to C++17
Change-Id: Ic8dee7dddaac2e7cca6e055f3c5f717f162f1eed
2022-04-18 15:02:49 -07:00
Tony Tye b30b5b84e7 Update README.md
Improve formating and correct build directions.

Change-Id: I06b97e206e014c29c0c9f3b34dedd683448728f2
2022-04-15 20:34:21 +00:00
Ammar Elwazir 57add1a6fa Revert "SWDEV-295522: Fixing Performance Issue"
This reverts commit e7327aaac7.

Reason for revert: Merged by mistake

Change-Id: I8c39c823d92cc20a238ca6120dde4b2fa9121e85
2022-04-07 06:55:34 -04:00
Ammar ELWazir e7327aaac7 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
2022-04-07 00:07:24 +00:00
Ammar ELWazir 7ee4f87b73 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
2022-03-29 22:27:25 +00: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
Saurabh Verma 43657de4d2 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 2022-03-18 10:13:31 -04:00
Ammar ELWazir 43a36f8dd5 SWDEV-328300: supporting centos-9 for roctracer
Changing pthread_yield() to sched_yield() as pthread_yield() is deprecated in CentOS 9

Change-Id: I2961b61374e36995d0835f0e65b26c35f5eb8715
2022-03-18 01:26:39 +00:00
Saurabh Verma 37ed31087a 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
2022-03-17 17:16:17 -05:00
Saurabh Verma aee8102fa6 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
2022-03-14 16:07:58 -04:00
Ammar ELWazir 8098ec6acf SWDEV-296010: Fixing RPATH & CMAKE files
Removing the RPATH skip & Removing the install path that was defined CMakelist

Change-Id: Icf374b9548fc7b24e99a1b5ab9720ce6d775abf8
2022-03-09 19:16:08 -06:00
Ranjith Ramakrishnan bc19ae71eb 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
2022-03-04 04:03:51 -08:00
Ranjith Ramakrishnan c037ccb95e Merge "SWDEV-291455: Prefer rocm include path to hip include path" into amd-staging 2022-02-15 14:43:32 -05:00
Ranjith Ramakrishnan ebda880c4a SWDEV-291455: Prefer rocm include path to hip include path
Change-Id: I1fa96e72169fac689a3a2ed38e988d7f5d18bf04
2022-02-14 14:21:32 -08:00
Kiumars Sabeti 554011e767 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
2022-02-11 19:21:17 +00:00
Kiumars Sabeti cec4cb2538 SWDEV-322312: RPM packages are generated while build roctracer for UBUNTU
replaced -DCPACK_GENERATOR=DEB

Change-Id: I9f6d4d652e7cad510343731948675f0cd4398ef4
2022-02-11 08:33:17 +00:00
kiumars e56146ff7c replace the set of CMAKE_SHARED_LINKER_FLAGS with add_link_options.
Change-Id: I2696ccd53b234e700e1464b0b3852aac1e3fc3b3
2022-02-03 12:55:15 -05:00
Ammar ELWazir b721e3209e SWDEV-318551: Adding License file for tracer
Making the new License file, Adding support in the CMakeLists.txt

Change-Id: I43862b8b7f3025ae6200aeb442ea70c7993a7349
2022-01-26 13:39:31 -05:00
Icarus Sparry 8ea268b3f4 Forcibly disable parallelism
The manually written Makefiles in the test directory are not safe to
use by more than one job. For example we see things like
	all: clean $(EXECUTABLE)
which says that the 'all' target depends on the 'clean' and
'$(EXECUTABLE)' targets. If make is invoked with -j2 then the clean
and '${EXECUTABLE}' can be built in parallel, so the clean can delete
things whilst they are being built!

Change-Id: I9c56db4c629081b8d812dad45dfd4afde10e481f
Signed-off-by: Icarus Sparry <icarus.sparry@amd.com>
2021-10-31 15:19:36 -07:00
Ammar ELWazir aa41554130 SWDEV-275232: Replaced the use of on_exit()
on_exit() registered exit_handler function, but in the case of OpenMP applications the registered exit func exit_handler was called after the dlclose of the library. So we removed exit_handler from roctracer as it is already handled in both rocprofiler and rocprof script.

Change-Id: I7c3d42e6ccc282e713b48b4a7faec4935e7a2600
2021-10-09 17:36:36 -04:00
Ammar ELWazir 99e2f37c81 SWDEV-298155: Fixing HSA-CLASS REV
Adding the latest commit to pull from the hsa-class git repo that includes the fix for SWDEV-298155
"Fixing the typo in evt_stats.h" https://github.com/ROCmSoftwarePlatform/hsa-class/commit/e6456a6d93cc6d8bcc59bd6ea24f27146f86ff4c

Change-Id: I9984de8ec9204a6cf47a25ce4ac42852473c56c9
2021-09-29 12:27:15 -04:00
Saurabh Verma a7cd80b716 SWDEV-295878 Fix for seg fault when using --trace-start off
Change-Id: Ic76d814b3591f72db18319d78f34596dae1ddfee
2021-08-31 16:46:59 -05:00
Ammar Elwazir 02d27d06e5 Merge "SWDEV-294319 & SWDEV-294321 Added support for missing functions" into amd-staging 2021-08-12 03:15:40 -04:00
Ammar ELWazir 513460bd41 SWDEV-294248 (Fixing Race Conditions):
Fixing race conditions that happened when enabling trace-period feature on the following code:
#include <hip/hip_runtime.h>
__global__ void
kernel ()
{
}
int
main (int argc, char **argv)
{
  for (size_t i = 0; i < 10000; ++i) {
    hipLaunchKernelGGL (kernel, 1, 1, 0, 0);
    hipDeviceSynchronize ();
  }
  return 0;
}

Change-Id: I4eb88a4a71efbad0f6483e7fb6e8e0c6a662860b
2021-08-11 22:48:55 -04:00
Ammar Elwazir 53fa06ad66 Merge "Fixing correlation_id_map" into amd-staging 2021-08-11 21:44:59 -04:00
Ammar Elwazir 682ebba1c2 Merge "Cosmetic change" into amd-staging 2021-08-11 20:47:53 -04:00
Ammar ELWazir 8396836c25 SWDEV-294319 & SWDEV-294321 Added support for missing functions
Added Support for launch kernel functions to fill_api_db

Change-Id: Ie8749806214d6e283c3d408d8019f178f42018bf
2021-08-11 11:42:21 -04:00
Ammar ELWazir b02586c587 Cosmetic change
Fixing variable names and removing un-needed references

Change-Id: I3ed2cee89e7dc599caf1726fe1eab1a913e5a93d
2021-08-09 14:13:57 -04:00
Ammar ELWazir 1e3ed06a9a Fixing correlation_id_map
Changing correlation_id_map to static instance instead of being a pointer and fixing the corresponding references

Change-Id: Id8a481a90b46831f91985a7e0523fd2869991aeb
2021-08-09 14:05:52 -04:00
Christophe Paquot e5e1258ef8 SWDEV-295205 - Remove KFD domain from roctracer
Change-Id: I2771cf43aa115bb466531bf887f7cc75e187f2ef
2021-07-22 10:12:45 -07:00
Christophe Paquot b04dfd5fdf SWDEV-281658 - Preserve the callback IDs enum ordering
Use HIP_API_ID_NONE to detect unsupported API instead of
HIP_API_ID_NUMBER which can grow with a new version of the API.
This HIP_API_ID_NONE enum has a fixed value of 0 so the
HIP_API_IDs really start at FIRST.

Change-Id: I760aa50ddf6fa6d46bf20555ad7d429335a53f97
2021-06-30 09:52:20 -04:00
Freddy Paul 1cc934204f roctracer:All libraries need to be installed with LIBRARY TAG
Cmake will do the post processing required for RPATH or any other
needed for the libraries only if installed as libraries not as
regular files

FIX: SWDEV-287893
Change-Id: I9cf478fcd23b9f2e8b3bdd81aa566cad3ec2a5e3
2021-05-26 12:15:25 -04:00
Rachida Kebichi e5dd1e9b85 SWDEV-284863 Fixed several issues preventing memcpy info dump in csv
Change-Id: I4c6323311ce8314296e81a9b9b5d8adb485e0aa8
2021-05-25 11:10:52 -04:00
Laurent Morichetti 297b613604 Fix random bugs discovered while reading the code
In HsaTimer::correlated_pair_ns, the time ID should be used to
select the clock ID passed to clock_gettime.

In MemoryPool::allocator_default, pass the correct value to realloc.

Change-Id: I5d10c0994c07fdeadd99c81deba4e71a4f579523
2021-05-20 21:22:16 -04:00
Laurent Morichetti 8fb3cdb30b Make HIP_VDI the default
As this snippet shows, HCC is no longer supported by roctracer:

#if HIP_VDI
...
#else
#error HCC support dropped
#endif

Removed HIP_VDI from the CMakeLists.txt, and the source code.

Change-Id: Ib273da2a5af6d67fa1b021a7eca3ff785c8b9c73
2021-05-20 21:20:27 -04:00
Rachida Kebichi faada3e569 SWDEV-283958 Workaround for unnamed structs
CppHeaderParser has limited support for unnamed structs. It leaves the
name empty so this results in classes (a.k.a structs) having trailing '::'
characters, also giving no way to distingush two unnamed structs at the
same level of nesting. An example are the inner structs of
hipExternalSemaphoreSignalParams. The workaround consists in skipping
over these, so they are not generated in the output header file
which lists all ostream ops<<. Only the inner unnamed structs are skipped,
the rest is processed as it should.

Change-Id: I17439c46095469b7adb7aee0b0f0b3d234aabc11
2021-05-07 15:57:30 -04:00
Freddy Paul 7bcac00f35 roctracer:update with case-sensitivity email
All packages should have a valid email for contact.

SWDEV-257322

Change-Id: I3a489bde4283545cba2ee377edc5a8b7adb75116
2021-05-03 11:47:42 -07:00
Freddy Paul 0cff9b7dc9 roctracer:Add maintainer email in package.
All packages should have a valid email for contact.

SWDEV-257322

Change-Id: I04b7d5ccc618b0a0907a75a92f50c9da64c3ff32
2021-04-30 11:35:59 -07:00
Kent Russell 5c9329aec8 roctracer: Support static thunk
Add numa lib as this will be required with a static thunk
Look for static thunk of shared thunk cannot be found

Signed-off-by: Kent Russell <kent.russell@amd.com>
Change-Id: I5de63e0a56a8946132ccbb7140a19a82a70b951d
2021-04-27 12:56:56 -04:00
Laurent Morichetti 38009bfba4 Fix a compilation error with gcc-9.3.0
On Ubuntu 20.04, in Release mode, gcc fails with this error:

In file included from /usr/include/string.h:495,
                 from /opt/rocm/include/hsa/hsa_api_trace.h:57,
                 from ../roctracer/src/util/hsa_rsrc_factory.h:29,
                 from ../roctracer/src/util/hsa_rsrc_factory.cpp:25:
In function ‘char* strncpy(char*, const char*, size_t)’,
    inlined from ‘const util::AgentInfo* util::HsaRsrcFactory::AddAgentInfo(hsa_agent_t)’ at ../roctracer/src/util/hsa_rsrc_factory.cpp:323:12:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:106:34: error: ‘char* __builtin___strncpy_chk(char*, const char*, long unsigned int, long unsigned int)’ specified bound depends on the length of the source argument [-Werror=stringop-overflow=]
  106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
      |          ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../roctracer/src/util/hsa_rsrc_factory.cpp: In member function ‘const util::AgentInfo* util::HsaRsrcFactory::AddAgentInfo(hsa_agent_t)’:
../roctracer/src/util/hsa_rsrc_factory.cpp:322:39: note: length computed here
  322 |     const int gfxip_label_len = strlen(agent_info->name) - 2;
      |                                 ~~~~~~^~~~~~~~~~~~~~~~~~

The error is caused by the following 2 lines:

    const int gfxip_label_len = strlen(agent_info->name) - 2;
    strncpy(agent_info->gfxip, agent_info->name, gfxip_label_len);

The size argument to strncpy should not depend on the input string.

Since the terminating character is not considered (the copy is at
most len - 2 bytes), using memcpy is preferable. Also, make sure
the destination does not overflow by clamping the size.

Change-Id: I37c5c45418e7c31a017581b6c16e5d47cd61aec5
2021-04-19 22:57:51 -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 8c3bd6817e SWDEV-272488 append to CMAKE_CXX_FLAGS instead of override
Change-Id: Ib5e6856944bf54b2161cba9ac24adda57fdf8a9a
2021-04-06 15:45:44 -04:00
Evgeny Shcherbakov 26fd08feae Merge "fxing gfxip label" into amd-staging 2021-04-03 01:31:34 -04:00
Rachida Kebichi 06271806d4 SWDEV-255637 support for hsa_amd_memory_async_copy_rect
Change-Id: I5db6484c30427712c56b59862e748118a3f079c2
2021-03-31 10:02:06 -04:00
Cole Nelson 3018150e53 Merge "CMakeLists.txt: add ENABLE_LDCONFIG to support multi-version install" into amd-staging 2021-03-30 15:37:50 -04:00