JSON schema + JSON node vs. Perfetto category consistency (#869)
* Fix schema differences b/t JSON and perfetto - "kernel_dispatches" (JSON) vs. "kernel_dispatch" (Perfetto) -> "kernel_dispatch" - "scratch_api" (JSON) -> "scratch_memory" * Update include/rocprofiler-sdk/cxx/serialization.hpp - remove unnecessary includes causing circular dependency * rocprofv3 docs - Output formats - JSON schema * Spelling fix * Update schema descriptions * Improve assert log in test_perfetto_data
Цей коміт міститься в:
зафіксовано
GitHub
джерело
957bb7a4e5
коміт
b4dc4f8e92
@@ -37,10 +37,10 @@ def test_data_structure(input_data):
|
||||
node_exists("hsa_api_traces", sdk_data["callback_records"])
|
||||
node_exists("hip_api_traces", sdk_data["callback_records"], 0)
|
||||
node_exists("marker_api_traces", sdk_data["callback_records"])
|
||||
node_exists("kernel_dispatches", sdk_data["callback_records"])
|
||||
node_exists("kernel_dispatch", sdk_data["callback_records"])
|
||||
|
||||
node_exists("names", sdk_data["buffer_records"])
|
||||
node_exists("kernel_dispatches", sdk_data["buffer_records"])
|
||||
node_exists("kernel_dispatch", sdk_data["buffer_records"])
|
||||
node_exists("memory_copies", sdk_data["buffer_records"], 0)
|
||||
node_exists("hsa_api_traces", sdk_data["buffer_records"])
|
||||
node_exists("hip_api_traces", sdk_data["buffer_records"], 0)
|
||||
@@ -95,7 +95,7 @@ def test_timestamps(input_data):
|
||||
for itr in sdk_data["buffer_records"][titr]:
|
||||
assert itr["start_timestamp"] <= itr["end_timestamp"]
|
||||
|
||||
for titr in ["kernel_dispatches", "memory_copies"]:
|
||||
for titr in ["kernel_dispatch", "memory_copies"]:
|
||||
for itr in sdk_data["buffer_records"][titr]:
|
||||
assert itr["start_timestamp"] < itr["end_timestamp"], f"[{titr}] {itr}"
|
||||
assert itr["correlation_id"]["internal"] > 0, f"[{titr}] {itr}"
|
||||
@@ -123,7 +123,7 @@ 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"]:
|
||||
for itr in sdk_data["buffer_records"]["kernel_dispatch"]:
|
||||
elapsed = itr["end_timestamp"] - itr["start_timestamp"]
|
||||
runtime_data.append(elapsed) # in nanoseconds
|
||||
|
||||
@@ -148,7 +148,7 @@ def test_internal_correlation_ids(input_data):
|
||||
api_corr_ids_sorted = sorted(api_corr_ids)
|
||||
api_corr_ids_unique = list(set(api_corr_ids))
|
||||
|
||||
for itr in sdk_data["buffer_records"]["kernel_dispatches"]:
|
||||
for itr in sdk_data["buffer_records"]["kernel_dispatch"]:
|
||||
assert itr["correlation_id"]["internal"] in api_corr_ids_unique
|
||||
|
||||
for itr in sdk_data["buffer_records"]["memory_copies"]:
|
||||
@@ -174,7 +174,7 @@ def test_retired_correlation_ids(input_data):
|
||||
api_corr_ids[corr_id] = itr
|
||||
|
||||
async_corr_ids = {}
|
||||
for titr in ["kernel_dispatches", "memory_copies"]:
|
||||
for titr in ["kernel_dispatch", "memory_copies"]:
|
||||
for itr in sdk_data["buffer_records"][titr]:
|
||||
corr_id = itr["correlation_id"]["internal"]
|
||||
assert corr_id not in async_corr_ids.keys()
|
||||
@@ -226,7 +226,7 @@ def test_external_correlation_ids(input_data):
|
||||
assert itr["thread_id"] in extern_corr_ids, f"[{titr}] {itr}"
|
||||
assert itr["correlation_id"]["external"] in extern_corr_ids, f"[{titr}] {itr}"
|
||||
|
||||
for titr in ["kernel_dispatches", "memory_copies"]:
|
||||
for titr in ["kernel_dispatch", "memory_copies"]:
|
||||
for itr in sdk_data["buffer_records"][titr]:
|
||||
assert itr["correlation_id"]["external"] > 0, f"[{titr}] {itr}"
|
||||
assert itr["correlation_id"]["external"] in extern_corr_ids, f"[{titr}] {itr}"
|
||||
@@ -251,10 +251,10 @@ def test_kernel_ids(input_data):
|
||||
assert payload["kernel_id"] in symbol_info.keys()
|
||||
assert payload["kernel_name"] == symbol_info[kern_id]["kernel_name"]
|
||||
|
||||
for itr in sdk_data["buffer_records"]["kernel_dispatches"]:
|
||||
for itr in sdk_data["buffer_records"]["kernel_dispatch"]:
|
||||
assert itr["dispatch_info"]["kernel_id"] in symbol_info.keys()
|
||||
|
||||
for itr in sdk_data["callback_records"]["kernel_dispatches"]:
|
||||
for itr in sdk_data["callback_records"]["kernel_dispatch"]:
|
||||
assert itr["payload"]["dispatch_info"]["kernel_id"] in symbol_info.keys()
|
||||
|
||||
|
||||
@@ -262,17 +262,17 @@ def test_kernel_dispatch_ids(input_data):
|
||||
data = input_data
|
||||
sdk_data = data["rocprofiler-sdk-json-tool"]
|
||||
|
||||
num_dispatches = len(sdk_data["buffer_records"]["kernel_dispatches"])
|
||||
num_cb_dispatches = len(sdk_data["callback_records"]["kernel_dispatches"])
|
||||
num_dispatches = len(sdk_data["buffer_records"]["kernel_dispatch"])
|
||||
num_cb_dispatches = len(sdk_data["callback_records"]["kernel_dispatch"])
|
||||
|
||||
assert num_cb_dispatches == (3 * num_dispatches)
|
||||
|
||||
bf_seq_ids = []
|
||||
for itr in sdk_data["buffer_records"]["kernel_dispatches"]:
|
||||
for itr in sdk_data["buffer_records"]["kernel_dispatch"]:
|
||||
bf_seq_ids.append(itr["dispatch_info"]["dispatch_id"])
|
||||
|
||||
cb_seq_ids = []
|
||||
for itr in sdk_data["callback_records"]["kernel_dispatches"]:
|
||||
for itr in sdk_data["callback_records"]["kernel_dispatch"]:
|
||||
cb_seq_ids.append(itr["payload"]["dispatch_info"]["dispatch_id"])
|
||||
|
||||
bf_seq_ids = sorted(bf_seq_ids)
|
||||
|
||||
Посилання в новій задачі
Заблокувати користувача