SWDEV-465520: RHEL9 toolchain doesnt seem to support experimental filesystem

Change-Id: I6b1e7f42c49b1c7af412c0b68851724861c9970a


[ROCm/rocprofiler commit: 1e69b3e2f6]
This commit is contained in:
gobhardw
2024-06-04 15:02:51 +05:30
committed by Ammar Elwazir
parent 607cfb9ee1
commit a67f4fdd93
26 changed files with 125 additions and 63 deletions
+3 -2
View File
@@ -29,7 +29,6 @@
#include <cassert>
#include <cstddef>
#include <cstdint>
#include <experimental/filesystem>
#include <fstream>
#include <iostream>
#include <memory>
@@ -47,6 +46,8 @@
#include "../utils.h"
#include "../../src/core/session/att/att_header.h"
#include "src/utils/filesystem.hpp"
#define ATT_FILENAME_MAXBYTES 90
#define TEST_INVALID_KERNEL size_t(-1)
@@ -107,7 +108,7 @@ class att_plugin_t {
if (!output_dir.size()) return;
try {
std::experimental::filesystem::create_directories(output_dir);
rocprofiler::common::filesystem::create_directories(output_dir);
} catch (...) {}
output_dir += '/';
}
+3 -2
View File
@@ -30,7 +30,6 @@
#include <cassert>
#include <cstddef>
#include <cstdint>
#include <experimental/filesystem>
#include <fstream>
#include <iostream>
#include <memory>
@@ -46,7 +45,9 @@
#include "rocprofiler_plugin.h"
#include "../utils.h"
namespace fs = std::experimental::filesystem;
#include "src/utils/filesystem.hpp"
namespace fs = rocprofiler::common::filesystem;
namespace {
@@ -26,7 +26,7 @@
#include <fstream>
#include <vector>
#include <functional>
#include <experimental/filesystem>
#include "src/utils/filesystem.hpp"
#include "barectf.h"
@@ -71,7 +71,7 @@ template <typename DescrT> class BarectfPlatform final {
// For each event record to write, the platform reads `clock_val` to
// know the current timestamp.
explicit BarectfPlatform(const std::size_t packet_size,
const std::experimental::filesystem::path& data_stream_file_path,
const rocprofiler::common::filesystem::path& data_stream_file_path,
const std::uint64_t& clock_val)
: clock_val_{&clock_val}, buffer_(packet_size) {
// Initialize barectf callbacks.
@@ -25,7 +25,7 @@
#include <memory>
#include <vector>
#include <string>
#include <experimental/filesystem>
#include "src/utils/filesystem.hpp"
#include "barectf_event_record.h"
#include "barectf_writer.h"
@@ -64,7 +64,7 @@ template <typename PlatformDescrT> class BarectfTracer final {
// tracer, but may reduce the number of required CTF data stream files
// to ensure time-ordered event records.
explicit BarectfTracer(const std::size_t packet_size,
std::experimental::filesystem::path trace_dir,
rocprofiler::common::filesystem::path trace_dir,
const char* const data_stream_file_name_prefix,
const std::size_t max_writer_queue_size = 200)
: packet_size_{packet_size},
@@ -107,7 +107,7 @@ template <typename PlatformDescrT> class BarectfTracer final {
std::size_t packet_size_;
// CTF trace directory.
std::experimental::filesystem::path trace_dir_;
rocprofiler::common::filesystem::path trace_dir_;
// CTF data stream file name prefix.
std::string data_stream_file_name_prefix_;
@@ -27,7 +27,7 @@
#include <cassert>
#include <queue>
#include <utility>
#include <experimental/filesystem>
#include "src/utils/filesystem.hpp"
#include "barectf_platform.h"
#include "barectf_event_record.h"
@@ -71,7 +71,7 @@ template <typename PlatformDescrT> class BarectfWriter final {
// The built barectf writer manages an event record queue having a
// maximum size of `max_queue_size`.
explicit BarectfWriter(const std::size_t packet_size,
const std::experimental::filesystem::path& data_stream_file_path,
const rocprofiler::common::filesystem::path& data_stream_file_path,
const std::size_t max_queue_size)
: platform_{packet_size, data_stream_file_path, clock_val_},
max_queue_size_{max_queue_size} {}
+2 -2
View File
@@ -28,7 +28,7 @@
#include <chrono>
#include <regex>
#include <unistd.h>
#include <experimental/filesystem>
#include "src/utils/filesystem.hpp"
#include <type_traits>
#include "rocprofiler.h"
@@ -39,7 +39,7 @@
#include <rocm-core/rocm_getpath.h>
#endif
namespace fs = std::experimental::filesystem;
namespace fs = rocprofiler::common::filesystem;
namespace {
+3 -2
View File
@@ -28,7 +28,6 @@
#include <memory>
#include <limits>
#include <fstream>
#include <experimental/filesystem>
#include <time.h>
#include <hsa/hsa.h>
@@ -47,7 +46,9 @@
#include "barectf_tracer.h"
#include "plugin.h"
namespace fs = std::experimental::filesystem;
#include "src/utils/filesystem.hpp"
namespace fs = rocprofiler::common::filesystem;
namespace rocm_ctf {
namespace {
+6 -5
View File
@@ -23,7 +23,8 @@
#include <mutex>
#include <cstdlib>
#include <experimental/filesystem>
#include "src/utils/filesystem.hpp"
#include "rocprofiler.h"
#include "rocprofiler_plugin.h"
@@ -49,8 +50,8 @@ class Plugin final {
//
// This constructor immediately adjusts and copies the metadata stream
// file `metadata_stream_path` to the trace directory (`trace_dir`).
explicit Plugin(std::size_t packet_size, const std::experimental::filesystem::path& trace_dir,
const std::experimental::filesystem::path& metadata_stream_path);
explicit Plugin(std::size_t packet_size, const rocprofiler::common::filesystem::path& trace_dir,
const rocprofiler::common::filesystem::path& metadata_stream_path);
// Handles a tracer record.
void HandleTracerRecord(const rocprofiler_record_tracer_t& record,
@@ -127,8 +128,8 @@ class Plugin final {
// adjusts the `offset` property of its single clock class, and writes
// the result to the `metadata` file within the `trace_dir` directory.
void CopyAdjustedMetadataStreamFile(
const std::experimental::filesystem::path& metadata_stream_path,
const std::experimental::filesystem::path& trace_dir);
const rocprofiler::common::filesystem::path& metadata_stream_path,
const rocprofiler::common::filesystem::path& trace_dir);
// Dedicated tracers.
BarectfTracer<RocTxPlatformDescr> roctx_tracer_;
+3 -2
View File
@@ -30,7 +30,6 @@
#include <cassert>
#include <cstddef>
#include <cstdint>
#include <experimental/filesystem>
#include <fstream>
#include <iostream>
#include <memory>
@@ -46,7 +45,9 @@
#include "rocprofiler_plugin.h"
#include "../utils.h"
namespace fs = std::experimental::filesystem;
#include "src/utils/filesystem.hpp"
namespace fs = rocprofiler::common::filesystem;
namespace {
+3 -2
View File
@@ -30,7 +30,6 @@
#include <cassert>
#include <cstddef>
#include <cstdint>
#include <experimental/filesystem>
#include <fstream>
#include <iostream>
#include <memory>
@@ -46,7 +45,9 @@
#include "rocprofiler_plugin.h"
#include "../utils.h"
namespace fs = std::experimental::filesystem;
#include "src/utils/filesystem.hpp"
namespace fs = rocprofiler::common::filesystem;
namespace {
+3 -2
View File
@@ -24,7 +24,6 @@
#include <cassert>
#include <cstdint>
#include <cstdlib>
#include <experimental/filesystem>
#include <fstream>
#include <string>
#include <iostream>
@@ -47,7 +46,9 @@
#include "rocprofiler_plugin.h"
#include "../utils.h"
namespace fs = std::experimental::filesystem;
#include "src/utils/filesystem.hpp"
namespace fs = rocprofiler::common::filesystem;
namespace {
@@ -25,7 +25,6 @@
#include <condition_variable>
#include <cstdint>
#include <cstdlib>
#include <experimental/filesystem>
#include <fstream>
#include <memory>
#include <optional>
@@ -49,10 +48,12 @@
#include "rocprofiler_plugin.h"
#include "../utils.h"
#include "src/utils/filesystem.hpp"
#define STREAM_CONSTANT 98736677
#define QUEUE_CONSTANT 18746479
namespace fs = std::experimental::filesystem;
namespace fs = rocprofiler::common::filesystem;
PERFETTO_DEFINE_CATEGORIES(
perfetto::Category("GENERIC").SetDescription("GENERAL_CATEGORY"),
@@ -515,7 +516,7 @@ class perfetto_plugin_t {
if (kernel_name_it == kernel_names_map.end())
{
kernel_name_it = kernel_names_map.emplace(tracer_record.name,
rocprofiler::truncate_name(rocprofiler::cxx_demangle(tracer_record.name))).first;
rocprofiler::truncate_name(rocprofiler::cxx_demangle(tracer_record.name))).first;
}
TRACE_EVENT_BEGIN(
"HIP_OPS", perfetto::DynamicString(kernel_name_it->second.c_str()),