Revīziju grafs

437 Revīzijas

Autors SHA1 Ziņojums Datums
Indic, Vladimir 2bb64e9c9a GFX950 Stochastic PC sampling (#344)
* GFX950 Stochastic PC sampling

* Use actual type instead void *

* error reporting if the pcs method is inappropriate
2025-05-29 17:59:52 +05:30
Madsen, Jonathan fec74141b0 Fix to PR #413 HIP_RUNTIME_API_TABLE_STEP_VERSION 9 vs. 10 (#419)
Fix HIP_RUNTIME_API_TABLE_STEP_VERSION 9 vs. 10

- in rocm-6.4.x, hipLinkAddData, hipLinkAddFile, hipLinkComplete, hipLinkCreate, hipLinkDestroy are HIP_RUNTIME_API_TABLE_STEP_VERSION == 9
- in amd-staging, hipEventRecordWithFlags is HIP_RUNTIME_API_TABLE_STEP_VERSION == 9
  - this should fixed in amd-staging such that HIP_RUNTIME_API_TABLE_STEP_VERSION == 10

Co-authored-by: Jonathan R. Madsen <jonathanrmadsen@gmail.com>
2025-05-27 17:40:21 -05:00
Bhardwaj, Gopesh d910dded7d SWDEV-534297 Fixing build dependecies for python versions (#411)
* SWDEV-534297 Fixing build dependecies for python versions

* Addressing feedback

* Fixed bug and tests

* More changes after CMake learnings
2025-05-27 14:18:57 -05:00
Trowbridge, Ian b90ef494dd [SDK] Update HIP support for ROCm 7.0 (#413)
* Update HIP VERSION to 7.0.0, HIP_RUNTIME_API_TABLE_STEP_VERSION to 13

* Changed rocprofiler_config_interfaces.cmake to check version after finding package

* Update cmake/rocprofiler_config_interfaces.cmake

---------

Co-authored-by: Madsen, Jonathan <Jonathan.Madsen@amd.com>
2025-05-27 13:14:08 -05:00
Baraldi, Giovanni 3cb0c87f53 ATT Doc updates. Fix trace-decode return error. (#406)
* Doc updates. Some cleanup.

* Formatting

---------

Co-authored-by: Giovanni Baraldi <gbaraldi@amd.com>
2025-05-22 14:50:45 -05:00
Elwazir, Ammar e587a8b23a HSA API Addition in EXT Table (#407)
* HSA API Addition in EXT Table

* Adding the real new API trace capability

* Formatting fix
2025-05-21 18:39:31 -05:00
7b30f3f5e26d48061f873d04cc7e1d1f_amdeng 856491944b Add VGPR and SGPR counts to kernel trace file (#371)
Signed-off-by: Tim <Tim.Gu@Amd.com>
Co-authored-by: sonadeem <sohaib.nadeem@amd.com>
2025-05-21 08:55:48 -07:00
Madsen, Jonathan 14c2dc55ff [roctx] Python bindings for rocprofiler-sdk-roctx (#402)
* [roctx] Python bindings for rocprofiler-sdk-roctx

* Update CHANGELOG

---------

Co-authored-by: Jonathan R. Madsen <jonathanrmadsen@gmail.com>
2025-05-19 20:02:51 -05:00
Trowbridge, Ian afb27f3f1a Use Internal Correlation ID values for Kernel Rename Feature (#397)
* Updated kernel rename service to use internal correaltion IDs for external correlation IDs and kernel rename values

* Updated for review comments

* Changed if-condition in generateJSON.cpp to check if string view is empty before calling get_entry
2025-05-19 01:34:44 -05:00
Madsen, Jonathan 7166b1ab58 [rocprofv3] Add rocpd output support (part 1: prelude) (#401)
* [rocprofv3] Add rocpd output support (part 1: prelude)

- git submodules for sqlite3, GOTCHA, and pybind11
- HIP stream data
- rocprofiler_query_intercept_table_name(...)
- serialization load
- rocprofiler::sdk::get_perfetto_category(KindT)
- rocprofiler::sdk::parse::strip
- common library updates
  - md5sum
  - hasher
  - simple_timer
  - static_tl_object
  - get_process_start_time_ns(pid_t)
- output library updates
  - node_info
  - file_generator (generator is now virtual base class)
  - stream info updates

* Added submodules

* Code review updates

* Minor unused-but-set-X warning fixes

* Update CI

- install libsqlite3-dev package

* Update CI

- install libsqlite3-dev package

* Fix static thread-local object memory leak

- also fix signal handler chaining

* Remove URL from comment

* Remove page migration exception

* Enable ROCPROFILER_BUILD_SQLITE3 by default

- try find_package(SQLite3) first and then build when ROCPROFILER_BUILD_SQLITE3=ON

* Fix gotcha installation

- make install of target optional

* Validate tracing + counter collection dispatch data

- i.e. correlation ids, thread ids, timestamps

* Make find_package(SQLite3) optional

- ROCm CI does not have SQLite3 dev package installed and cannot build from source (missing tclsh)

* Fixes to tracing + counter collection test

* get_process_start_time_ns update

- original implementation did not work

* Fix pytest-packages test_perfetto_data for counter collection

- erroneous failure when used with same PMC + multiple agents

* cmake policy: option() honors normal variables

- for GOTCHA submodule

* Improve samples/api_buffered_tracing stability

- reduce likelihood of sporadic exception throw

* Update gotcha submodule

---------

Co-authored-by: Jonathan R. Madsen <jonathanrmadsen@gmail.com>
2025-05-18 20:11:26 -05:00
Baraldi, Giovanni 65786f619d [RSERP-1802] Add trace decoder to API (#398)
* Add trace decoder to API.

* Cleanup and activity

* Rename

* Minor fix

* Replace tt/TT with thread_trace/THREAD_TRACE

- public API types are not abbreviated

* Fix aliases

* Build system updates

- activate clang-tidy for all subfolders in lib
- fix addition of sources for att-tool

* Fix clang-tidy issues with lib/att-tool/counters.{hpp,cpp}

* Delete counters.cpp

* Formatting

---------

Co-authored-by: Giovanni Baraldi <gbaraldi@amd.com>
Co-authored-by: Jonathan R. Madsen <jonathanrmadsen@gmail.com>
2025-05-17 12:08:33 -07:00
Welton, Benjamin 33e43e66d3 [SDK] Standardize rocprofiler-sdk counter definition YAML schema (#370)
* Convert YAML Format

Convert YAML format and reader to properly read the YAML.

Comparison between output's from the YAML show only changes in ordering
of architectures (and ids).

* Test fixes

* Add script for converting the YAML schema to source/scripts

* Update documentation

* Change the extra counter code block to YAML

* Add missing new line at EOF

* remove name issues

---------

Co-authored-by: Benjamin Welton <bewelton@amd.com>
Co-authored-by: Jonathan R. Madsen <jonathanrmadsen@gmail.com>
2025-05-14 13:31:51 -05:00
Madsen, Jonathan 8a1ee46e47 [SDK] Fix double buffer data race (#394)
* Fix double buffer data race

- fixes relatively rare data race in double buffering scheme

In `rocprofiler::buffer::instance::emplace`, the `container::record_header_buffer::get_record_headers()` function returned a `std::vector<rocprofiler_record_header_t*>` and then invoked callback to tool. It was possible for that callback to still be executing while the buffer was being updated. This potentially introduced a scenario where the rocprofiler_record_header_t* was modified (or corrupted) before the tool processed the record. In rocprofv3, this would result in a "future" buffer record showing up among "past" buffer records. E.g., correlation id sequence of 1-15 where the buffer flushes after five values, could result in this during processing:
|     |     |     |     |      |
|:---:|:---:|:---:|:---:|:---:|
|  1 |  2 |  3 |  4 | 15 |
|  6 |  7 |  8 |  9 | 10 |
| 11 | 12 | 13 | 14 | 15 |

Because buffer A (of double buffering scheme) originally containing corr ids 1-5 stalled after process corr id 4 (e.g. write to disk), buffer B filled up with 6-10 and started flushing, causing a switch back to buffer A, and buffer A was filled with 11-15 by the time callback accessed what was originally corr id 5 but was now updated to corr id 15.

* Update CHANGELOG

* misc minor cleanup

---------

Co-authored-by: Jonathan R. Madsen <jonathanrmadsen@gmail.com>
2025-05-14 13:19:22 -05:00
Elwazir, Ammar 6f17da7ade [rocprofv3-benchmark] SDK and rocprofv3 Benchmarking Suite (#157)
* Adding Benchmarking Stg1

* config fix

* reset

* add jpeg and decode traces in iteration

* address comments benchmark config files.

* address comments.

* address comments.

* address comments: revert cntrl ctx.

* address comments: revert csv output.

* resolve merge conflits.

* format.

* build fix.

* fix hip runtime api traces.

* loop cb services.

* format.

* bug fix.

* Fix operator>

- public C++ comparison operator

* Update configuration options

- support selected regions (--selected-regions)
- support writing output config json (--output-config)
- update serialization data

* rocprofv3 tool library misc updates

- lambda for starting context
- support for writing config json

* Tool library updates

- Finished support for all benchmarking modes
- Added build spec support to config json

* Fix ROCPROFILER_SOVERSION

- this value should not be multiplied by 10,000

* Minor tweak to rocprofv3

* Benchmarking scripts

* formatting

* Fix duplicate include

* Add reproducible-dispatch-count test app

- used in benchmarking

* registration logging

- report number of registered contexts and active contexts after client initialization

* Serialize environment in rocprofv3 output config

* ROCPROFILER_BUILD_BENCHMARK CMake option

* Update benchmark SQL schema

- hash_id is text
- add md5sum to benchmarked_app
- remove app_id from benchmarked_sdk
- add sdk_id to benchmark_config
- separate hip_trace into hip_runtime_trace and hip_compiler_trace
- use INT instead of INTEGER for MySQL compatibility
- add count column in benchmark_statistics
- allow std_dev to be NULL in benchmark_statistics

* Update rocprofv3-benchmark.py

- use md5 instead of python hash (which includes random seed)
- use args.mysql_database
- compute md5sum of executable
- fix insert_benchmark_config
  - marker trace fixes
  - memory allocation fixes
  - split hip_trace into hip_{runtime,compiler}_trace
- remove app_id from benchmarked_sdk
- support warmup runs
- count field in benchmark_statistics

* Support launcher and environment in YAML

* Update reproducible-dispatch-count.cpp

- support mode which doesn't use hip event timing

* Misc rocprofv3-benchmark.py updates

- fix some MySQL support
- remove some unnecessary logging

* support mysql db.

* Format.

* Updated SQL input files

- moved benchmark_schema.sql to benchmark_table.sql
- added benchmark_views.sql
  - uses {{metric}} syntax for variable substitution

* cmake formatting

* update rocprofv3-benchmark.py

- benchmark config labels
- overhead views

* Encode rocprofv3-benchmark PID in rocprofv3 and timem output files

* Minor tweak to benchmark_views.sql

- include count
- reorder fields for readability

* split statements and use IS if values is NONE.

* use backtick instead of double quotes and add IS before NOT NULL.:

* Adding Mandelbrot Benchmark App

* Adding Dockerfile example

* Update dockerfile

* Update dockerfile

* [SDK] rocprofiler_query_external_correlation_id_request_kind_name

* Execution-profile benchmark mode

* Execution profile SQL support

* Rename mandlebrot folder + misc clang-tidy

* [rocprofv3-benchmark] Execution profile support

* Update installation

* add work dir when setting git revision, useful when building outside src.

* Set FULL_VERSION_STRING and ROCPROFILER_SDK_GIT_REVISION

- when benchmark folder is top-level

* Remove unused python packages from requirements.txt

* Use ldd/pyelftools to include linked libs for md5sum

- also add --filter-benchmark and --filter-rocprofv3 options
- support labeling the rocprofv3 options
- use more argparse groups
- more generic application of filters
- support variable substitution in environment, e.g. PATH=/some/path:$PATH

* Environment improvements

- improve reproducibility when env set via input file vs. shell
- support "environment-ignore" to remove environment variables

* Misc formatting

* Misc. fix

* use backticks for defining new columns name

* Support shuffling the order of benchmark modes/rocprofv3 args

* Address review comments

* Update Dockerfile

- rename to Dockerfile
- reduce to one layer

* Support docker build arg BRANCH

---------

Co-authored-by: Ammar ELWazir <aelwazir@amd.com>
Co-authored-by: Kandula, Venkateshwar reddy <Venkateshwarreddy.Kandula@amd.com>
Co-authored-by: Venkateshwar Reddy Kandula <vkandula@amd.com>
Co-authored-by: Madsen, Jonathan <Jonathan.Madsen@amd.com>
Co-authored-by: Jonathan R. Madsen <jonathanrmadsen@gmail.com>
2025-05-13 16:18:23 -05:00
Kuricheti, Mythreya f3ea8b1178 Fix fold expr (#389) 2025-05-09 14:18:19 -07:00
Kuricheti, Mythreya eaf3bbceb7 Add enum to string cxx utils (#153)
* Add enum to string cxx utils

* Add license header

* Address review comments

* Add version assertions

* Address review comments

* Fix thread trace header include

---------

Co-authored-by: Jonathan R. Madsen <jonathanrmadsen@gmail.com>
2025-05-05 21:02:13 -05:00
Welton, Benjamin 65f60bbb96 Remove unnecessary log line (#387)
Co-authored-by: Benjamin Welton <bewelton@amd.com>
2025-05-02 12:25:32 -07:00
Trowbridge, Ian e626df43eb Fix HIP Streams Duplication Error (#313)
* Fix stream duplication and fixed tests

* Added comments to explain stream.cpp code, change stream nullptr check to occur in update table to prevent readding null stream, simplified hip-streams bin file code, add destroyStreams to hip-streams bin file code

* Removed roctx from CMakeLists.txt

* Updated documentation

* Fix documentation

* Removed update_table for HIP compiler table and updated stream.cpp to remove support for HIP compiler table

* Added runtime initialization check for HIP

* Changed tool name, working on fixing memory management

* Added context for counter collection kernel rename combination

* Changed name from map to set and changed description

* Fix documentation description for group-by-queue

* Merged memory copy and kernel operations onto a single track when on the same stream

* Updated perfetto output to remove hardware information from track name to merge all memory copy and kernel operations on the same stream to the same track:

* Most pr comments addressed

* Added filter for counter collection and removed kernel buffer tracing hack

* Added PR comment fixes

---------

Co-authored-by: Madsen, Jonathan <Jonathan.Madsen@amd.com>
2025-05-01 00:56:15 -05:00
Madsen, Jonathan 4f03ebc360 [CI] Fix code coverage and thread sanitizer workflows (#378)
* Fix code coverage workflow

* Relocate rocprofv3 conversion test script + rename tests

- these are rocprofv3 tests and were not properly located and not properly named

* Fix thread sanitizer

---------

Co-authored-by: Jonathan R. Madsen <jonathanrmadsen@gmail.com>
2025-04-28 10:19:04 -05:00
Madsen, Jonathan 032c06db9a Fix evaulate_ast.evaulate_hybrid_counters test (#377)
- broken by #348

Co-authored-by: Jonathan R. Madsen <jonathanrmadsen@gmail.com>
2025-04-27 22:42:10 -05:00
Madsen, Jonathan 3580478426 Build system (libdw), correlation ID, and shebang fixes (#354)
* Fix compilation for output library

- link to targets for ATT (amd-comgr, dw, elf)

* Relax correlation ID retirement log failures

- only fail for correlation ID retirement underflow when building in CI mode

* Fix shebang for several files

- license was inserted before shebang in several places

* Update code coverage exclude folders for samples

* Tweak to agent tests

- test to make sure hsa agent is not the old value instead of testing that it is the new value

* Fix libdw include/link

---------

Co-authored-by: Jonathan R. Madsen <jonathanrmadsen@gmail.com>
2025-04-27 20:16:18 -05:00
Kandula, Venkateshwar reddy 06005c7f6b [SDK] SWDEV-524163 - Add error msg when accumulate is used on counters not from sq block. (#348)
* add error log when accumulate is used on counters not from sq block.

* Address comments.

---------

Co-authored-by: Venkateshwar Reddy Kandula <vkandula@amd.com>
2025-04-27 20:03:27 -05:00
Meserve, Mark 61307442f0 [SDK] Fix for hang in hsa_barrier (#316)
* SWDEV-515895: Fix for hang in hsa_barrier

- Root cause of hang is enqueue_packet using a completed barrier
  - This occurs because set_barrier does not correctly mark the barrier
    as complete.
- Fixed by consolidating duplicate code for how a barrier is:
  - Marked as complete
    - Added common function and trace message
  - Checked as complete
    - Removed internal completion tracking variable in favor of signal
- Added some log messages which were useful in tracking this hang
- Destroying an hsa_barrier now calls the provided completion callback

* formatting

* Fix hsa_barrier test

- Removes assumption that enqueue_packet always generates packets
- Add assertion that a complete barrier does not generate packets

* formatting

* Address review comments
2025-04-27 19:55:32 -05:00
Baraldi, Giovanni a8f3397069 SWDEV-528686: ATT fix for gfx12 s_wait_idle. Fixes for csv. Default to parse to trace. Fix for ROCR_VISIBLE_DEVICES. (#345)
* Fix for gfx12 s_wait_idle. Added wait field on att.csv

* Format and default to ATT to trace

* Update .mds

* No fatal error for invalid agent

* Tidy fixes

* Rename wait to idle, removed uneeded headers

* Remove unused traceID

* Tidy fix

* Fix csv output

* Formatting

* Fix tests

* Fix tests

* Fix for visible devices

* Review comment: Fix cmake

* Review suggestion

* Remove changelog/readme

* Review comments

* Review comment for CSV

* Formatting

---------

Co-authored-by: Giovanni Baraldi <gbaraldi@amd.com>
2025-04-25 11:49:16 -05:00
Vaddireddy, Sushma d1e9e3917e Grid dimensions update (#329)
* Grid dimensions update

* minor edit

* CI compilation fix

* Adding target_compile_definitions

* Updating changes as per suggestions

* Skip checks for older grid dimension values

---------

Co-authored-by: Sushma Vaddireddy <svaddire@amd.com>
2025-04-21 15:33:37 -05:00
Elwazir, Ammar 8baea19df7 Older Glibc doesn't have gettid (#349)
* Older Glibc doesn't have gettid

* Format fix

* Using internal common get_tid

---------

Co-authored-by: Ammar ELWazir <aelwazir@amd.com>
2025-04-21 10:22:50 -05:00
Nagaraj, Sriraksha 87badfbd15 [rocprofv3] signal handler fix (#332)
* rocprofv3: LD_PRELOAD for signal and sigaction

- wrappers around `signal` and `sigaction` to prevent applications which install signal handlers to replace the rocprofv3 signal handlers
- minor tweaks to buffer sizes (use page_size instead of
KiB)

* [DO NOT COMMIT] extra logging

* Switch git submodule url for perfetto

- use GitHub URL as this is more accessible

* Update ring_buffer<Tp>

- account for alignment padding

* Update buffered_output

- track number of bytes stored
- add nullptr checks

* Update tmp_file_buffer

- track number of bytes
- read_tmp_file does not create tmp file if it does not already exist

* Update tmp_file

- add exists member function for checking whether temporary file already exists
- tweak remove() implementation

* Update config.hpp

- add option to enable/disable signal handlers
- add option for minimum_output_bytes

* Make signal, sigaction functions visible

* rocprofv3 tool updates

- chained signals
- override the signal handler(s) installed by the application
- improve cleanup of temporary files
- support minimum output bytes

* Add commandline support

* fixing test

* minor fix

* minor fix

* fix clang issue

* fix

* Adding docs

* review comments

* review changes

* review

* YUV pulldown additions to rocdecode

* More rocdecode changes

---------

Co-authored-by: Jonathan R. Madsen <jonathanrmadsen@gmail.com>
Co-authored-by: Jonathan R. Madsen <Jonathan.Madsen@amd.com>
Co-authored-by: Benjamin Welton <bewelton@amd.com>
2025-04-17 21:10:52 -07:00
Baraldi, Giovanni 46818b0167 SWDEV-527202: Moving ATT to experimental (#335)
* Moving ATT to experimental

* Formatting + rebase

* Addressing review comments

* Formatting

* Update source/lib/att-tool/waitcnt/analysis.cpp

---------

Co-authored-by: Giovanni Baraldi <gbaraldi@amd.com>
Co-authored-by: Madsen, Jonathan <Jonathan.Madsen@amd.com>
2025-04-17 14:43:15 -05:00
Trowbridge, Ian d7c903654e Add buffer tracing header for rocdecode.hpp (#340)
* Add buffer tracing header for rocdecode.hpp

* Add new line for formatting
2025-04-16 13:07:44 -05:00
Kandula, Venkateshwar reddy 235a148ce6 [SDK] remove HIP_MEMSET_NODE_PARAMS for HIP step version to 13 (#343)
* Update api_args.h hip_memset_node_params to version 13

* Update format.hpp move version to 13 hip_memset_node_params
2025-04-16 10:34:48 -07:00
Kandula, Venkateshwar reddy 6cea857c6a [SDK] remove HIP_MEMSET_NODE_PARAMS for HIP step version >= 12. (#334)
* remove HIP_MEMSET_NODE_PARAMS for HIP step version >= 12.

* remove extra ifdef

* format.

---------

Co-authored-by: Venkateshwar Reddy Kandula <vkandula@amd.com>
2025-04-15 14:05:15 -07:00
Madsen, Jonathan c5a3edc3fa [Misc] Rework header includes (#311)
* Update header file includes

* Fix includes for lib/rocprofiler-sdk/hip/hip.hpp

* Minor touch ups

* Minor include improvements

* Doxygen tweak

---------

Co-authored-by: Jonathan R. Madsen <jonathanrmadsen@gmail.com>
2025-04-15 14:02:12 -07:00
Kandula, Venkateshwar reddy bc85151a51 SWDEV-524130: add reduced sum counters for new mi355 counters (#328)
add derived counter for td, tcc, ta.

Co-authored-by: Venkateshwar Reddy Kandula <vkandula@amd.com>
2025-04-15 13:37:28 -07:00
Welton, Benjamin f143333df0 Add SerializedAtomicRatio counter (#327)
Co-authored-by: Benjamin Welton <bewelton@amd.com>
2025-04-15 13:36:34 -07:00
Trowbridge, Ian 4fbcfd142c Copyright Compliance (#333)
* Added copyright information to requested files

* Formatting

* Fix bad function name error
2025-04-14 13:07:32 -05:00
Trowbridge, Ian 077723337a rocDecode Buffer Tracing Support (#315)
* Added buffer tracing support for rocdecode and updated tests to work with buffer tracing

* Updated perfetto to output args individually rather than as a string list

* Updated docstrings and operation type, changed OTF2 code to remove warning due to change in operation type

* Updated tests for review comments

* Test args exist and return value

* Updated to use string entry

* Change function name

* Updated PR to reflect review comments

* Updated for PR review comments

* Change function name
2025-04-11 21:56:36 +00:00
Kandula, Venkateshwar reddy a7f96dde29 SWDEV-524130: add missing mi355 counters and derived counters (#323)
* add missing counters from public doc.
;

* add reduce sum counter for mi355 tcc, tcp, ta.

---------

Co-authored-by: Venkateshwar Reddy Kandula <vkandula@amd.com>
2025-04-02 09:44:57 -07:00
Baraldi, Giovanni 48c672e23e SWDEV-523436: Fix logging of code object id=0. Add perfevent test. (#318)
* SWDEV-523436: Fix logging of code object id=0. Add perfevent test.

* Apply suggestions from code review

---------

Co-authored-by: Giovanni Baraldi <gbaraldi@amd.com>
2025-03-31 10:34:53 -07:00
Meserve, Mark a1fcdf7f83 Additional 1.0.0 changes (#317)
* Additional 1.0.0 changes

- Update VERSION
- Add beta compatibility for rocprofiler_agent_set_profile_callback_t

* Fix location of deprecated typedef rocprofiler_agent_set_profile_callback_t

* rocprofiler_record_counter_t -> rocprofiler_counter_record_t

* Experimental + deprecated annotations

* rocprofiler_record_dimension_info_t -> rocprofiler_counter_record_dimension_info_t

---------

Co-authored-by: Jonathan R. Madsen <jonathanrmadsen@gmail.com>
2025-03-26 02:12:03 -05:00
Welton, Benjamin 4cd121e27b [SDK] Release 1.0 Public API Modifications (#277)
* Make sure all structs/enums can be forward declared

* Updates to counter collection

- consistency updates and cleanup

* Conversion of dimension information to info struct

* Added deprecated folder

* Testing changes

* merge changes

* Fix shadowed variable

* Source code formatting

* Fix shadowed variable

* Update rocprofiler_counter_info_v1_t member names

* Split version.h into version.h and ext_version.h

- ext_version.h contains external version info, e.g. ROCPROFILER_HSA_API_TABLE_MAJOR_VERSION, ROCPROFILER_HSA_RUNTIME_VERSION
- this reduces amount of recompilation after a commit since version.h gets updated with the git revision

* profile_config -> counter_config

* EOF new line

* [Samples] Reduce header includes + reorg counter collection samples

* Misc compilation fixes

- shadowed variables
- use of [[deprecated("...")]] in C code
- unused variables

* Minor misc modifications

- use common:: instead of rocprofiler::common:: when inside rocprofiler namespace
- counters.cpp
  - move local anon namespace functions into rocprofiler::counters:: anon namespace
  - use std::string_view for get_static_string
  - const ref for get_static_ptr
  - misc namespace shortening

* [Public API] rocprofiler_get_version_triplet + rocprofiler_version_triplet_t

- struct rocprofiler_version_triplet_t containing fields for the major, minor, and patch version
- public API function: rocprofiler_get_version_triplet
- define C++ operators for rocprofiler_version_triplet_t
- C++ function compute_version_triplet

* [Tests] Improve async-copy-testing test

- relax constraints
- improve logging

* Update counter_config.h doxygen docs

* ROCPROFILER_SDK_BETA_COMPAT

- ppdef which helps with renaming when set to 1

* Remove spurious include

* Fix includes for cxx/version.hpp

* Doxygen fixes for rocprofiler_get_version and rocprofiler_get_version_triplet

* Public API Experimental Designation

- ROCPROFILER_SDK_EXPERIMENTAL added to experimental function
- "(experimental)" added to doxygen @brief entries

* Fix use of assert instead of static_assert in hip/stream.cpp

* Use typedef instead of define for rocprofiler_profile_config_id_t

* Use inline rocprofiler_{create,destroy}_profile_config instead of ppdef

- added <rocprofiler-sdk/deprecated/profile_config.h>

* Doxygen for rocprofiler_{create,destroy}_profile_config

* ROCPROFILER_SDK_DEPRECATED_WARNINGS

* Temporarily comment out ROCPROFILER_SDK_DEPRECATED_WARNINGS=1

* cmake formatting

* Misc variable renaming in samples and tests

* Fix declarations of types

* Fix hip stream tracing service struct name

- rocprofiler_callback_tracing_stream_handle_data_t renamed to rocprofiler_callback_tracing_hip_stream_api_data_t

* Rename "HIP_STREAM_API" to "HIP_STREAM"

---------

Co-authored-by: Jonathan R. Madsen <jonathanrmadsen@gmail.com>
Co-authored-by: Benjamin Welton <bewelton@amd.com>
2025-03-24 12:07:33 +05:30
Trowbridge, Ian cd4676ae6f [SDK] Callback Tracing Iterate Args Support for rocDecode (#294)
Callback tracing for rocdecode created
2025-03-23 19:15:30 -05:00
Madsen, Jonathan e33dff7ad0 [SDK][rocprofv3] Buffer tracing records with args (HIP) (#285)
* [SDK][rocprofv3] HIP API buffer records with args (ext)

- New buffer tracing domain(s) for HIP APIs which include the arguments and the return value in the buffer records
- Update HIP stream support for extended HIP buffer tracing
- Update rocprofv3 tool library and output library to use extended HIP buffer tracing recods

* Update stream.cpp

- handle hipStream_t address being reused for a new stream

* Update doxygen docs for rocprofiler_iterate_buffer_tracing_record_args

* Update rocprofv3 tool.cpp

- configure buffer tracing services with HIP_*_API_EXT variants
- tweak logging level for hip_stream_display_callback

* Fix validation tests

- add HIP_RUNTIME_API_EXT and HIP_COMPILER_API_EXT to valid domain names

* Serialization support for buffer tracing args

* Disable stream service for __hipPopCallConfiguration

- this is interpreted as a stream create but it doesn't create a stream

* Fix execute_buffer_record_emplace for HIP extended contexts

* Add uint64_t_retval to rocprofiler_hip_api_retval_t union

- reading in hipError_t_retval during serialization of pointer return value causes undefined behavior

* Fix compilation warning about unused but set parameter

- in hip/stream.cpp

* Add synchronization for async_copy_data

* Fix compilation error

* Fix compilation error

---------

Co-authored-by: Jonathan R. Madsen <jonathanrmadsen@gmail.com>
2025-03-22 19:57:32 -05:00
Madsen, Jonathan 2d072f9217 [CI] Miscellaneous Testing Updates (#305)
* Add rocprofiler-sdk-utilities.cmake

- contains cmake function rocprofiler_sdk_get_gfx_architectures

* Update perfetto_reader.py

- fix hash collision

* Update project names in tests folders

- rocprofiler-tests -> rocprofiler-sdk-tests

* Fix incorrect allocation-error handling

* [CI] Disable openmp tests for navi2, navi3, and navi4

* Suppress leaks by omptarget and llvm

---------

Co-authored-by: Jonathan R. Madsen <jonathanrmadsen@gmail.com>
2025-03-22 18:51:42 -05:00
Indic, Vladimir 49ce79a5b5 [SDK][rocprofv3] MI300 Stochastic PC sampling (#92)
* MI300 Stochastic PC sampling SDK API implementation

* ROCProfV3: Stochastic PC sampling Support (#94)

* ROCProfV3: MI300 Stochastic PC sampling initial draft

* ROCProfV3: Initial Stochastic PC sampling Tests (#95)

ROCProfV3: Initial Stochastic PC sampling tests

* Update rocprofiler_pc_sampling_record_stochastic_v0_t

- update doxygen docs for members
- replace rocprofiler_correlation_id_t with rocprofiler_async_correlation_id_t

* Relax the check in JSON tests

* drain PC sampling buffer during finalize_rocprofv3

* Increase timeout for "Test Install Build" step

- 10 minutes -> 20 minutes
- "Test Installed Packages" has 20 minutes so "Test Install Build" should also

---------

Co-authored-by: Jonathan R. Madsen <jonathanrmadsen@gmail.com>
2025-03-21 14:40:45 -05:00
Bhardwaj, Gopesh c06feccf2a Potential fix for code scanning alert no. 24: Use of potentially dangerous function (#220)
* Potential fix for code scanning alert no. 24: Use of potentially dangerous function

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>

* clang-format fix

* use std::localtime_r instead of localtime.

Co-authored-by: Madsen, Jonathan <Jonathan.Madsen@amd.com>

* localtime_r is defined in global namespace.

---------

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Co-authored-by: Kandula, Venkateshwar reddy <Venkateshwarreddy.Kandula@amd.com>
Co-authored-by: Madsen, Jonathan <Jonathan.Madsen@amd.com>
2025-03-21 14:21:49 +05:30
Kuricheti, Mythreya f27f76716e [SDK] Add Stack IDs (#269)
* Add Stack IDs

* Add memcpy test

* Add async corr id record

* Async events use `rocprofiler_async_correlation_id_t`
* Sync events use `rocprofiler_correlation_id_t`

* Update ATT to use asnyc IDs

* Review comments
2025-03-21 00:52:48 -05:00
Vaddireddy, Sushma ae0db8cee5 [SDK] Model Name fix for rocprofiler_lib.agent (#298)
* Model Name fix for rocprofiler_lib.agent

* fixing format

* formatting source

* Adding comments and example

---------

Co-authored-by: Sushma Vaddireddy <svaddire@amd.com>
2025-03-20 22:06:53 -05:00
Madsen, Jonathan 66e9dc54e9 [SDK] Memory copy src and dst addresses (#282)
Co-authored-by: Jonathan R. Madsen <jonathanrmadsen@gmail.com>
2025-03-20 21:10:19 -05:00
Kuricheti, Mythreya 6b6e17973f [CI] Disable debug annotations for page-migration test (#291)
fix: Disable debug annotations in test

Fixup of PR: disable perfetto debug annotations in json tool
2025-03-20 20:55:26 -05:00
Madsen, Jonathan 91f7f42104 [SDK] Update finalization and correlation ID retirement (#281)
* Update finalization and correlation ID retirement

- directly invoke finalize if only one client
- correlation_id_finalize

* Address PR comments

* Improve logging for correlation_id_finalize

* Fix correlation ID handling in memory allocation service

* Fix clang-tidy issues in hsa-memory-allocation test exe

---------

Co-authored-by: Jonathan R. Madsen <jonathanrmadsen@gmail.com>
2025-03-20 16:59:23 -05:00