diff --git a/profiler/Profiler.py b/profiler/Profiler.py index d1606491c..83155790b 100644 --- a/profiler/Profiler.py +++ b/profiler/Profiler.py @@ -54,7 +54,7 @@ def summary(self) -> dict: total_write = self.result['log']['total_write_bytes'][-1] max_threads = max(self.result['log']['num_threads']) - return {"status":status, "start_time":start_time, "end_time":end_time, "duration":duration, "highest_commit":highest_commit, "total_read":total_read, "total_write":total_write, "max_threads":max_threads} + return {"status":status, "command":self.command, "start_time":start_time, "end_time":end_time, "duration":duration, "highest_commit":highest_commit, "total_read":total_read, "total_write":total_write, "max_threads":max_threads} def readLog(log_filename, filter=None): ret = {"time":[], "text":[]} @@ -512,7 +512,8 @@ def VisualizeExperiments(experiments, show_figure:bool=True, vgroups=[("cpu_perc colors = [] labels = [] for i, exp in enumerate(experiments): - colors.append(Category10[10][i]) + color_index = i % 9 + colors.append(Category10[10][color_index]) fldrname, filename = getExperimentFileName(exp) labels.append(filename[:-4]) @@ -560,8 +561,8 @@ def VisualizeExperiments(experiments, show_figure:bool=True, vgroups=[("cpu_perc for i, exp in enumerate(experiments): if not exp: continue - - color = Category10[10][i] + color_index = i % 9 + color = Category10[10][color_index] fldrname, filename = getExperimentFileName(exp) if type(vgroup[0]) is tuple: # do something with this vgroup case diff --git a/tic/dll/src/stg/AbstrStoragemanager.cpp b/tic/dll/src/stg/AbstrStoragemanager.cpp index 838509079..d5def2869 100644 --- a/tic/dll/src/stg/AbstrStoragemanager.cpp +++ b/tic/dll/src/stg/AbstrStoragemanager.cpp @@ -37,7 +37,8 @@ #include "TreeItemContextHandle.h" #include "TreeItemProps.h" #include "stg/StorageClass.h" - +#include +#include "processenv.h" #if defined(MG_DEBUG) #define MG_DEBUG_ASM 1 @@ -196,6 +197,16 @@ SharedStr GetRegConfigSetting(const TreeItem* configRoot, CharPtr key, CharPtr d return SharedStr(defaultValue); } +auto GetEnvironmentSetting(CharPtr placeHolder) -> SharedStr +{ + const UInt64 buffer_size = 512; + char buffer[buffer_size]; + auto number_of_characters_in_buffer = GetEnvironmentVariableA("SourceDataDir", buffer, buffer_size); + if (number_of_characters_in_buffer > 0) + return SharedStr(buffer, buffer+number_of_characters_in_buffer); + return {}; +} + SharedStr GetConvertedRegConfigSetting(const TreeItem* configRoot, CharPtr key, CharPtr defaultValue) { return ConvertDosFileName(GetRegConfigSetting(configRoot, key, defaultValue)); @@ -390,20 +401,22 @@ SharedStr GetPlaceholderValue(CharPtr subDirName, CharPtr placeHolder, bool must throwErrorD("Unknown placeholder", placeHolder); return SharedStr(); } - SharedStr GetPlaceholderValue(const TreeItem* configStore, CharPtr placeHolder) { if (!stricmp(placeHolder, "caseDir")) return GetCaseDir (configStore); if (!stricmp(placeHolder, "storageBaseName" )) return GetStorageBaseName(configStore); if (!stricmp(placeHolder, "currDir")) return SharedStr( SessionData::Curr()->GetConfigLoadDir() ); - if (!stricmp(placeHolder, "sourceDataProjDir")) return GetSourceDataProjDir(SessionData::Curr()->GetConfigRoot()); if (!stricmp(placeHolder, "dataDir" )) return GetDataDir (SessionData::Curr()->GetConfigRoot()); - SharedStr result = GetPlaceholderValue(SessionData::Curr()->GetConfigDir().c_str(), placeHolder, false); + auto result = GetEnvironmentSetting(placeHolder); if (!result.empty()) return result; + result = GetPlaceholderValue(SessionData::Curr()->GetConfigDir().c_str(), placeHolder, false); + if (!result.empty()) + return result; + //ss result = GetConvertedRegConfigSetting(SessionData::Curr()->GetConfigRoot(), placeHolder, ""); if (!result.empty()) return result;