Rocprofiler changes to enable Tracer tests in CI

Change-Id: I4cd3a0f832f267dfd32175212ee2953c088e4d03


[ROCm/rocprofiler commit: 971cad0cf5]
Tento commit je obsažen v:
gobhardw
2023-06-23 20:49:04 +05:30
rodič 90d27bbec4
revize 01c7bd0573
2 změnil soubory, kde provedl 15 přidání a 4 odebrání
+9
Zobrazit soubor
@@ -28,6 +28,8 @@ file(GLOB GTEST_MAIN_SRC_FILE ${GTEST_MAIN_DIR}/*.cpp)
set_source_files_properties(apps/hello_world.cpp PROPERTIES HIP_SOURCE_PROPERTY_FORMAT 1)
hip_add_executable(tracer_hip_helloworld apps/hello_world.cpp)
set_target_properties(tracer_hip_helloworld PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/tests-v2/featuretests/tracer/apps")
target_link_options(tracer_hip_helloworld PRIVATE "-Wl,--build-id=md5")
install(TARGETS tracer_hip_helloworld RUNTIME DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}/tests/featuretests/tracer/apps COMPONENT tests)
#hsa-mem_async_copy and async_copy_on_engine
set_source_files_properties(apps/copy_on_engine.cpp PROPERTIES HIP_SOURCE_PROPERTY_FORMAT 1)
@@ -48,4 +50,11 @@ target_include_directories(runTracerFeatureTests PRIVATE ${PROJECT_SOURCE_DIR} $
target_link_libraries(runTracerFeatureTests PRIVATE hsa-runtime64::hsa-runtime64
GTest::gtest GTest::gtest_main
Threads::Threads dl stdc++fs)
target_link_options(runTracerFeatureTests PRIVATE "-Wl,--build-id=md5")
install(TARGETS runTracerFeatureTests RUNTIME DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}/tests COMPONENT tests)
add_dependencies(tests runTracerFeatureTests)
install(
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/apps/goldentraces/
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}/tests/featuretests/tracer/apps/goldentraces
COMPONENT tests)
+6 -4
Zobrazit soubor
@@ -23,6 +23,7 @@ THE SOFTWARE.
#include <ostream>
#include <vector>
#include "tracer_gtest.h"
#include "src/utils/logger.h"
std::string running_path;
std::string lib_path;
@@ -34,7 +35,8 @@ std::string profiler_api_lib_path = "";
static void init_test_path() {
if (is_installed_path()) {
running_path = "share/rocprofiler/tracer/runTracerFeatureTests";
INFO_LOGGING("operating from /opt/rocm");
running_path = "share/rocprofiler/tests/runTracerFeatureTests";
lib_path = "lib/rocprofiler/librocprofiler_tool.so";
golden_trace_path = "share/rocprofiler/tests/featuretests/tracer/apps/goldentraces/";
test_app_path = "share/rocprofiler/tests/featuretests/tracer/apps/";
@@ -42,6 +44,7 @@ static void init_test_path() {
binary_path = "bin/rocprofv2";
profiler_api_lib_path = "/lib";
} else {
INFO_LOGGING("operating from ./build");
running_path = "tests-v2/featuretests/tracer/runTracerFeatureTests";
lib_path = "librocprofiler_tool.so";
golden_trace_path = "tests-v2/featuretests/tracer/apps/goldentraces/";
@@ -120,9 +123,8 @@ void ApplicationParser::GetKernelInfoForGoldenOutput(
const char* app_name, std::string file_name,
std::vector<tracer_kernel_info_t>* kernel_info_output) {
std::string entry;
std::string path = GetRunningPath("runTracerFeatureTests");
entry = path.append("apps/goldentraces/") + file_name;
std::string path = GetRunningPath(running_path);
entry = path.append(golden_trace_path) + file_name;
// parse kernel info fields for golden output
ParseKernelInfoFields(entry, kernel_info_output);
}