Skip to content

Commit

Permalink
Replace std:filesystem as it is not supported by g++ version 7
Browse files Browse the repository at this point in the history
  • Loading branch information
pranswarup committed Dec 17, 2024
1 parent 286477a commit b6a52cd
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions source/lib/core/perfetto.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
#include "utility.hpp"

#include <chrono>
#include <filesystem>

namespace rocprofsys
{
Expand Down Expand Up @@ -267,19 +266,26 @@ post_process(tim::manager* _timemory_manager, bool& _perfetto_output_error)

if(dmp::rank() == 0)
{
std::filesystem::path file_path(_filename);
auto folder_path = file_path.parent_path();
const char* file_path = _filename.c_str();
char* folder_path = strdup(file_path);
char* last_slash = strrchr(folder_path, '/');
if(last_slash != nullptr)
{
*last_slash = '\0'; // Terminate the string at the last slash
}

// Execute the merge script
std::string command =
"merge_multiprocess_output.sh '" + std::string(folder_path.c_str()) + "'";
"merge_multiprocess_output.sh '" + std::string(folder_path) + "'";
int result = system(command.c_str());
if(result != 0)
{
ROCPROFSYS_VERBOSE(0,
"Failed to execute merge_multiprocess_output.sh with "
"folder path: %s\n",
folder_path.c_str());
folder_path);
}
free(folder_path);
}
}
else if(dmp::rank() == 0)
Expand Down

0 comments on commit b6a52cd

Please sign in to comment.