Skip to content

Commit

Permalink
bug fix for multi thread appends
Browse files Browse the repository at this point in the history
  • Loading branch information
hariharan-devarajan committed Aug 10, 2023
1 parent 25f0891 commit e48a7f7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/dlio_profiler/writer/chrome_writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,14 @@ dlio_profiler::ChromeWriter::log(std::string &event_name, std::string &category,

void dlio_profiler::ChromeWriter::finalize() {
if (fp != nullptr) {
DLIO_PROFILER_LOGINFO("Profiler finalizing writer %s\n", filename .c_str());
int status = fclose(fp);
if (status != 0) {
ERROR(status != 0, "unable to close log file %d for a+", filename.c_str());
}
fp = fopen(this->filename.c_str(), "r");
if (fp == nullptr) {
ERROR(fp == nullptr,"unable to create log file %s", this->filename.c_str());
ERROR(fp == nullptr,"unable to open log file %s with r", this->filename.c_str());
}
std::string data = "[\n";
auto written_elements = fwrite(data.c_str(), data.size(), sizeof(char), fp);
Expand Down

0 comments on commit e48a7f7

Please sign in to comment.