Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate OMNITRACE_USE_PERFETTO, OMNITRACE_USE_TIMEMORY #306

Merged
merged 4 commits into from
Jan 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ubuntu-focal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -286,8 +286,8 @@ jobs:
echo "CMAKE_PREFIX_PATH=/opt/dyninst:${CMAKE_PREFIX_PATH}" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=/opt/rocm/lib:/usr/local/lib:${LD_LIBRARY_PATH}" >> $GITHUB_ENV
cat << EOF > test-install.cfg
OMNITRACE_USE_TIMEMORY = ON
OMNITRACE_USE_PERFETTO = ON
OMNITRACE_PROFILE = ON
OMNITRACE_TRACE = ON
OMNITRACE_USE_PID = OFF
OMNITRACE_USE_SAMPLING = OFF
OMNITRACE_USE_PROCESS_SAMPLING = OFF
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,8 @@ and tweak some sampling default values:

```console
# ...
OMNITRACE_USE_PERFETTO = true
OMNITRACE_USE_TIMEMORY = true
OMNITRACE_TRACE = true
OMNITRACE_PROFILE = true
OMNITRACE_USE_SAMPLING = true
OMNITRACE_USE_PROCESS_SAMPLING = true
# ...
Expand Down
4 changes: 2 additions & 2 deletions scripts/test-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ usage()

cat << EOF > ${CONFIG_DIR}/omnitrace.cfg
OMNITRACE_VERBOSE = 2
OMNITRACE_USE_TIMEMORY = ON
OMNITRACE_USE_PERFETTO = ON
OMNITRACE_PROFILE = ON
OMNITRACE_TRACE = ON
OMNITRACE_USE_SAMPLING = ON
OMNITRACE_USE_PROCESS_SAMPLING = ON
OMNITRACE_OUTPUT_PATH = %env{CONFIG_DIR}%/omnitrace-tests-output
Expand Down
4 changes: 2 additions & 2 deletions source/bin/omnitrace-avail/generate_config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -337,8 +337,8 @@ generate_config(std::string _config_file, const std::set<std::string>& _config_f
if(_lomni && !_romni) return true;
if(_romni && !_lomni) return false;
for(const auto* itr :
{ "OMNITRACE_CONFIG", "OMNITRACE_MODE", "OMNITRACE_USE_PERFETTO",
"OMNITRACE_USE_TIMEMORY", "OMNITRACE_USE_SAMPLING",
{ "OMNITRACE_CONFIG", "OMNITRACE_MODE", "OMNITRACE_TRACE",
"OMNITRACE_PROFILE", "OMNITRACE_USE_SAMPLING",
"OMNITRACE_USE_PROCESS_SAMPLING", "OMNITRACE_USE_ROCTRACER",
"OMNITRACE_USE_ROCM_SMI", "OMNITRACE_USE_KOKKOSP",
"OMNITRACE_USE_OMPT", "OMNITRACE_USE", "OMNITRACE_OUTPUT" })
Expand Down
4 changes: 2 additions & 2 deletions source/bin/omnitrace-causal/impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,8 @@ get_initial_environment()
update_env(_env, "OMNITRACE_MODE", "causal");
update_env(_env, "OMNITRACE_USE_CAUSAL", true);
update_env(_env, "OMNITRACE_USE_SAMPLING", false);
update_env(_env, "OMNITRACE_USE_PERFETTO", false);
update_env(_env, "OMNITRACE_USE_TIMEMORY", false);
update_env(_env, "OMNITRACE_TRACE", false);
update_env(_env, "OMNITRACE_PROFILE", false);
update_env(_env, "OMNITRACE_USE_PROCESS_SAMPLING", false);
update_env(_env, "OMNITRACE_CRITICAL_TRACE", false);
update_env(_env, "OMNITRACE_THREAD_POOL_SIZE",
Expand Down
2 changes: 1 addition & 1 deletion source/bin/omnitrace-critical-trace/critical-trace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ main(int argc, char** argv)
{
omnitrace_init_library();

// config::set_setting_value("OMNITRACE_USE_PERFETTO", true);
// config::set_setting_value("OMNITRACE_TRACE", true);
config::set_setting_value("OMNITRACE_CRITICAL_TRACE", true);
// config::set_setting_value("OMNITRACE_CRITICAL_TRACE_DEBUG", true);
config::set_setting_value<int64_t>("OMNITRACE_CRITICAL_TRACE_COUNT", 500);
Expand Down
2 changes: 1 addition & 1 deletion source/bin/omnitrace-instrument/omnitrace-instrument.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -876,7 +876,7 @@ main(int argc, char** argv)
"defaults in the executable");
parser.add_argument({ "--env" },
"Environment variables to add to the runtime in form "
"VARIABLE=VALUE. E.g. use '--env OMNITRACE_USE_TIMEMORY=ON' to "
"VARIABLE=VALUE. E.g. use '--env OMNITRACE_PROFILE=ON' to "
"default to using timemory instead of perfetto");
parser
.add_argument({ "--mpi" },
Expand Down
8 changes: 4 additions & 4 deletions source/bin/omnitrace-sample/impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ parse_args(int argc, char** argv, std::vector<char*>& _env)
.add_argument({ "-T", "--trace" }, "Generate a detailed trace (perfetto output)")
.max_count(1)
.action([&](parser_t& p) {
update_env(_env, "OMNITRACE_USE_PERFETTO", p.get<bool>("trace"));
update_env(_env, "OMNITRACE_TRACE", p.get<bool>("trace"));
});
parser
.add_argument(
Expand All @@ -428,15 +428,15 @@ parse_args(int argc, char** argv, std::vector<char*>& _env)
.max_count(1)
.conflicts({ "flat-profile" })
.action([&](parser_t& p) {
update_env(_env, "OMNITRACE_USE_TIMEMORY", p.get<bool>("profile"));
update_env(_env, "OMNITRACE_PROFILE", p.get<bool>("profile"));
});
parser
.add_argument({ "-F", "--flat-profile" },
"Generate a flat profile (conflicts with --profile)")
.max_count(1)
.conflicts({ "profile" })
.action([&](parser_t& p) {
update_env(_env, "OMNITRACE_USE_TIMEMORY", p.get<bool>("flat-profile"));
update_env(_env, "OMNITRACE_PROFILE", p.get<bool>("flat-profile"));
update_env(_env, "OMNITRACE_FLAT_PROFILE", p.get<bool>("flat-profile"));
});
parser
Expand Down Expand Up @@ -566,7 +566,7 @@ parse_args(int argc, char** argv, std::vector<char*>& _env)
.choices({ "text", "json", "console" })
.action([&](parser_t& p) {
auto _v = p.get<std::set<std::string>>("profile");
update_env(_env, "OMNITRACE_USE_TIMEMORY", true);
update_env(_env, "OMNITRACE_PROFILE", true);
if(!_v.empty())
{
update_env(_env, "OMNITRACE_TEXT_OUTPUT", _v.count("text") != 0);
Expand Down
8 changes: 4 additions & 4 deletions source/bin/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ function(OMNITRACE_ADD_BIN_TEST)

if(NOT TEST_ENVIRONMENT)
set(TEST_ENVIRONMENT
"OMNITRACE_USE_PERFETTO=ON"
"OMNITRACE_USE_TIMEMORY=ON"
"OMNITRACE_TRACE=ON"
"OMNITRACE_PROFILE=ON"
"OMNITRACE_USE_SAMPLING=ON"
"OMNITRACE_TIME_OUTPUT=OFF"
"LD_LIBRARY_PATH=${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}:${OMNITRACE_DYNINST_API_RT_DIR}:$ENV{LD_LIBRARY_PATH}"
Expand Down Expand Up @@ -314,7 +314,7 @@ omnitrace_add_bin_test(
TIMEOUT 45
PASS_REGEX
"ENVIRONMENT VARIABLE,[ \n]+OMNITRACE_THREAD_POOL_SIZE,[ \n]+OMNITRACE_USE_PID,[ \n]+"
FAIL_REGEX "OMNITRACE_USE_PERFETTO|OMNITRACE_ABORT_FAIL_REGEX")
FAIL_REGEX "OMNITRACE_TRACE|OMNITRACE_ABORT_FAIL_REGEX")

string(REPLACE "+" "\\\+" _AVAIL_CFG_PATH
"${PROJECT_BINARY_DIR}/omnitrace-tests-output/omnitrace-avail/omnitrace-")
Expand Down Expand Up @@ -345,7 +345,7 @@ omnitrace_add_bin_test(
json xml --force
TIMEOUT 45
LABELS "omnitrace-avail"
ENVIRONMENT "OMNITRACE_USE_PERFETTO=OFF;OMNITRACE_USE_TIMEMORY=ON"
ENVIRONMENT "OMNITRACE_TRACE=OFF;OMNITRACE_PROFILE=ON"
PASS_REGEX
"Outputting JSON configuration file '${_AVAIL_CFG_PATH}tweak\\\.json'(.*)Outputting XML configuration file '${_AVAIL_CFG_PATH}tweak\\\.xml'(.*)Outputting text configuration file '${_AVAIL_CFG_PATH}tweak\\\.cfg'(.*)"
)
Expand Down
2 changes: 1 addition & 1 deletion source/docs/instrumenting.md
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ Options:
-d, --default-components Default components to instrument (only useful when timemory is enabled in omnitrace
library)
--env Environment variables to add to the runtime in form VARIABLE=VALUE. E.g. use '--env
OMNITRACE_USE_TIMEMORY=ON' to default to using timemory instead of perfetto
OMNITRACE_PROFILE=ON' to default to using timemory instead of perfetto
--mpi Enable MPI support (requires omnitrace built w/ full or partial MPI support). NOTE: this
will automatically be activated if MPI_Init, MPI_Init_thread, MPI_Finalize,
MPI_Comm_rank, or MPI_Comm_size are found in the symbol table of target
Expand Down
4 changes: 2 additions & 2 deletions source/docs/output.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ E.g. with the base configuration:
export OMNITRACE_OUTPUT_PATH=omnitrace-example-output
export OMNITRACE_TIME_OUTPUT=ON
export OMNITRACE_USE_PID=OFF
export OMNITRACE_USE_TIMEMORY=ON
export OMNITRACE_USE_PERFETTO=ON
export OMNITRACE_PROFILE=ON
export OMNITRACE_TRACE=ON
```

```shell
Expand Down
2 changes: 1 addition & 1 deletion source/docs/python.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ if __name__ == "__main__":
run(20)
```

Using `omnitrace-python ./example.py` with `OMNITRACE_USE_TIMEMORY=ON` and `OMNITRACE_TIMEMORY_COMPONENTS=trip_count` would produce:
Using `omnitrace-python ./example.py` with `OMNITRACE_PROFILE=ON` and `OMNITRACE_TIMEMORY_COMPONENTS=trip_count` would produce:

```console
|-------------------------------------------------------------------------------------------|
Expand Down
18 changes: 9 additions & 9 deletions source/docs/runtime.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ and tweak some sampling default values:

```console
# ...
OMNITRACE_USE_PERFETTO = true
OMNITRACE_USE_TIMEMORY = true
OMNITRACE_TRACE = true
OMNITRACE_PROFILE = true
OMNITRACE_USE_SAMPLING = true
OMNITRACE_USE_PROCESS_SAMPLING = true
# ...
Expand All @@ -50,7 +50,7 @@ match to nearly all common expressions for boolean logic: ON, OFF, YES, NO, TRUE
### Exploring Components

[OmniTrace](https://github.com/AMDResearch/omnitrace) uses [timemory](https://github.com/NERSC/timemory) extensively to provide various capabilities and manage
data and resources. By default, when `OMNITRACE_USE_TIMEMORY=ON`, omnitrace will only collect wall-clock
data and resources. By default, when `OMNITRACE_PROFILE=ON`, omnitrace will only collect wall-clock
timing values; however, by modifying the `OMNITRACE_TIMEMORY_COMPONENTS` setting, omnitrace can be configured to
collect hardware counters, CPU-clock timers, memory usage, context-switches, page-faults, network statistics,
and many more. In fact, omnitrace can actually be used as a dynamic instrumentation vehicle for other 3rd-party profiling
Expand Down Expand Up @@ -179,8 +179,8 @@ $ cat ~/.omnitrace.cfg

OMNITRACE_CONFIG_FILE =
OMNITRACE_MODE = trace
OMNITRACE_USE_PERFETTO = true
OMNITRACE_USE_TIMEMORY = false
OMNITRACE_TRACE = true
OMNITRACE_PROFILE = false
OMNITRACE_USE_SAMPLING = false
OMNITRACE_USE_PROCESS_SAMPLING = true
OMNITRACE_USE_ROCTRACER = true
Expand Down Expand Up @@ -352,13 +352,13 @@ $ omnitrace-avail -S -bd
| OMNITRACE_USE_CODE_COVERAGE | Enable support for code coverage |
| OMNITRACE_USE_KOKKOSP | Enable support for Kokkos Tools |
| OMNITRACE_USE_OMPT | Enable support for OpenMP-Tools |
| OMNITRACE_USE_PERFETTO | Enable perfetto backend |
| OMNITRACE_TRACE | Enable perfetto backend |
| OMNITRACE_USE_PID | Enable tagging filenames with proces... |
| OMNITRACE_USE_ROCM_SMI | Enable sampling GPU power, temp, uti... |
| OMNITRACE_USE_ROCTRACER | Enable ROCM tracing |
| OMNITRACE_USE_SAMPLING | Enable statistical sampling of call-... |
| OMNITRACE_USE_PROCESS_SAMPLING | Enable a background thread which sam... |
| OMNITRACE_USE_TIMEMORY | Enable timemory backend |
| OMNITRACE_PROFILE | Enable timemory backend |
| OMNITRACE_VERBOSE | Verbosity level |
| OMNITRACE_WIDTH | Set the global output width for comp... |
|-----------------------------------------|-----------------------------------------|
Expand Down Expand Up @@ -1192,8 +1192,8 @@ $ENABLE = ON
$SAMPLE = OFF

# use fields
OMNITRACE_USE_PERFETTO = $ENABLE
OMNITRACE_USE_TIMEMORY = $ENABLE
OMNITRACE_TRACE = $ENABLE
OMNITRACE_PROFILE = $ENABLE
OMNITRACE_USE_SAMPLING = $SAMPLE
OMNITRACE_USE_PROCESS_SAMPLING = $SAMPLE

Expand Down
12 changes: 6 additions & 6 deletions source/docs/sampling.md
Original file line number Diff line number Diff line change
Expand Up @@ -235,15 +235,15 @@ OMNITRACE_TRACE_THREAD_SPIN_LOCKS=true
OMNITRACE_USE_KOKKOSP=true
OMNITRACE_USE_MPIP=true
OMNITRACE_USE_OMPT=true
OMNITRACE_USE_PERFETTO=true
OMNITRACE_TRACE=true
OMNITRACE_USE_PROCESS_SAMPLING=true
OMNITRACE_USE_RCCLP=true
OMNITRACE_USE_ROCM_SMI=true
OMNITRACE_USE_ROCPROFILER=true
OMNITRACE_USE_ROCTRACER=true
OMNITRACE_USE_ROCTX=true
OMNITRACE_USE_SAMPLING=true
OMNITRACE_USE_TIMEMORY=true
OMNITRACE_PROFILE=true
OMP_TOOL_LIBRARIES=/opt/omnitrace/lib/libomnitrace-dl.so.1.7.1
ROCP_TOOL_LIB=/opt/omnitrace/lib/libomnitrace.so.1.7.1

Expand All @@ -267,15 +267,15 @@ OMNITRACE_TRACE_THREAD_SPIN_LOCKS=false
OMNITRACE_USE_KOKKOSP=false
OMNITRACE_USE_MPIP=false
OMNITRACE_USE_OMPT=false
OMNITRACE_USE_PERFETTO=true
OMNITRACE_TRACE=true
OMNITRACE_USE_PROCESS_SAMPLING=true
OMNITRACE_USE_RCCLP=false
OMNITRACE_USE_ROCM_SMI=false
OMNITRACE_USE_ROCPROFILER=false
OMNITRACE_USE_ROCTRACER=false
OMNITRACE_USE_ROCTX=false
OMNITRACE_USE_SAMPLING=true
OMNITRACE_USE_TIMEMORY=true
OMNITRACE_PROFILE=true

...
```
Expand All @@ -297,15 +297,15 @@ OMNITRACE_TRACE_THREAD_SPIN_LOCKS=false
OMNITRACE_USE_KOKKOSP=false
OMNITRACE_USE_MPIP=false
OMNITRACE_USE_OMPT=false
OMNITRACE_USE_PERFETTO=true
OMNITRACE_TRACE=true
OMNITRACE_USE_PROCESS_SAMPLING=true
OMNITRACE_USE_RCCLP=false
OMNITRACE_USE_ROCM_SMI=false
OMNITRACE_USE_ROCPROFILER=false
OMNITRACE_USE_ROCTRACER=false
OMNITRACE_USE_ROCTX=false
OMNITRACE_USE_SAMPLING=true
OMNITRACE_USE_TIMEMORY=true
OMNITRACE_PROFILE=true

[omnitrace][omnitrace_init_tooling] Instrumentation mode: Sampling

Expand Down
8 changes: 4 additions & 4 deletions source/lib/core/argparse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -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");
Expand All @@ -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"));
});

Expand Down Expand Up @@ -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);
Expand Down