shellcheck and minor bug fix (#347)

* shellcheck and minor bug fix

* source formatting (clang-format v11) (#348)

Co-authored-by: bgopesh <bgopesh@users.noreply.github.com>

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: bgopesh <bgopesh@users.noreply.github.com>
This commit is contained in:
Gopesh Bhardwaj
2024-01-10 02:05:13 +05:30
committed by GitHub
parent 55918b5c1f
commit 00fc6c7178
2 changed files with 13 additions and 18 deletions
+2 -2
View File
@@ -51,7 +51,7 @@ auto context_id = rocprofiler_context_id_t{};
auto output_path =
fs::path{common::get_env<std::string>("ROCPROFILER_OUTPUT_PATH", fs::current_path().string())};
auto output_file_name =
common::get_env<std::string>("ROCPROFILER_OUTPUT_FILE_NAME", std::to_string(getpid()) + "-");
common::get_env<std::string>("ROCPROFILER_OUTPUT_FILE_NAME", std::to_string(getpid()));
std::pair<std::ostream*, void (*)(std::ostream*&)>
get_output_stream(const std::string& fname, const std::string& ext = ".csv")
@@ -64,7 +64,7 @@ get_output_stream(const std::string& fname, const std::string& ext = ".csv")
output_path.string())};
if(!fs::exists(output_path)) fs::create_directories(output_path);
auto output_file = output_path / (output_file_name + fname + ext);
auto output_file = output_path / (output_file_name + "_" + fname + ext);
auto* _ofs = new std::ofstream{output_file};
if(!_ofs && !*_ofs)
throw std::runtime_error{fmt::format("Failed to open {} for output", output_file.string())};