Skip to content

Commit 88e23bf

Browse files
committed
move annotation test (w/ --annotate-args) separate from original test
1 parent 826c45a commit 88e23bf

File tree

4 files changed

+69
-12
lines changed

4 files changed

+69
-12
lines changed

projects/rocprofiler-sdk/tests/pytest-packages/tests/rocprofv3.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -575,9 +575,10 @@ def test_perfetto_hip_event_annotations(pftrace_data, pftrace_filename):
575575

576576
result = reader.query_tp(query)
577577

578-
# Check if we found any event handle annotations
579-
if result.empty:
580-
pytest.skip("No HIP event API calls with event annotations found. ")
578+
# Annotations must exist - perfetto was generated with --annotate-args
579+
assert (
580+
not result.empty
581+
), "No HIP event annotations found - --annotate-args may be broken"
581582

582583
print(f"\n{len(result)} HIP event argument annotations found:")
583584
print(result.to_string())

projects/rocprofiler-sdk/tests/rocprofv3/rocpd/CMakeLists.txt

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,8 @@ rocprofiler_add_integration_execute_test(
126126
rocprofiler_add_integration_execute_test(
127127
rocprofv3-test-rocpd-perfetto-generation
128128
COMMAND
129-
${Python3_EXECUTABLE} -m rocpd convert -f pftrace --kernel-rename --annotate-args
130-
-d ${CMAKE_CURRENT_BINARY_DIR}/rocpd-output-data -i
129+
${Python3_EXECUTABLE} -m rocpd convert -f pftrace --kernel-rename -d
130+
${CMAKE_CURRENT_BINARY_DIR}/rocpd-output-data -i
131131
${CMAKE_CURRENT_BINARY_DIR}/rocpd-input-data/out_results.db
132132
DEPENDS rocprofiler-sdk::rocprofv3
133133
TIMEOUT 120
@@ -137,6 +137,20 @@ rocprofiler_add_integration_execute_test(
137137
FIXTURES_SETUP rocprofv3-test-rocpd-generation
138138
FIXTURES_REQUIRED rocprofv3-test-rocpd)
139139

140+
rocprofiler_add_integration_execute_test(
141+
rocprofv3-test-rocpd-perfetto-generation-annotations
142+
COMMAND
143+
${Python3_EXECUTABLE} -m rocpd convert -f pftrace --kernel-rename --annotate-args
144+
-d ${CMAKE_CURRENT_BINARY_DIR}/rocpd-output-data-annotations -i
145+
${CMAKE_CURRENT_BINARY_DIR}/rocpd-input-data/out_results.db
146+
DEPENDS rocprofiler-sdk::rocprofv3
147+
TIMEOUT 120
148+
LABELS "integration-tests;rocpd"
149+
PRELOAD "${ROCPROFILER_MEMCHECK_PRELOAD_ENV_VALUE}"
150+
ENVIRONMENT "${rocprofv3-rocpd-env}"
151+
FIXTURES_SETUP rocprofv3-test-rocpd-generation-annotations
152+
FIXTURES_REQUIRED rocprofv3-test-rocpd)
153+
140154
rocprofiler_add_integration_execute_test(
141155
rocprofv3-test-rocpd-perfetto-generation-multiproc
142156
COMMAND
@@ -239,6 +253,17 @@ rocprofiler_add_integration_validate_test(
239253
LABELS "integration-tests;rocpd"
240254
FIXTURES_REQUIRED rocprofv3-test-rocpd-generation)
241255

256+
rocprofiler_add_integration_validate_test(
257+
rocprofv3-test-rocpd-annotations
258+
TEST_PATHS validate_annotations.py
259+
COPY conftest.py
260+
CONFIG pytest.ini
261+
ARGS --pftrace-input
262+
${CMAKE_CURRENT_BINARY_DIR}/rocpd-output-data-annotations/out_results.pftrace
263+
TIMEOUT 120
264+
LABELS "integration-tests;rocpd"
265+
FIXTURES_REQUIRED rocprofv3-test-rocpd-generation-annotations)
266+
242267
#########################################################################################
243268
#
244269
# Package generation

projects/rocprofiler-sdk/tests/rocprofv3/rocpd/validate.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,6 @@ def test_csv_data(csv_data, json_data):
7171
)
7272

7373

74-
def test_hip_event_annotations(pftrace_data, request):
75-
import rocprofiler_sdk.tests.rocprofv3 as rocprofv3
76-
77-
pftrace_filename = request.config.getoption("--pftrace-input")
78-
rocprofv3.test_perfetto_hip_event_annotations(pftrace_data, pftrace_filename)
79-
80-
8174
if __name__ == "__main__":
8275
exit_code = pytest.main(["-x", __file__] + sys.argv[1:])
8376
sys.exit(exit_code)
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#!/usr/bin/env python3
2+
3+
# MIT License
4+
#
5+
# Copyright (c) 2024-2025 Advanced Micro Devices, Inc. All rights reserved.
6+
#
7+
# Permission is hereby granted, free of charge, to any person obtaining a copy
8+
# of this software and associated documentation files (the "Software"), to deal
9+
# in the Software without restriction, including without limitation the rights
10+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11+
# copies of the Software, and to permit persons to whom the Software is
12+
# furnished to do so, subject to the following conditions:
13+
#
14+
# The above copyright notice and this permission notice shall be included in
15+
# all copies or substantial portions of the Software.
16+
#
17+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23+
# THE SOFTWARE.
24+
25+
import sys
26+
import pytest
27+
28+
29+
def test_hip_event_annotations(pftrace_data, request):
30+
import rocprofiler_sdk.tests.rocprofv3 as rocprofv3
31+
32+
pftrace_filename = request.config.getoption("--pftrace-input")
33+
rocprofv3.test_perfetto_hip_event_annotations(pftrace_data, pftrace_filename)
34+
35+
36+
if __name__ == "__main__":
37+
exit_code = pytest.main(["-x", __file__] + sys.argv[1:])
38+
sys.exit(exit_code)

0 commit comments

Comments
 (0)