From b6a52cd9b4a98539a6e30553ffdc98558091f82a Mon Sep 17 00:00:00 2001 From: Pranjal Swarup Date: Tue, 17 Dec 2024 14:30:44 -0500 Subject: [PATCH] Replace std:filesystem as it is not supported by g++ version 7 --- source/lib/core/perfetto.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/source/lib/core/perfetto.cpp b/source/lib/core/perfetto.cpp index d8df9491..686a93e5 100644 --- a/source/lib/core/perfetto.cpp +++ b/source/lib/core/perfetto.cpp @@ -28,7 +28,6 @@ #include "utility.hpp" #include -#include namespace rocprofsys { @@ -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)