Sync with rocprofiler updates (#26)
- Update rocprofiler_configure prototype - add compile_commands.json to .gitignore
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
33b19051d2
Коммит
5a6ac895d1
@@ -34,3 +34,4 @@
|
||||
# Build directories
|
||||
/build*
|
||||
/.cache
|
||||
/compile_commands.json
|
||||
|
||||
@@ -20,8 +20,8 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
rocprofiler_register_add_option(ROCPROFILER_REGISTER_BUILD_TESTS
|
||||
"Enable building the tests" OFF)
|
||||
rocprofiler_register_add_option(ROCPROFILER_REGISTER_BUILD_SAMPLES "Enable building the
|
||||
code samples" OFF)
|
||||
rocprofiler_register_add_option(ROCPROFILER_REGISTER_BUILD_SAMPLES
|
||||
"Enable building the code samples" OFF)
|
||||
rocprofiler_register_add_option(ROCPROFILER_REGISTER_BUILD_CI
|
||||
"Enable continuous integration additions" OFF ADVANCED)
|
||||
rocprofiler_register_add_option(ROCPROFILER_REGISTER_ENABLE_CLANG_TIDY
|
||||
|
||||
@@ -22,20 +22,33 @@
|
||||
|
||||
#include <rocprofiler-register/version.h>
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef int (*rocprofiler_configure_callback_t)(void*);
|
||||
typedef struct
|
||||
{
|
||||
const char* name; ///< clients should set this value for debugging
|
||||
const uint32_t handle; ///< internal handle
|
||||
} rocprofiler_client_id_t;
|
||||
|
||||
typedef void (*rocprofiler_client_finalize_t)(rocprofiler_client_id_t);
|
||||
|
||||
typedef int (*rocprofiler_tool_initialize_t)(rocprofiler_client_finalize_t finalize_func,
|
||||
void* tool_data);
|
||||
|
||||
typedef void (*rocprofiler_tool_finalize_t)(void* tool_data);
|
||||
|
||||
typedef struct
|
||||
{
|
||||
rocprofiler_configure_callback_t initialize;
|
||||
rocprofiler_configure_callback_t finalize;
|
||||
void* user_data;
|
||||
} rocprofiler_configure_result_t;
|
||||
size_t size; ///< in case of future extensions
|
||||
rocprofiler_tool_initialize_t initialize; ///< context creation
|
||||
rocprofiler_tool_finalize_t finalize; ///< cleanup
|
||||
void* tool_data; ///< data to provide to init and fini callbacks
|
||||
} rocprofiler_tool_configure_result_t;
|
||||
|
||||
typedef uint32_t (*rocprofiler_register_import_func_t)(void);
|
||||
|
||||
|
||||
@@ -48,8 +48,8 @@ extern "C" {
|
||||
#pragma weak rocprofiler_register_import_roctx
|
||||
#pragma weak rocprofiler_register_import_roctx_static
|
||||
|
||||
extern rocprofiler_configure_result_t*
|
||||
rocprofiler_configure(uint32_t, const char*, uint32_t, uint32_t);
|
||||
extern rocprofiler_tool_configure_result_t*
|
||||
rocprofiler_configure(uint32_t, const char*, uint32_t, rocprofiler_client_id_t*);
|
||||
|
||||
extern int
|
||||
rocprofiler_set_api_table(const char*, uint64_t, uint64_t, void**, uint64_t);
|
||||
@@ -226,12 +226,13 @@ rocp_reg_scan_for_tools()
|
||||
LOG(INFO) << "loaded " << _rocp_reg_lib_path_fname.string() << " library at "
|
||||
<< _rocp_reg_lib_path.string();
|
||||
|
||||
LOG_IF(FATAL, !rocprofiler_lib_handle) << _rocp_reg_lib << " failed to load\n";
|
||||
LOG_IF(FATAL, rocprofiler_lib_handle == nullptr)
|
||||
<< _rocp_reg_lib << " failed to load\n";
|
||||
|
||||
*(void**) (&rocprofiler_lib_config_fn) =
|
||||
dlsym(rocprofiler_lib_handle, rocprofiler_lib_register_entrypoint);
|
||||
|
||||
LOG_IF(FATAL, !rocprofiler_lib_config_fn)
|
||||
LOG_IF(FATAL, rocprofiler_lib_config_fn == nullptr)
|
||||
<< _rocp_reg_lib << " did not contain '"
|
||||
<< rocprofiler_lib_register_entrypoint << "' symbol\n";
|
||||
}
|
||||
|
||||
@@ -42,26 +42,40 @@ roctx_range_pop(const char* name)
|
||||
} // namespace rocprofiler
|
||||
|
||||
extern "C" {
|
||||
struct rocprofiler_configure_result_t
|
||||
typedef struct
|
||||
{
|
||||
int (*initialize)(void*) = nullptr;
|
||||
int (*finalize)(void*) = nullptr;
|
||||
void* data = nullptr;
|
||||
};
|
||||
const char* name; ///< clients should set this value for debugging
|
||||
const uint32_t handle; ///< internal handle
|
||||
} rocprofiler_client_id_t;
|
||||
|
||||
rocprofiler_configure_result_t*
|
||||
rocprofiler_configure(uint32_t, const char*, uint32_t, uint32_t)
|
||||
typedef void (*rocprofiler_client_finalize_t)(rocprofiler_client_id_t);
|
||||
|
||||
typedef int (*rocprofiler_tool_initialize_t)(rocprofiler_client_finalize_t finalize_func,
|
||||
void* tool_data);
|
||||
|
||||
typedef void (*rocprofiler_tool_finalize_t)(void* tool_data);
|
||||
|
||||
typedef struct
|
||||
{
|
||||
size_t size; ///< in case of future extensions
|
||||
rocprofiler_tool_initialize_t initialize; ///< context creation
|
||||
rocprofiler_tool_finalize_t finalize; ///< cleanup
|
||||
void* tool_data; ///< data to provide to init and fini callbacks
|
||||
} rocprofiler_tool_configure_result_t;
|
||||
|
||||
rocprofiler_tool_configure_result_t*
|
||||
rocprofiler_configure(uint32_t, const char*, uint32_t, rocprofiler_client_id_t*)
|
||||
__attribute__((visibility("default")));
|
||||
|
||||
int
|
||||
rocprofiler_set_api_table(const char*, uint64_t, uint64_t, void**, uint64_t)
|
||||
__attribute__((visibility("default")));
|
||||
|
||||
rocprofiler_configure_result_t*
|
||||
rocprofiler_configure(uint32_t version,
|
||||
const char* runtime_version,
|
||||
uint32_t priority,
|
||||
uint32_t tool_id)
|
||||
rocprofiler_tool_configure_result_t*
|
||||
rocprofiler_configure(uint32_t version,
|
||||
const char* runtime_version,
|
||||
uint32_t priority,
|
||||
rocprofiler_client_id_t* tool_id)
|
||||
{
|
||||
(void) version;
|
||||
(void) runtime_version;
|
||||
|
||||
Ссылка в новой задаче
Block a user