Kernel Tracing Fix (#439)

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

- switch using the kernel_pkt.kernel_dispatch.completion_signal instead of interrupt signal for getting the dispatch time

* Update tests/kernel-tracing/validate.py

- add verification of total runtime collected in test_timestamps
  - the sum of the runtime of all the kernels in reproducible-runtime should be ~1 sec +/- 10%

* Remove include/rocprofiler-sdk/rocprofiler_plugin.h

* Update CI workflow

- update actions/cache@v3 -> v4
- actions/cache/save@v3 -> v4
- thollander/actions-comment-pull-request@v2 -> v2.4.3

* Update pytest.ini

- change default options to one that is more verbose

* Update tests/kernel-tracing/CMakeLists.txt

- skip test_total_runtime when Address or Thread Sanitizer enabled
  - overhead skews the results

* Update tests/kernel-tracing/validate.py

- separate test_total_runtime test
This commit is contained in:
Jonathan R. Madsen
2024-01-30 14:52:17 -06:00
committed by GitHub
parent 3f39339926
commit aaff4976d2
10 changed files with 35 additions and 152 deletions
+14
View File
@@ -74,6 +74,20 @@ def test_timestamps(input_data):
assert api_end <= itr["end_timestamp"]
def test_total_runtime(input_data):
sdk_data = input_data["rocprofiler-sdk-json-tool"]
runtime_data = []
for itr in sdk_data["buffer_records"]["kernel_dispatches"]:
elapsed = itr["end_timestamp"] - itr["start_timestamp"]
runtime_data.append(elapsed) # in nanoseconds
expected_runtime = 1.0e3 # one second in milliseconds
assert (sum(runtime_data) * 1.0e-6) >= (0.9 * expected_runtime)
assert (sum(runtime_data) * 1.0e-6) <= (1.1 * expected_runtime)
def test_internal_correlation_ids(input_data):
data = input_data
sdk_data = data["rocprofiler-sdk-json-tool"]