Remove roctracer_mark
This function has been deprecated since ROCm-2.9, use ROCTX's roctxMark(const char* message) as a replacement for roctracer_mark. Change-Id: Ie4aeae1db238453fc4451746cc9a338032ba817f
This commit is contained in:
@@ -20,9 +20,8 @@
|
||||
|
||||
#include "roctracer.h"
|
||||
|
||||
#define PUBLIC_API __attribute__((visibility("default")))
|
||||
|
||||
// Deprecated functions:
|
||||
extern "C" PUBLIC_API int roctracer_load() { return 1; }
|
||||
extern "C" PUBLIC_API void roctracer_unload() {}
|
||||
extern "C" PUBLIC_API void roctracer_flush_buf() {}
|
||||
extern "C" ROCTRACER_API int roctracer_load() { return 1; }
|
||||
extern "C" ROCTRACER_API void roctracer_unload() {}
|
||||
extern "C" ROCTRACER_API void roctracer_flush_buf() {}
|
||||
extern "C" ROCTRACER_API void roctracer_mark(const char*) {}
|
||||
|
||||
@@ -93,13 +93,6 @@
|
||||
|
||||
static inline uint32_t GetPid() { return syscall(__NR_getpid); }
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Mark callback
|
||||
//
|
||||
typedef void(mark_api_callback_t)(uint32_t domain, uint32_t cid, const void* callback_data,
|
||||
void* arg);
|
||||
mark_api_callback_t* mark_api_callback_ptr = nullptr;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Internal library methods
|
||||
//
|
||||
@@ -1134,15 +1127,6 @@ roctracer_activity_pop_external_correlation_id(activity_correlation_id_t* last_i
|
||||
API_METHOD_SUFFIX
|
||||
}
|
||||
|
||||
// Mark API (FIXME: why isn't it in the roctracer_ext.h header?)
|
||||
extern "C" ROCTRACER_API void roctracer_mark(const char* str) {
|
||||
if (mark_api_callback_ptr) {
|
||||
mark_api_callback_ptr(ACTIVITY_DOMAIN_EXT_API, ACTIVITY_EXT_OP_MARK, str, nullptr);
|
||||
NextCorrelationId(); // account for user-defined markers when tracking
|
||||
// correlation id
|
||||
}
|
||||
}
|
||||
|
||||
// Start API
|
||||
ROCTRACER_API void roctracer_start() {
|
||||
if (set_stopped(0)) {
|
||||
@@ -1187,18 +1171,11 @@ ROCTRACER_API roctracer_status_t roctracer_set_properties(roctracer_domain_t dom
|
||||
void* properties) {
|
||||
API_METHOD_PREFIX
|
||||
switch (domain) {
|
||||
case ACTIVITY_DOMAIN_HSA_OPS: {
|
||||
break;
|
||||
}
|
||||
case ACTIVITY_DOMAIN_HSA_EVT: {
|
||||
break;
|
||||
}
|
||||
case ACTIVITY_DOMAIN_HSA_API: {
|
||||
break;
|
||||
}
|
||||
case ACTIVITY_DOMAIN_HSA_OPS:
|
||||
case ACTIVITY_DOMAIN_HSA_EVT:
|
||||
case ACTIVITY_DOMAIN_HSA_API:
|
||||
case ACTIVITY_DOMAIN_HIP_OPS:
|
||||
case ACTIVITY_DOMAIN_HIP_API: {
|
||||
mark_api_callback_ptr = reinterpret_cast<mark_api_callback_t*>(properties);
|
||||
break;
|
||||
}
|
||||
case ACTIVITY_DOMAIN_EXT_API: {
|
||||
|
||||
@@ -295,11 +295,11 @@ struct hip_api_trace_entry_t {
|
||||
hip_api_data_t data;
|
||||
};
|
||||
|
||||
hip_api_trace_entry_t(activity_domain_t domain, uint32_t cid, roctracer_timestamp_t begin,
|
||||
roctracer_timestamp_t end, uint32_t pid, uint32_t tid,
|
||||
const hip_api_data_t& hip_api_data, const char* name)
|
||||
hip_api_trace_entry_t(uint32_t cid, roctracer_timestamp_t begin, roctracer_timestamp_t end,
|
||||
uint32_t pid, uint32_t tid, const hip_api_data_t& hip_api_data,
|
||||
const char* name)
|
||||
: valid(roctracer::TRACE_ENTRY_INIT) {
|
||||
record.domain = domain;
|
||||
record.domain = ACTIVITY_DOMAIN_HIP_API;
|
||||
record.op = cid;
|
||||
record.kind = 0;
|
||||
record.begin_ns = begin;
|
||||
@@ -417,24 +417,13 @@ void hip_api_callback(uint32_t domain, uint32_t cid, const void* callback_data,
|
||||
// Post init of HIP APU args
|
||||
hipApiArgsInit((hip_api_id_t)cid, const_cast<hip_api_data_t*>(data));
|
||||
kernel_name = getKernelName(cid, data);
|
||||
hip_api_trace_entry_t& entry = hip_api_trace_buffer.Emplace(
|
||||
static_cast<activity_domain_t>(domain), cid, hip_begin_timestamp, timestamp, GetPid(),
|
||||
GetTid(), *data, kernel_name ? kernel_name->c_str() : nullptr);
|
||||
hip_api_trace_entry_t& entry =
|
||||
hip_api_trace_buffer.Emplace(cid, hip_begin_timestamp, timestamp, GetPid(), GetTid(), *data,
|
||||
kernel_name ? kernel_name->c_str() : nullptr);
|
||||
entry.valid.store(roctracer::TRACE_ENTRY_COMPLETE, std::memory_order_release);
|
||||
}
|
||||
}
|
||||
|
||||
void mark_api_callback(uint32_t domain, uint32_t cid, const void* callback_data, void* arg) {
|
||||
(void)arg;
|
||||
const char* name = reinterpret_cast<const char*>(callback_data);
|
||||
|
||||
const roctracer_timestamp_t timestamp = timestamp_ns();
|
||||
hip_api_trace_entry_t& entry =
|
||||
hip_api_trace_buffer.Emplace(static_cast<activity_domain_t>(domain), cid, timestamp,
|
||||
timestamp + 1, GetPid(), GetTid(), hip_api_data_t{}, name);
|
||||
entry.valid.store(roctracer::TRACE_ENTRY_COMPLETE, std::memory_order_release);
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Input parser
|
||||
std::string normalize_token(const std::string& token, bool not_empty, const std::string& label) {
|
||||
@@ -757,8 +746,6 @@ ROCTRACER_EXPORT bool OnLoad(HsaApiTable* table, uint64_t runtime_version,
|
||||
if (trace_hip_api || trace_hip_activity) {
|
||||
fprintf(stdout, " HIP-trace()\n");
|
||||
fflush(stdout);
|
||||
// roctracer properties
|
||||
roctracer_set_properties(ACTIVITY_DOMAIN_HIP_API, (void*)mark_api_callback);
|
||||
// Allocating tracing pool
|
||||
open_tracing_pool();
|
||||
|
||||
|
||||
Viittaa uudesa ongelmassa
Block a user