adding begin_ts_file.txt for app start time

Change-Id: I976e7bf06eeafa76c80cc847c341dde9f1f5895e
이 커밋은 다음에 포함됨:
Evgeny
2020-06-17 18:58:56 -05:00
부모 d1ad7a56e1
커밋 c9a7d6c4a8
+7
파일 보기
@@ -97,6 +97,7 @@ LOADER_INSTANTIATE();
TRACE_BUFFER_INSTANTIATE();
// Global output file handle
FILE* begin_ts_file_handle = NULL;
FILE* roctx_file_handle = NULL;
FILE* hsa_api_file_handle = NULL;
FILE* hsa_async_copy_file_handle = NULL;
@@ -107,6 +108,7 @@ FILE* pc_sample_file_handle = NULL;
void close_output_file(FILE* file_handle);
void close_file_handles() {
if (begin_ts_file_handle) close_output_file(pc_sample_file_handle);
if (roctx_file_handle) close_output_file(roctx_file_handle);
if (hsa_api_file_handle) close_output_file(hsa_api_file_handle);
if (hsa_async_copy_file_handle) close_output_file(hsa_async_copy_file_handle);
@@ -920,6 +922,11 @@ extern "C" PUBLIC_API bool OnLoad(HsaApiTable* table, uint64_t runtime_version,
const char* output_prefix = getenv("ROCP_OUTPUT_DIR");
// App begin timestamp begin_ts_file.txt
begin_ts_file_handle = open_output_file(output_prefix, "begin_ts_file.txt");
const timestamp_t app_start_time = timer->timestamp_fn_ns();
fprintf(begin_ts_file_handle, "%lu\n", app_start_time);
// Enable HSA API callbacks/activity
if (trace_hsa_api) {
hsa_api_file_handle = open_output_file(output_prefix, "hsa_api_trace.txt");