SWDEV-444112: Fixing plugins race condition
Change-Id: I0057d1ade4e1123b878489ff31851b25976217c6
[ROCm/rocprofiler commit: 6ed22f3d62]
Tento commit je obsažen v:
@@ -80,7 +80,6 @@ std::vector<std::string> GetCounterNames() {
|
||||
return counters;
|
||||
}
|
||||
|
||||
static std::string output_file_name;
|
||||
class file_plugin_t {
|
||||
private:
|
||||
enum class output_type_t { COUNTER, TRACER, PC_SAMPLING };
|
||||
@@ -109,7 +108,8 @@ class file_plugin_t {
|
||||
if (fail()) return;
|
||||
|
||||
const char* output_dir = getenv("OUTPUT_PATH");
|
||||
output_file_name = getenv("OUT_FILE_NAME") ? std::string(getenv("OUT_FILE_NAME")) : "";
|
||||
const char* output_file_name_env = getenv("OUT_FILE_NAME");
|
||||
std::string output_file_name = output_file_name_env ? output_file_name_env : "";
|
||||
|
||||
if (output_dir == nullptr && output_file_name.size() == 0) {
|
||||
stream_.copyfmt(std::cout);
|
||||
|
||||
@@ -80,7 +80,6 @@ std::vector<std::string> GetCounterNames() {
|
||||
return counters;
|
||||
}
|
||||
|
||||
static std::string output_file_name;
|
||||
class file_plugin_t {
|
||||
private:
|
||||
enum class output_type_t { COUNTER, TRACER, PC_SAMPLING };
|
||||
@@ -109,7 +108,7 @@ class file_plugin_t {
|
||||
if (fail()) return;
|
||||
|
||||
const char* output_dir = getenv("OUTPUT_PATH");
|
||||
output_file_name = getenv("OUT_FILE_NAME") ? std::string(getenv("OUT_FILE_NAME")) : "";
|
||||
std::string output_file_name = getenv("OUT_FILE_NAME") ? getenv("OUT_FILE_NAME") : "";
|
||||
|
||||
if (output_dir == nullptr && getenv("OUT_FILE_NAME") == nullptr) {
|
||||
stream_.copyfmt(std::cout);
|
||||
|
||||
@@ -110,7 +110,6 @@ struct std::hash<TrackID>
|
||||
namespace {
|
||||
|
||||
std::string process_name;
|
||||
static std::string output_file_name;
|
||||
|
||||
std::string get_kernel_name(rocprofiler_record_profiler_t& profiler_record) {
|
||||
std::string kernel_name = "";
|
||||
@@ -136,7 +135,7 @@ class perfetto_plugin_t {
|
||||
perfetto_plugin_t() {
|
||||
const char* output_dir = getenv("OUTPUT_PATH");
|
||||
const char* temp_file_name = getenv("OUT_FILE_NAME");
|
||||
output_file_name = temp_file_name ? std::string(temp_file_name) + "_" : "";
|
||||
std::string output_file_name = temp_file_name ? std::string(temp_file_name) + "_" : "";
|
||||
|
||||
if (output_dir == nullptr) output_dir = "./";
|
||||
|
||||
|
||||
Odkázat v novém úkolu
Zablokovat Uživatele