Added begin/end timestamps to hip events

Change-Id: I2689bef675db92f202d60a1fe12c500cd569aa63


[ROCm/roctracer commit: 46f61d7a1e]
This commit is contained in:
Rachida Kebichi
2020-05-05 22:03:42 -04:00
rodzic c2f780ee11
commit c982d7a896
@@ -398,16 +398,19 @@ void hip_api_flush_cb(hip_api_trace_entry_t* entry) {
const hip_api_data_t* data = &(entry->data);
const timestamp_t begin_timestamp = entry->begin;
const timestamp_t end_timestamp = entry->end;
std::ostringstream oss; \
std::ostringstream oss;
std::ostringstream oss2;
const char* str = (domain != ACTIVITY_DOMAIN_EXT_API) ? roctracer_op_string(domain, cid, 0) : strdup("MARK");
oss << std::dec <<
begin_timestamp << ":" << end_timestamp << " " << entry->pid << ":" << entry->tid << " " << str;
oss2 << std::dec <<
begin_timestamp << ":" << end_timestamp << " " << entry->pid << ":" << entry->tid;
if (domain == ACTIVITY_DOMAIN_HIP_API) {
#if HIP_PROF_HIP_API_STRING
const char* str = hipApiString((hip_api_id_t)cid, data);
fprintf(hip_api_file_handle, "%s\n", str);
fprintf(hip_api_file_handle, "%s %s\n", oss2.str().c_str(), str);
#else // !HIP_PROF_HIP_API_STRING
switch (cid) {
case HIP_API_ID_hipMemcpy: