Deprecate OMNITRACE_USE_PERFETTO, OMNITRACE_USE_TIMEMORY (#306)

* Rename OMNITRACE_USE_PERFETTO to OMNITRACE_TRACE

* Rename OMNITRACE_USE_TIMEMORY to OMNITRACE_PROFILE

* Revert change to Perfetto.cmake

* Fix formatting

clang-format-11 was complaining about formatting
This commit is contained in:
Ben Richard
2024-01-10 08:20:54 -05:00
committed by GitHub
parent 82cbe3f306
commit 5de4163d66
20 changed files with 91 additions and 82 deletions
+4 -4
View File
@@ -396,7 +396,7 @@ add_core_arguments(parser_t& _parser, parser_data& _data)
"Generate a detailed trace (perfetto output)")
.max_count(1)
.action([&](parser_t& p) {
update_env(_data, "OMNITRACE_USE_PERFETTO", p.get<bool>("trace"));
update_env(_data, "OMNITRACE_TRACE", p.get<bool>("trace"));
});
_data.processed_environs.emplace("trace");
@@ -411,7 +411,7 @@ add_core_arguments(parser_t& _parser, parser_data& _data)
.max_count(1)
.conflicts({ "flat-profile" })
.action([&](parser_t& p) {
update_env(_data, "OMNITRACE_USE_TIMEMORY", p.get<bool>("profile"));
update_env(_data, "OMNITRACE_PROFILE", p.get<bool>("profile"));
});
_data.processed_environs.emplace("profile");
@@ -425,7 +425,7 @@ add_core_arguments(parser_t& _parser, parser_data& _data)
.max_count(1)
.conflicts({ "profile" })
.action([&](parser_t& p) {
update_env(_data, "OMNITRACE_USE_TIMEMORY", p.get<bool>("flat-profile"));
update_env(_data, "OMNITRACE_PROFILE", p.get<bool>("flat-profile"));
update_env(_data, "OMNITRACE_FLAT_PROFILE", p.get<bool>("flat-profile"));
});
@@ -874,7 +874,7 @@ add_core_arguments(parser_t& _parser, parser_data& _data)
.choices({ "text", "json", "console" })
.action([&](parser_t& p) {
auto _v = p.get<strset_t>("profile-format");
update_env(_data, "OMNITRACE_USE_TIMEMORY", true);
update_env(_data, "OMNITRACE_PROFILE", true);
if(!_v.empty())
{
update_env(_data, "OMNITRACE_TEXT_OUTPUT", _v.count("text") != 0);
+24 -15
View File
@@ -230,8 +230,7 @@ configure_settings(bool _init)
auto _config = settings::shared_instance();
// if using timemory, default to perfetto being off
auto _default_perfetto_v =
!tim::get_env<bool>("OMNITRACE_USE_TIMEMORY", false, false);
auto _default_perfetto_v = !tim::get_env<bool>("OMNITRACE_PROFILE", false, false);
auto _system_backend =
tim::get_env("OMNITRACE_PERFETTO_BACKEND_SYSTEM", false, false);
@@ -272,13 +271,21 @@ configure_settings(bool _init)
get_env<size_t>("OMNITRACE_NUM_THREADS", 1), "threading", "performance",
"sampling", "parallelism", "advanced");
OMNITRACE_CONFIG_SETTING(bool, "OMNITRACE_USE_PERFETTO", "Enable perfetto backend",
OMNITRACE_CONFIG_SETTING(bool, "OMNITRACE_TRACE", "Enable perfetto backend",
_default_perfetto_v, "backend", "perfetto");
OMNITRACE_CONFIG_SETTING(bool, "OMNITRACE_USE_TIMEMORY", "Enable timemory backend",
!_config->get<bool>("OMNITRACE_USE_PERFETTO"), "backend",
OMNITRACE_CONFIG_SETTING(bool, "OMNITRACE_USE_PERFETTO",
"[DEPRECATED] Renamed to OMNITRACE_TRACE",
_default_perfetto_v, "backend", "perfetto", "deprecated");
OMNITRACE_CONFIG_SETTING(bool, "OMNITRACE_PROFILE", "Enable timemory backend",
!_config->get<bool>("OMNITRACE_TRACE"), "backend",
"timemory");
OMNITRACE_CONFIG_SETTING(
bool, "OMNITRACE_USE_TIMEMORY", "[DEPRECATED] Renamed to OMNITRACE_PROFILE",
!_config->get<bool>("OMNITRACE_TRACE"), "backend", "timemory", "deprecated");
OMNITRACE_CONFIG_SETTING(bool, "OMNITRACE_USE_CAUSAL",
"Enable causal profiling analysis", false, "backend",
"causal", "analysis");
@@ -1076,6 +1083,8 @@ configure_settings(bool _init)
handle_deprecated_setting("OMNITRACE_USE_THREAD_SAMPLING",
"OMNITRACE_USE_PROCESS_SAMPLING");
handle_deprecated_setting("OMNITRACE_OUTPUT_FILE", "OMNITRACE_PERFETTO_FILE");
handle_deprecated_setting("OMNITRACE_USE_PERFETTO", "OMNITRACE_TRACE");
handle_deprecated_setting("OMNITRACE_USE_TIMEMORY", "OMNITRACE_PROFILE");
scope::get_fields()[scope::flat::value] = _config->get_flat_profile();
scope::get_fields()[scope::timeline::value] = _config->get_timeline_profile();
@@ -1137,8 +1146,8 @@ configure_mode_settings(const std::shared_ptr<settings>& _config)
if(get_mode() == Mode::Coverage)
{
set_default_setting_value("OMNITRACE_USE_CODE_COVERAGE", true);
_set("OMNITRACE_USE_PERFETTO", false);
_set("OMNITRACE_USE_TIMEMORY", false);
_set("OMNITRACE_TRACE", false);
_set("OMNITRACE_PROFILE", false);
_set("OMNITRACE_USE_CAUSAL", false);
_set("OMNITRACE_USE_ROCM_SMI", false);
_set("OMNITRACE_USE_ROCTRACER", false);
@@ -1153,8 +1162,8 @@ configure_mode_settings(const std::shared_ptr<settings>& _config)
else if(get_mode() == Mode::Causal)
{
_set("OMNITRACE_USE_CAUSAL", true);
_set("OMNITRACE_USE_PERFETTO", false);
_set("OMNITRACE_USE_TIMEMORY", false);
_set("OMNITRACE_TRACE", false);
_set("OMNITRACE_PROFILE", false);
_set("OMNITRACE_CRITICAL_TRACE", false);
_set("OMNITRACE_USE_SAMPLING", false);
_set("OMNITRACE_USE_PROCESS_SAMPLING", false);
@@ -1202,8 +1211,8 @@ configure_mode_settings(const std::shared_ptr<settings>& _config)
if(!_config->get_enabled())
{
_set("OMNITRACE_USE_PERFETTO", false);
_set("OMNITRACE_USE_TIMEMORY", false);
_set("OMNITRACE_USE_TRACE", false);
_set("OMNITRACE_PROFILE", false);
_set("OMNITRACE_USE_CAUSAL", false);
_set("OMNITRACE_USE_ROCM_SMI", false);
_set("OMNITRACE_USE_ROCTRACER", false);
@@ -1388,8 +1397,8 @@ configure_disabled_settings(const std::shared_ptr<settings>& _config)
_handle_use_option("OMNITRACE_USE_PROCESS_SAMPLING", "process_sampling");
_handle_use_option("OMNITRACE_USE_CAUSAL", "causal");
_handle_use_option("OMNITRACE_USE_KOKKOSP", "kokkos");
_handle_use_option("OMNITRACE_USE_PERFETTO", "perfetto");
_handle_use_option("OMNITRACE_USE_TIMEMORY", "timemory");
_handle_use_option("OMNITRACE_USE_TRACE", "perfetto");
_handle_use_option("OMNITRACE_PROFILE", "timemory");
_handle_use_option("OMNITRACE_USE_OMPT", "ompt");
_handle_use_option("OMNITRACE_USE_RCCLP", "rcclp");
_handle_use_option("OMNITRACE_USE_ROCM_SMI", "rocm_smi");
@@ -1854,14 +1863,14 @@ get_verbose()
bool&
get_use_perfetto()
{
static auto _v = get_config()->find("OMNITRACE_USE_PERFETTO");
static auto _v = get_config()->find("OMNITRACE_TRACE");
return static_cast<tim::tsettings<bool>&>(*_v->second).get();
}
bool&
get_use_timemory()
{
static auto _v = get_config()->find("OMNITRACE_USE_TIMEMORY");
static auto _v = get_config()->find("OMNITRACE_PROFILE");
return static_cast<tim::tsettings<bool>&>(*_v->second).get();
}