roctx condition for timestamp or clocktime
This commit is contained in:
@@ -186,11 +186,16 @@ static inline void roctx_callback_fun(
|
|||||||
uint32_t tid,
|
uint32_t tid,
|
||||||
const char* message)
|
const char* message)
|
||||||
{
|
{
|
||||||
|
#if ROCTX_CLOCK_TIME
|
||||||
|
const timestamp_t time = HsaTimer::clocktime_ns(HsaTimer::TIME_ID_CLOCK_MONOTONIC);
|
||||||
|
#else
|
||||||
|
const timestamp_t time = timer->timestamp_fn_ns();
|
||||||
|
#endif
|
||||||
roctx_trace_entry_t* entry = roctx_trace_buffer.GetEntry();
|
roctx_trace_entry_t* entry = roctx_trace_buffer.GetEntry();
|
||||||
entry->valid = roctracer::TRACE_ENTRY_COMPL;
|
entry->valid = roctracer::TRACE_ENTRY_COMPL;
|
||||||
entry->type = 0;
|
entry->type = 0;
|
||||||
entry->cid = cid;
|
entry->cid = cid;
|
||||||
entry->time = HsaTimer::clocktime_ns(HsaTimer::TIME_ID_CLOCK_MONOTONIC);
|
entry->time = time;
|
||||||
entry->pid = GetPid();
|
entry->pid = GetPid();
|
||||||
entry->tid = tid;
|
entry->tid = tid;
|
||||||
entry->message = (message != NULL) ? strdup(message) : NULL;
|
entry->message = (message != NULL) ? strdup(message) : NULL;
|
||||||
@@ -219,8 +224,12 @@ void stop_callback() { roctracer::RocTxLoader::Instance().RangeStackIterate(roct
|
|||||||
|
|
||||||
// rocTX buffer flush function
|
// rocTX buffer flush function
|
||||||
void roctx_flush_cb(roctx_trace_entry_t* entry) {
|
void roctx_flush_cb(roctx_trace_entry_t* entry) {
|
||||||
|
#if ROCTX_CLOCK_TIME
|
||||||
timestamp_t timestamp = 0;
|
timestamp_t timestamp = 0;
|
||||||
HsaRsrcFactory::Instance().GetTimestamp(HsaTimer::TIME_ID_CLOCK_MONOTONIC, entry->time, ×tamp);
|
HsaRsrcFactory::Instance().GetTimestamp(HsaTimer::TIME_ID_CLOCK_MONOTONIC, entry->time, ×tamp);
|
||||||
|
#else
|
||||||
|
const timestamp_t timestamp = entry->time;
|
||||||
|
#endif
|
||||||
std::ostringstream os;
|
std::ostringstream os;
|
||||||
os << timestamp << " " << entry->pid << ":" << entry->tid << " " << entry->cid;
|
os << timestamp << " " << entry->pid << ":" << entry->tid << " " << entry->cid;
|
||||||
if (entry->message != NULL) os << ":\"" << entry->message << "\"";
|
if (entry->message != NULL) os << ":\"" << entry->message << "\"";
|
||||||
|
|||||||
Viittaa uudesa ongelmassa
Block a user