2070 Коммитов

Автор SHA1 Сообщение Дата
Ammar ELWazir c1c514f743 Use logical_node_id for mapping rocprofiler agents to HSA agents (#708)
* Temp: Fixing node id

* source formatting (clang-format v11) (#709)

Co-authored-by: ammarwa <3832908+ammarwa@users.noreply.github.com>

* Using logical node id

* Update agent.cpp

* Update agent.cpp

* Python formatting

---------

Co-authored-by: Ammar ELWazir <aelwazir@rocprofiler1.amd.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: ammarwa <3832908+ammarwa@users.noreply.github.com>
Co-authored-by: Ammar ELWazir <aelwazir@rocprofiler2.amd.com>
Co-authored-by: Jonathan R. Madsen <jonathanrmadsen@gmail.com>

[ROCm/rocprofiler-sdk commit: 62625d0aa1]
2024-04-02 01:38:18 -05:00
Benjamin Welton a79493bbb9 Revert "Add additional debug info and do iteration on per-agent basis" (#723)
This reverts commit a66d3475b6.

[ROCm/rocprofiler-sdk commit: 4200faf813]
2024-04-01 22:27:27 -07:00
Benjamin Welton a66d3475b6 Add additional debug info and do iteration on per-agent basis
[ROCm/rocprofiler-sdk commit: 6fc239f6eb]
2024-04-01 18:45:04 -07:00
Jonathan R. Madsen f2c193a7e6 Update internal threading (#720)
- update lib/rocprofiler-sdk/internal_threading.*
- use PTL::TaskManager instead of PTL::TaskGroup
  - easier to handle for our needs
  - eliminate data race in rocprofiler_flush_buffer
  - combine memory management of TaskManager and ThreadPool

[ROCm/rocprofiler-sdk commit: 092c428b78]
2024-04-01 20:31:54 -05:00
Benjamin Welton e2dfd3bbc9 Add debug printout for data in CC validate
[ROCm/rocprofiler-sdk commit: 001f9baa04]
2024-04-01 13:02:50 -07:00
Ammar ELWazir 58addf80dc Formatting as suggestion in the same branch (#711)
* Update formatting.yml

* Update agent.cpp

* Update agent.cpp

[ROCm/rocprofiler-sdk commit: e6237637eb]
2024-04-01 13:11:09 -05:00
Ammar ELWazir 80dee55f75 Update formatting.yml
[ROCm/rocprofiler-sdk commit: 7c3e4593bf]
2024-03-30 07:21:48 -05:00
Ammar ELWazir ccc21f5c10 Update docs.yml
[ROCm/rocprofiler-sdk commit: 8534dfa1f3]
2024-03-30 07:21:24 -05:00
Ammar ELWazir 3c10a1410c Update continuous_integration.yml
[ROCm/rocprofiler-sdk commit: 6077ddf9ca]
2024-03-29 21:58:18 -05:00
Ammar ELWazir 59a8b7b723 Update continuous_integration.yml
[ROCm/rocprofiler-sdk commit: bc97ae0370]
2024-03-29 20:25:44 -05:00
Ammar ELWazir 42a1edbe2f Adding public sync (#703)
* Create sync-mainline.yaml

* Create sync-staging.yaml

[ROCm/rocprofiler-sdk commit: 332374b3fe]
2024-03-29 18:09:00 -05:00
Ammar ELWazir 05701fcfc0 Update continuous_integration.yml
[ROCm/rocprofiler-sdk commit: 2a1e9b3f11]
2024-03-29 17:16:14 -05:00
Gopesh Bhardwaj 20652f775a SWDEV-452077 Fixing MI300 list counters and metrics issue (#701)
[ROCm/rocprofiler-sdk commit: ecc79b1fa3]
2024-03-29 14:44:38 -07:00
Benjamin Welton f29707c7b7 Make dimension error message print the counter name (#658)
* temp

* source formatting (clang-format v11) (#659)

Co-authored-by: bwelton <1683479+bwelton@users.noreply.github.com>

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: bwelton <1683479+bwelton@users.noreply.github.com>

[ROCm/rocprofiler-sdk commit: f0924c6aa7]
2024-03-26 17:19:04 -05:00
Gopesh Bhardwaj 9400df8992 counter collection header update in docs (#690)
[ROCm/rocprofiler-sdk commit: f633278720]
2024-03-26 17:18:39 -05:00
Jonathan R. Madsen eede2ffea2 Update HSA copy table (#687)
- two copies of HSA table: internal and tracing
- internal is used to invoke HSA function without any possibility of triggering tracing, etc.

[ROCm/rocprofiler-sdk commit: bc9f86ec62]
2024-03-26 17:11:34 -05:00
Jonathan R. Madsen 34d3257fb1 Fix agent node id + randomize offset id (#625)
* Fix agent node id + randomize offset id

- fixes the node_id value
- randomizes a constant offset for the id.handle values
- switch to using node ids in rocprofiler-sdk-tool library
- update tests related to agents

* Logical node id

- sequential node id values from 0 to (N-1) where N is the number of agents

[ROCm/rocprofiler-sdk commit: 1addfed9f6]
2024-03-21 20:04:21 -05:00
Jonathan R. Madsen 5716eae6e1 Handle hsa_queue_destroy after finalization (#679)
* Handle hsa_queue_destroy after finalization

- fixes issue where hsa_queue_destroy(...) is invoked after rocprofiler-sdk has finalized
- hsa::get_queue_controller() returns pointer
- if queue controller is a null pointer, skip invoking QueueController::destroy_queue

* Update HIP/HSA/marker update_table logging

* Update rocprofv3 tests

- remove HSA_TOOLS_LIB env variable
- remove setting ROCPROFILER_LOG_LEVEL env variable
- add timeouts to tests which are missing them

* Disable thread sanitizer deadlock detection

* Update CI workflow

- rename vega20-ubuntu job to core-ci
- enable navi32 in core-ci and sanitizers

* Update run-ci.py

- set gcovr html medium and high threshold

* Update lib/rocprofiler-sdk/hsa/queue_controller.cpp

- remove this capture from enable/disable serialization

* Update lib/rocprofiler-sdk/hsa/{hsa_barrier,profile_serializer}.*

- hsa_barrier::set_barrier accepts const-ref to queue map
- profile_serializer::enable and profile_serializer::disable accept const-ref to queue map

* Logging for HIP/HSA/marker/profile_serializer

* Logging for HIP/HSA/marker/queue_controller

* Improve test_retired_correlation_ids asserts

* Fix tests/counter-collection/validate.py

- scale expected SQ_WAVES counter value based on warp size of GPU

* Tweak github comment for code coverage

* Remove gcovr html high/medium threshold args

* Fix tests/counter-collection/validate.py

- round before casting to int in test_counter_values

* operator bool for profile_serializer

- only wait on CV if profile_serializer is used

* Logging updates (profile_serializer + code_object)

* Update counter-collection validate.py

* QueueController does not wait on CV if finalizing/finalized

* Update CI workflow

- remove navi32 from core job

* Improve HIP/HSA/marker tracing get_functor/functor

- remove lambda wrapper around functor

* Update lib/rocprofiler-sdk/hsa/queue_controller.cpp

- do not acquire cvmutex lock during finalization

* Update lib/rocprofiler-sdk/hsa/hsa_barrier.*

- move ctor and dtor to implementation
- skip signal store screlease and destroy if already finalized

* Update CI workflow

- remove navi32 runners

* bwelton fixes for hangs

* CMake improvements + simplified demangle

- remove amd-comgr from common target (and thus removed from roctx DT_NEEDED)

---------

Co-authored-by: Benjamin Welton <bewelton@amd.com>

[ROCm/rocprofiler-sdk commit: 2f9b1767e9]
2024-03-21 17:52:15 -05:00
Vladimir Indic 141783bb83 PCS parser is aware of external correlation IDs (#639)
* PCS parser is aware of external correlation IDs

* source formatting (clang-format v11) (#640)

Co-authored-by: vlaindic <139573562+vlaindic@users.noreply.github.com>

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

[ROCm/rocprofiler-sdk commit: 78939e705a]
2024-03-15 14:04:06 -05:00
Ammar ELWazir 773e934611 Update continuous_integration.yml (#638)
* Update continuous_integration.yml

Adding a more stable docker image to use

* Fixing jobs dependencies

* Fixing job image url

[ROCm/rocprofiler-sdk commit: 1fa0b51263]
2024-03-15 11:18:55 -05:00
Jonathan R. Madsen 3712738692 Context Updates (#624)
* Improve error checks related to context create/start/stop/is_valid

* Bump version to 0.2.1

* Track number of kernels associated with correlation id

- add atomic kernel counter variable to context::correlation_id

* Update lib/rocprofiler-sdk/hsa/queue.cpp

- apply the +/- kernel count

[ROCm/rocprofiler-sdk commit: 0fdb21c050]
2024-03-14 04:40:58 -05:00
Jonathan R. Madsen 72fdb3e8ed Fix tracing context domain logic for operations (#621)
* Fix tracing context domain logic for operations

- logic error: domain enabled (all operations all implicitly enabled) + domain enabled for subset of operations resulted in only explicitly enabled operations being treated as enabled
- domain_context: split single bitset for operations in all domains into array of bitsets for each domain

* Update lib/common/mpl.hpp

- assert_false for static_asserts in if constexpr expressions

* Update lib/rocprofiler-sdk/tests/contexts.cpp

- Tests for validating logic regarding domain and operations for callback and buffer tracing

[ROCm/rocprofiler-sdk commit: 7ab1a8015f]
2024-03-14 01:25:43 -05:00
Ammar ELWazir 0f7a5c7033 Temporary move CI to hip staging (#615)
* Update continuous_integration.yml

* Update ostream.hpp

[ROCm/rocprofiler-sdk commit: 2bfce8b86d]
2024-03-13 12:34:29 -05:00
Benjamin Welton da708a2651 Use static_object for dimension map (#616)
[ROCm/rocprofiler-sdk commit: a06eef3488]
2024-03-13 09:28:33 -05:00
Jonathan R. Madsen 043db3b3a4 Use small_vector for API iterate_args (#597)
* Use small_vector for API iterate_args

- replace dim3 value arguments with rocprofiler_dim3_t
  - dim3 has a non-trivial destructor
- common::mpl::unqualified_type
- common::stringified_argument_array_t<N> alias
- assert_public_data_type_properties()
- common::container::small_vector<T>::at function
- stringize returns small_vector<stringified_argument>
  - stack allocated vector
- remove has_pc_sampling condition (HSA, HIP)
  - this will be handled in queue interception

* Misc tweaks

[ROCm/rocprofiler-sdk commit: 8591ed1c96]
2024-03-13 07:36:55 -05:00
Benjamin Welton fa90ca8669 Disable test that checks dims (need AQL fake data support) (#612)
* Disable test that checks dims (need AQL fake data support

* source formatting (clang-format v11) (#613)

Co-authored-by: bwelton <1683479+bwelton@users.noreply.github.com>

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: bwelton <1683479+bwelton@users.noreply.github.com>

[ROCm/rocprofiler-sdk commit: 2a262235db]
2024-03-12 23:20:14 -05:00
Gopesh Bhardwaj 17c0767e2a rebased and solved conflicts (#605)
[ROCm/rocprofiler-sdk commit: b8acf88c6f]
2024-03-08 09:04:19 -06:00
Benjamin Welton e995df5be5 Deadlock Fix for HSA and Serialization Disable/Enabling support (#582)
* Initial barrier

* Working on profiler serializer extraction

* Current progress

* Serializtion Support

* source formatting (clang-format v11) (#583)

Co-authored-by: bwelton <1683479+bwelton@users.noreply.github.com>

* cmake formatting (cmake-format) (#584)

Co-authored-by: bwelton <1683479+bwelton@users.noreply.github.com>

* Minor fix

* Current Progress

* Current progress

* More fixes

* Serialization Fixes

* Bug fix

* source formatting (clang-format v11) (#600)

Co-authored-by: bwelton <1683479+bwelton@users.noreply.github.com>

* More fixes

* More minor fixes

* source formatting (clang-format v11) (#603)

Co-authored-by: bwelton <1683479+bwelton@users.noreply.github.com>

* source formatting (clang-format v11) (#604)

Co-authored-by: bwelton <1683479+bwelton@users.noreply.github.com>

* Lock order inversion false positive

* order fix

* More changes

* source formatting (clang-format v11) (#607)

Co-authored-by: bwelton <1683479+bwelton@users.noreply.github.com>

* minor test fix

* Minor test changes

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: bwelton <1683479+bwelton@users.noreply.github.com>

[ROCm/rocprofiler-sdk commit: 1de44447f4]
2024-03-08 09:02:43 -06:00
Jonathan R. Madsen 407fc57ede Shared Library Constructor (rocprofv3 deadlock fix) (#599)
* Moved tests/apps to tests/bin

* Renamed cmake project in tests/bin

* Update samples

- Use ROCPROFILER_DEFAULT_FAIL_REGEX
- tweaks to stdout messages

* Update tests

- Use ROCPROFILER_DEFAULT_FAIL_REGEX

* Add tests/lib

- libraries with HIP code

* Update PTL submodule

- remove atexit delete of thread_id_map

* Update cmake/rocprofiler_options.cmake

- Set ROCPROFILER_DEFAULT_FAIL_REGEX

* Update common lib: env + logging

- improved customization of logging settings
- default to disabling logging to files
- install failure handler for rocprofv3
- set_env support in environment.*

* Add lib/rocprofiler-sdk/shared_library.cpp

- shared library constructor

* Update lib/rocprofiler-sdk-tool/tool.cpp

- destructor thread safety
- convert callback_name_info and buffered_name_info to pointers
- install failure handler for logging

* Add tests/bin/hip-in-libraries

- hip-in-libraries is an exe which uses two shared libraries where each shared library contains HIP kernels
  - used for testing deadlocking within __hipRegisterFatBinary

* Update bin/rocprofv3

- reorganized the env variables
- use exec to launch command
- set ROCPROFILER_LIBRARY_CTOR=1

* Add tests/rocprofv3/tracing-hip-in-libraries

- uses hip-in-libraries exe for exe which uses shared libraries to launch HIP kernels

* Update bin/rocprofv3

- fix counter collection (no exec)

* Update lib/rocprofiler-sdk-tool/tool.cpp

- replace "Kernel-Name" with "Kernel_Name"

* Update lib/rocprofiler-sdk/registration.cpp

Use RTLD_LOCAL instead of RTLD_GLOBAL for env libraries

* Update tests/rocprofv3

- replace "Kernel-Name" with "Kernel_Name"

* Update tests

- vector-ops (bin) stream syncs + runs with 4 queues per device
- improve counter-collection/input1 validation
- rocprofv3/tracing-hip-in-libraries does not do sys-trace
- improved validation script for tracing-hip-in-libraries
- updated dispatch_callback in json-tool.cpp following reworking of prototypes for counter collection

* Update samples/counter_collection

- updated dispatch_callback(s) and record_callback(s) following reworking of prototypes

* Update bin/rocprofv3

- reorganized help menu
- added options for sub-HSA tables
- added --hip-runtime-trace
- changed --hip-trace to include --hip-compiler-trace

* Update lib/rocprofiler-sdk-tool

- improved kernel filtering
- removed arch_vgpr, accum_vgpr, sgpr code (in rocprofiler-sdk)
- fixed issue with counter-collection w/o tracing
- added support for fine grained HSA API tracing
- removed directly linking to HSA-runtime

* Update lib/rocprofiler-sdk/agent.cpp

- rocp_agents != hsa_agents is non-fatal when ROCPROFILER_BUILD_CI=OFF (CMake option)

* GPR (vector and scalar) info in kernel symbol data

- rocprofiler_callback_tracing_code_object_kernel_symbol_register_data_t contains general purpose register info

* Header include order fix

- Include repo headers first
- Third party library headers next
- standard library headers last

* Update dispatch profiling public API

- introduce rocprofiler_profile_counting_dispatch_data_t
- change signature of rocprofiler_profile_counting_dispatch_callback_t and rocprofiler_profile_counting_record_callback_t
- provide rocprofiler_user_data_t pointer in dispatch callback
- provide rocprofiler_user_data_t value (from dispatch cb) in record callback

* Update tests/bin/CMakeLists.txt

- fix add_subdirectory(hip-in-libraries) order

* Update VERSION

- bump to 0.2.0 in prep for AFAR

[ROCm/rocprofiler-sdk commit: 7b6d3c70bd]
2024-03-07 22:21:26 -06:00
Gopesh Bhardwaj 1295c42022 Documentation Updates (#470)
* Updating installation doc

* updating README

* Addressing Yifan's feedback

* trivial updates

* Added limitation for individual xcc in readme

* Added rocprofv3 page

* README updates

* Updating rocprofv3

* source formatting (clang-format v11) (#538)

Co-authored-by: bgopesh <7112102+bgopesh@users.noreply.github.com>

* Merging documentation team's update

* Update source/docs/installation.md

Co-authored-by: Jonathan R. Madsen <jrmadsen@users.noreply.github.com>

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: bgopesh <7112102+bgopesh@users.noreply.github.com>
Co-authored-by: Jonathan R. Madsen <jrmadsen@users.noreply.github.com>

[ROCm/rocprofiler-sdk commit: 665c546e65]
2024-03-07 21:05:16 -06:00
Jonathan R. Madsen d820cf3018 Update rocprofiler_query_available_agents(...) (#596)
* Agent info version

* Complete implementation

- revert "rocprofiler_iterate_agents" to "rocprofiler_query_available_agents"

* Misc tweaks

- update rocprofiler_query_available_agents impl

* Update include/rocprofiler-sdk/agent.h

- Fix undocumented param for rocprofiler_query_available_agents

[ROCm/rocprofiler-sdk commit: 1d33d4cf78]
2024-03-06 02:17:40 -06:00
Jonathan R. Madsen b9888a4144 Fix rocprofiler_context_is_active(...) (#595)
* Fix rocprofiler_context_is_active

- previously returning ROCPROFILER_STATUS_ERROR_CONTEXT_NOT_FOUND if context was inactive

* Update include/rocprofiler-sdk/context.h

- Update doxygen docs

[ROCm/rocprofiler-sdk commit: 19971d5719]
2024-03-06 00:32:34 -06:00
SrirakshaNag 76d660cac9 Adding list-metrics (#585)
* Adding list-metrics

* cmake formatting (cmake-format) (#587)

Co-authored-by: SrirakshaNag <104580803+SrirakshaNag@users.noreply.github.com>

* source formatting (clang-format v11) (#586)

Co-authored-by: SrirakshaNag <104580803+SrirakshaNag@users.noreply.github.com>

* Fixing issues with validation tests

* python formatting (black) (#588)

Co-authored-by: SrirakshaNag <104580803+SrirakshaNag@users.noreply.github.com>

* source formatting (clang-format v11) (#589)

Co-authored-by: SrirakshaNag <104580803+SrirakshaNag@users.noreply.github.com>

* cmake formatting (cmake-format) (#590)

Co-authored-by: SrirakshaNag <104580803+SrirakshaNag@users.noreply.github.com>

* Update conftest.py

* Update validate.py

* python formatting (black) (#591)

Co-authored-by: SrirakshaNag <104580803+SrirakshaNag@users.noreply.github.com>

* python formatting (black) (#592)

Co-authored-by: SrirakshaNag <104580803+SrirakshaNag@users.noreply.github.com>

* Checking if agent-id in validate.py

* Fixing list metrics execute test

* cmake formatting (cmake-format) (#593)

Co-authored-by: SrirakshaNag <104580803+SrirakshaNag@users.noreply.github.com>

* Fixing CI failure

* cmake formatting (cmake-format) (#594)

Co-authored-by: SrirakshaNag <104580803+SrirakshaNag@users.noreply.github.com>

* Review Comments

* Update source/bin/rocprofv3

Support -L shorthand for --list-metrics

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Jonathan R. Madsen <jrmadsen@users.noreply.github.com>

[ROCm/rocprofiler-sdk commit: c7407d0a9f]
2024-03-05 20:53:15 -06:00
Jonathan R. Madsen ae8f01f334 Update registration client search (#569)
* Update registration client search

- Search ROCP_TOOL_LIBRARIES before dlopen search
- Fatal error if ROCP_TOOL_LIBRARIES entry does not contain rocprofiler_configure symbol
- Use RTLD_DEFAULT and RTLD_NEXT to (potentially) find first two instances of rocprofiler_configure
  - if no rocprofiler_configure found via RTLD_NEXT, do not do extensive search via link map

* _GNU_SOURCE instead of GNU_SOURCE

* Clang-tidy fix

[ROCm/rocprofiler-sdk commit: b0a88d9124]
2024-03-01 17:44:12 -06:00
Jonathan R. Madsen cb6b79c323 Fix rocprofiler_iterate_callback_tracing_kind_operation_args for HIP compiler callbacks (#532)
* Fix HIP compiler iterate args

- `include/rocprofiler-sdk/hip/api_args.h`
  - replace struct fields named "f" with "func"
  - replace hip stream fields named "hStream" with "stream"
- `lib/rocprofiler-sdk/callback_tracing.cpp`
  - iterate_args for HIP compiler table
- `lib/rocprofiler-sdk/registration.cpp`
  - fix warning about roctx num_tables
- `lib/rocprofiler-sdk/hip/hip.def.cpp`
  - replace struct fields named "f" with "func"
  - replace hip stream fields named "hStream" with "stream"
- `lib/rocprofiler-sdk/{hip,hsa,marker}/utils.hpp`
  - improve `stringize_impl`
- `lib/rocprofiler-sdk/hsa/code_object.cpp`
  - remove stale commented out code
- `lib/rocprofiler-sdk/hsa/queue_controller.*`
  - destory_queue -> destroy_queue
- `tests/tools/json-tool.cpp`
  - improve parallelism in tool_tracing_callback
  - serialize the marker api args
  - only invoke rocprofiler_iterate_callback_tracing_kind_operation_args in exit phase
- `samples/counter_collection/CMakeLists.txt`
  - reduce timeout on tests to 120 seconds

* Update lib/rocprofiler-sdk/hsa/utils.hpp

- disable dereference of double pointer in stringize_impl

* Update lib/common

- indirection_level in mpl.hpp
- stringize_arg.hpp

* Rework rocprofiler_iterate_callback_tracing_kind_operation_args

- provide more information in rocprofiler_callback_tracing_operation_args_cb_t
- support specifying the dereference level to account for output paramters

[ROCm/rocprofiler-sdk commit: 1bb94add11]
2024-03-01 01:46:07 -06:00
Jonathan R. Madsen 15302ff11d C compatibility for public headers (#566)
* C compatibility for public headers

- add tests/tools/c-tool.c
  - builds a tool (which does nothing) with C language
  - ensures that tool can be compiled in C
- add tests/c-tool/CMakeLists.txt
  - ensures that tool library build from C is a valid tool
- rocprofiler_counter_info_v0_t is_derived is int instead of bool
  - C does not have bool unless <stdbool.h> is included
- add `include/rocprofiler-sdk/hsa/api_trace_version.h
  - handles providing HSA_*_TABLE_(MAJOR|STEP)_VERSION values if compiled from C
- cmake define in version.h.in for ROCPROFILER_HSA_*_TABLE_(MAJOR|STEP)_VERSION
  - HSA table versions compiled with
- use rocprofiler_(hsa|hip|marker)_api_no_args struct to handle incompatibility b/t empty structs in C vs. C++ (size of 0 vs. size of 1)
- extern "C" in include/rocprofiler-sdk/{hsa,hip,marker}/api_args.h
- fixed spelling error: derrived -> derived
- scope YY_NO_INPUT compile definition to lib/rocprofiler-sdk/counters/parser/*

* Revert CDash dashboard

[ROCm/rocprofiler-sdk commit: a1267e1fd2]
2024-02-29 23:49:54 -06:00
Gopesh Bhardwaj 495ad364a2 counter collection multi-kernel test (#492)
* counter collection multi-kernel test

* Adding counter collection in rocprofv3 script

[ROCm/rocprofiler-sdk commit: 31dcfabe23]
2024-02-28 17:08:28 -06:00
SrirakshaNag b96c983373 tools support for callback counter collection (#515)
* tools support for callback counter collection

* source formatting (clang-format v11) (#516)

Co-authored-by: SrirakshaNag <SrirakshaNag@users.noreply.github.com>

* Fixing conflicts with main

* source formatting (clang-format v11) (#517)

Co-authored-by: SrirakshaNag <SrirakshaNag@users.noreply.github.com>

* source formatting (clang-format v11) (#529)

Co-authored-by: SrirakshaNag <104580803+SrirakshaNag@users.noreply.github.com>

* Adding a column for counter name and counter value

* source formatting (clang-format v11) (#530)

Co-authored-by: SrirakshaNag <104580803+SrirakshaNag@users.noreply.github.com>

* fixing issues with atomic

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: SrirakshaNag <SrirakshaNag@users.noreply.github.com>

[ROCm/rocprofiler-sdk commit: bd81e6a5f8]
2024-02-25 20:30:38 -06:00
Ammar ELWazir a7e1a05b34 Update run-ci.py (#534)
[ROCm/rocprofiler-sdk commit: 4bb95f885b]
2024-02-24 14:48:41 -06:00
Jonathan R. Madsen a360de4550 Correlation ID Retirement + misc (#527)
* Correlation ID Retirement

- include/rocprofiler-sdk/buffer_tracing.h
  - add rocprofiler_buffer_tracing_correlation_id_retirement_record_t
- include/rocprofiler-sdk/fwd.h
  - ROCPROFILER_BUFFER_TRACING_CORRELATION_ID_RETIREMENT
- lib/rocprofiler-sdk/buffer_tracing.cpp
  - kind string for correlation id retirement
- lib/rocprofiler-sdk/buffer.hpp
  - emplace returns bool
- lib/rocprofiler-sdk/registration.cpp
  - pass lib_instance to copy_table functions
- lib/rocprofiler-sdk/context/context.*
  - update correlation_id struct
    - make ref_count private
    - {get,add,sub}_ref_count() functions
      - sub_ref_count() performs correlation id retirement
    - use stack for "latest" thread-local correlation id
- lib/rocprofiler-sdk/hip/hip.*
  - migrate to new {get,add,sub}_ref_count() for correlation ids
  - return in iterate_args
  - handle table instance in copy_table
- lib/rocprofiler-sdk/hsa/hsa.*
  - migrate to new {get,add,sub}_ref_count() for correlation ids
  - return in iterate_args
  - handle table instance in copy_table
- lib/rocprofiler-sdk/marker/marker.*
  - migrate to new {get,add,sub}_ref_count() for correlation ids
  - return in iterate_args
  - handle table instance in copy_table
- lib/rocprofiler-sdk/hsa/async_copy.cpp
  - migrate to new {get,add,sub}_ref_count() for correlation ids
  - handle table instance in async_copy_init / async_copy_save
- lib/rocprofiler-sdk/hsa/queue.cpp
  - migrate to new {get,add,sub}_ref_count() for correlation ids
  - tweak to external correlation id mapping in WriteInterceptor
- tests/async-copy-tracing/validate.py
  - check retired_correlation_ids
- tests/common/serialization.hpp
  - support rocprofiler_buffer_tracing_correlation_id_retirement_record_t
- tests/kernel-tracing/validate.py
  - check retired_correlation_ids
- tests/common/CMakeLists.txt
  - perfetto external project
- tests/common/perfetto.hpp
  - perfetto categories + aliases
  - add_perfetto_annotation
  - metaprogramming helpers
- tests/tools/CMakeLists.txt
  - link to tests-perfetto
- tests/tools/json-tool.cpp
  - demangling functions
  - serialization of marker API callback args
  - reduce parallel bottleneck in tool_tracing_callback
  - support correlation id retirement
  - Multiple threads for buffers
  - Support ROCPROFILER_TOOL_CONTEXTS_EXCLUDE env variable
  - write_perfetto() function

* Update tests/rocprofv3/tracing/validate.py

- tweak test_hsa_api_trace

* Update PTL submodule

- fixes for data race during destruction of task

* Update lib/rocprofiler-sdk/buffer.*

- unique_buffer_vec_t uses std::unique_ptr instead of allocator::unique_static_ptr_t

* Reduce timeouts in counter collection samples [skip ci]

* Update tests/tools/json-tool.cpp

- tweak demangle(string_view, int*) -> demangle(string_view, int&)

* Update lib/rocprofiler-sdk/hsa/async_copy.cpp

- move sub_ref_count() to later in async_copy_handler to delay retirement slightly more

[ROCm/rocprofiler-sdk commit: 875f53b608]
2024-02-23 10:30:33 -06:00
Gopesh Bhardwaj a651f1e215 Fixing opensuse compilation (#521)
* Fixing opensuse compilation

* source formatting (clang-format v11) (#526)

Co-authored-by: bgopesh <bgopesh@users.noreply.github.com>

* Update tests/tools/CMakeLists.txt

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: bgopesh <bgopesh@users.noreply.github.com>
Co-authored-by: Jonathan R. Madsen <jrmadsen@users.noreply.github.com>

[ROCm/rocprofiler-sdk commit: 2d71520953]
2024-02-22 01:10:23 -06:00
Jonathan R. Madsen f760a3ceaa Updates/fixes for CI, docs, tests, samples, and common library (#528)
- .github/workflows/continuous_integration.yml
  - apt-get update before apt-get install
  - remove libgtest-dev
  - actions-comment-pull-request: v2.4.3 -> v2.5.0
- .github/workflows/formatting.yml
  - create-pull-request: v5 -> v6
- cmake/rocprofiler_options.cmake
  - remove unused ROCPROFILER_DEBUG_TRACE and ROCPROFILER_LD_AQLPROFILE options
- samples/counter_collection/callback_client.cpp
  - corr_id field renamed to correlation_id
- samples/counter_collection/client.cpp
  - corr_id field renamed to correlation_id
- include/rocprofiler-sdk/fwd.h
  - In rocprofiler_record_counter_t: rename corr_id field to correlation_id
  - doxygen fixes
- lib/common/utility.*
  - remove get_accurate_clock_id_impl
  - timestamp_ns() defaults to CLOCK_BOOTTIME
- lib/rocprofiler-sdk/counters/core.cpp
  - fix spelling mistake: extrenal -> external
  - corr_id field renamed to correlation_id
- lib/rocprofiler-sdk-tool/tool.cpp
  - fix destruction of static tool::output_file before finalization
- scripts/update-docs.sh
  - define PROJECT_NAME
- tests/async-copy-tracing/validate.py
  - init_time and fini_time checks
  - hip_api_traces, marker_api_tracing
- tests/common/serialization.hpp
  - fix save function for rocprofiler_record_counter_t following rename of corr_id to correlation_id
- tests/kernel-tracing/validate.py
  - init_time and fini_time checks
  - relax test_total_runtime range
- tests/rocprofv3/tracing/CMakeLists.txt
  - remove -M from rocprofv3-test-systrace-execute
  - exclude test_hsa_api_trace in rocprofv3-test-systrace-validate due to HIP API tracing
- tests/rocprofv3/tracing/validate.py
  - update test_kernel_trace to accept mangled or demangled
- tests/tools/json-tool.cpp
  - remove use of GLOG
  - include init_time and fini_time
  - write_json(...) function

[ROCm/rocprofiler-sdk commit: 0d939edbba]
2024-02-22 00:16:43 -06:00
Benjamin Welton 2d9779ad96 Add rocprofiler_query_counter_info function (#452)
* Add rocprofiler_query_counter_info function

Replaces rocprofiler_query_counter_name. Allows for
querying other types of info from counters (such as
description) and gives us some flexibility to add
return data in the near future (if we have to).

* source formatting (clang-format v11) (#453)

Co-authored-by: bwelton <bwelton@users.noreply.github.com>

* Updated version fetching

* source formatting (clang-format v11) (#509)

Co-authored-by: bwelton <bwelton@users.noreply.github.com>

* Merged

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: bwelton <bwelton@users.noreply.github.com>

[ROCm/rocprofiler-sdk commit: 7adffd5b22]
2024-02-19 16:05:38 -08:00
Benjamin Welton cb6e12ab3a Callback based handler for counter collection (#506)
* Callback based handler for counter collection

* source formatting (clang-format v11) (#507)

Co-authored-by: bwelton <bwelton@users.noreply.github.com>

* cmake formatting (cmake-format) (#508)

Co-authored-by: bwelton <bwelton@users.noreply.github.com>

* Doc fix

* Minor doc fix

* More doc fixes

* More doc fixes

* More doc fixes

* Update CI

* Changes to the API per comments

* Mutex exception for HSA

* source formatting (clang-format v11) (#511)

Co-authored-by: bwelton <bwelton@users.noreply.github.com>

* Doc fix

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: bwelton <bwelton@users.noreply.github.com>

[ROCm/rocprofiler-sdk commit: 3638351b4c]
2024-02-19 15:55:21 -08:00
Gopesh Bhardwaj 56d1023338 Fixing AFAR builds for some GNU tool chains (#498)
[ROCm/rocprofiler-sdk commit: c9dfa9e617]
2024-02-15 08:08:37 -08:00
Gopesh Bhardwaj 4bee0ece8b Adding test for demangling (#467)
* Adding test for demangling

* moving -M option to existing one

* minor typo in script and test correction

[ROCm/rocprofiler-sdk commit: 2b1c11a4f3]
2024-02-13 11:09:27 -06:00
Benjamin Welton ebd08ab5eb Add GFX1010 to counter data (#466)
NAVI 10 support.

[ROCm/rocprofiler-sdk commit: e9e7fc8e3f]
2024-02-12 13:42:13 -06:00
Benjamin Welton 5ff25a6173 Pin version to unblock builds (#474)
Merged to unblock runners on other PRs. 

[ROCm/rocprofiler-sdk commit: a1d95daf84]
2024-02-10 12:30:31 -08:00
Benjamin Welton 8e620cc11d Add support for AQL dimensions (#262)
* Add support for AQL dimension changes

Adds support for returning dimensions from AQLProfile through rocprofiler
to tools. Includes a much larger expanded test suite that covers nearly
all files in counter collection.

Specific changes below:

samples/counter_collection/print_functional_counters: Modified to check
the validity of dimensions returned in comparison to the actual underlying
data obtained from a kernel execution.

rocprofiler-sdk/aql/helpers: adds function calls to support fetching
dimension information from AQLProfile.

rocprofiler-sdk/aql/packet_construct: modified to allow for events
to be exported to aid evaluate_ast in decoding the output buffer.

lib/rocprofiler-sdk/counters: Instance count now derived from dimension
sizes. rocprofiler_query_counter_dimensions now moved to a callback format
to improve usability.

rocprofiler-sdk/counters/core: Code migrations and exports of functions
for testing.

rocprofiler-sdk/counters/dimensions: Generates a dimension cache to be
used when querying dimension information for a counter id.

rocprofiler-sdk/counters/evaluate_ast: Modified to pass back correct
dimension information and to check/determine output dimensions for derived
counters.

rocprofiler-sdk/counters/id_decode: Modified to have a map between
dimension name -> dimension along with a conversion from the aql profile
id for a dimension (string) -> integer based id (happens only once during
init).

rocprofiler-sdk/hsa/queue: Modified to allow for making testing easier.
Specifically to allow Queue to now be mocked in unit tests for counter
collection.

* Merge with changes for serialization

* Added suggestions

* source formatting (clang-format v11) (#457)

Co-authored-by: bwelton <bwelton@users.noreply.github.com>

* Minor fix

* Test change

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: bwelton <bwelton@users.noreply.github.com>

[ROCm/rocprofiler-sdk commit: 3eb6a27bc6]
2024-02-07 22:03:21 -06:00
Gopesh Bhardwaj 4daf20d431 Fixing counter collection in tools and enabling tests (#436)
* Fixing coutner colleciton in tools and enabling tests

* fixing tests

* improving coverage on test

* Adding vector operations app

* Fixing tools bug for counter collection

* removing roctx linking

[ROCm/rocprofiler-sdk commit: 8a25b239bc]
2024-02-06 09:55:07 -08:00