SWDEV-396239: Automatic ISA dump from ATT
Change-Id: Ia66346c0048b779487157961ead08d7567c9153a
This commit is contained in:
committed by
Giovanni Baraldi
orang tua
c94d4c3e81
melakukan
a5555ac45f
@@ -184,11 +184,15 @@ file(GLOB ROCPROFILER_TRACER_SRC_FILES
|
||||
${PROJECT_SOURCE_DIR}/src/core/session/tracer/*.cpp)
|
||||
file(GLOB ROCPROFILER_ROCTRACER_SRC_FILES
|
||||
${PROJECT_SOURCE_DIR}/src/core/session/tracer/src/*.cpp)
|
||||
file(GLOB ROCPROFILER_ATT_SRC_FILES ${PROJECT_SOURCE_DIR}/src/core/session/att/att.cpp)
|
||||
set(ROCPROFILER_ATT_SRC_FILES
|
||||
${PROJECT_SOURCE_DIR}/src/core/session/att/att.cpp)
|
||||
file(GLOB ROCPROFILER_CLASS_SRC_FILES
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/rocprofiler_singleton.cpp)
|
||||
file(GLOB ROCPROFILER_SPM_SRC_FILES ${PROJECT_SOURCE_DIR}/src/core/session/spm/spm.cpp)
|
||||
|
||||
set(CORE_ISA_CAPTURE_DIR ${PROJECT_SOURCE_DIR}/src/core/isa_capture)
|
||||
file(GLOB CORE_ISA_CAPTURE_SRC_FILES ${CORE_ISA_CAPTURE_DIR}/*.cpp)
|
||||
|
||||
set(CORE_HARDWARE_DIR ${PROJECT_SOURCE_DIR}/src/core/hardware)
|
||||
file(GLOB CORE_HARDWARE_SRC_FILES ${CORE_HARDWARE_DIR}/*.cpp)
|
||||
|
||||
@@ -265,6 +269,7 @@ add_library(
|
||||
${ROCPROFILER_CLASS_SRC_FILES}
|
||||
${ROCPROFILER_PROFILER_SRC_FILES}
|
||||
${ROCPROFILER_ATT_SRC_FILES}
|
||||
${CORE_ISA_CAPTURE_SRC_FILES}
|
||||
${CORE_HARDWARE_SRC_FILES}
|
||||
${CORE_HSA_SRC_FILES}
|
||||
${ROCPROFILER_SPM_SRC_FILES}
|
||||
@@ -326,6 +331,8 @@ if(ASAN)
|
||||
stdc++
|
||||
stdc++fs
|
||||
amd_comgr
|
||||
dw
|
||||
elf
|
||||
${PCIACCESS_LIBRARIES})
|
||||
else()
|
||||
target_link_options(
|
||||
@@ -343,6 +350,8 @@ else()
|
||||
stdc++
|
||||
stdc++fs
|
||||
amd_comgr
|
||||
dw
|
||||
elf
|
||||
${PCIACCESS_LIBRARIES})
|
||||
endif()
|
||||
|
||||
|
||||
@@ -38,5 +38,10 @@ global: OnLoad;
|
||||
rocprofiler_device_profiling_session_poll;
|
||||
rocprofiler_device_profiling_session_stop;
|
||||
rocprofiler_device_profiling_session_destroy;
|
||||
rocprofiler_codeobj_capture_get;
|
||||
rocprofiler_codeobj_capture_create;
|
||||
rocprofiler_codeobj_capture_free;
|
||||
rocprofiler_codeobj_capture_start;
|
||||
rocprofiler_codeobj_capture_stop;
|
||||
local: *;
|
||||
};
|
||||
@@ -8,6 +8,7 @@
|
||||
#include "src/core/hsa/hsa_support.h"
|
||||
#include "src/api/rocprofiler_singleton.h"
|
||||
#include "src/utils/helper.h"
|
||||
#include "src/core/isa_capture/code_object_track.hpp"
|
||||
|
||||
// TODO(aelwazir): change that to adapt with our own Exception
|
||||
// What about outside exceptions and callbacks exceptions!!
|
||||
@@ -543,6 +544,59 @@ rocprofiler_device_profiling_session_destroy(rocprofiler_session_id_t session_id
|
||||
API_METHOD_SUFFIX
|
||||
}
|
||||
|
||||
ROCPROFILER_API rocprofiler_status_t
|
||||
rocprofiler_codeobj_capture_get(rocprofiler_record_id_t id,
|
||||
rocprofiler_codeobj_symbols_t* symbols) {
|
||||
API_METHOD_PREFIX
|
||||
try {
|
||||
*symbols = codeobj_record::get_capture(id);
|
||||
} catch(const std::out_of_range& e) {
|
||||
return ROCPROFILER_STATUS_ERROR_INVALID_ARGUMENTS;
|
||||
}
|
||||
API_METHOD_SUFFIX
|
||||
}
|
||||
|
||||
ROCPROFILER_API rocprofiler_status_t
|
||||
rocprofiler_codeobj_capture_create(
|
||||
rocprofiler_record_id_t* id,
|
||||
rocprofiler_codeobj_capture_mode_t mode,
|
||||
uint64_t userdata
|
||||
) {
|
||||
API_METHOD_PREFIX
|
||||
id->handle = rocprofiler::GetROCProfilerSingleton()->GetUniqueRecordId();
|
||||
codeobj_record::make_capture(*id, mode, userdata);
|
||||
API_METHOD_SUFFIX
|
||||
}
|
||||
|
||||
ROCPROFILER_API rocprofiler_status_t
|
||||
rocprofiler_codeobj_capture_free(rocprofiler_record_id_t id) {
|
||||
API_METHOD_PREFIX
|
||||
codeobj_record::free_capture(id);
|
||||
API_METHOD_SUFFIX
|
||||
}
|
||||
|
||||
ROCPROFILER_API rocprofiler_status_t
|
||||
rocprofiler_codeobj_capture_start(rocprofiler_record_id_t id) {
|
||||
API_METHOD_PREFIX
|
||||
try {
|
||||
codeobj_record::start_capture(id);
|
||||
} catch(const std::out_of_range& e) {
|
||||
return ROCPROFILER_STATUS_ERROR_INVALID_ARGUMENTS;
|
||||
}
|
||||
API_METHOD_SUFFIX
|
||||
}
|
||||
|
||||
ROCPROFILER_API rocprofiler_status_t
|
||||
rocprofiler_codeobj_capture_stop(rocprofiler_record_id_t id) {
|
||||
API_METHOD_PREFIX
|
||||
try {
|
||||
codeobj_record::stop_capture(id);
|
||||
} catch(const std::out_of_range& e) {
|
||||
return ROCPROFILER_STATUS_ERROR_INVALID_ARGUMENTS;
|
||||
}
|
||||
API_METHOD_SUFFIX
|
||||
}
|
||||
|
||||
|
||||
static bool started{false};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user