From 94291d1cc07583a27aa75e18d44e68d0e24d2f48 Mon Sep 17 00:00:00 2001 From: Christian von Elm Date: Tue, 12 Mar 2024 08:44:39 +0100 Subject: [PATCH] Take care of that damn testudine --- src/config.cpp | 27 +++++++++++++-------------- src/monitor/process_monitor_main.cpp | 9 ++++----- 2 files changed, 17 insertions(+), 19 deletions(-) diff --git a/src/config.cpp b/src/config.cpp index ad1d23ac..fccec394 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -334,9 +334,9 @@ void parse_program_options(int argc, const char** argv) io_options.toggle("block-io", "Enable recording of block I/O events (requires access to debugfs)"); - - accel_options.multi_option("accel", "Accelerator to record execution events for").metavar("ACCEL").optional(); - + accel_options.multi_option("accel", "Accelerator to record execution events for") + .metavar("ACCEL") + .optional(); accel_options.option("nec-readout-interval", "Accelerator sampling interval") .optional() @@ -347,7 +347,6 @@ void parse_program_options(int argc, const char** argv) .metavar("MSEC") .default_value("100"); - nitro::options::arguments arguments; try { @@ -487,21 +486,21 @@ void parse_program_options(int argc, const char** argv) } for (const auto& accel : arguments.get_all("accel")) - { - if(accel == "nec") - { + { + if (accel == "nec") + { config.use_nec = true; - } - else if(accel == "nvidia") - { + } + else if (accel == "nvidia") + { config.use_nvidia = true; - } + } else - { + { std::cerr << "Unknown Accelerator " << accel << "!"; std::exit(EXIT_FAILURE); - } - } + } + } std::vector perf_group_events = arguments.get_all("metric-event"); std::vector perf_userspace_events = arguments.get_all("userspace-metric-event"); diff --git a/src/monitor/process_monitor_main.cpp b/src/monitor/process_monitor_main.cpp index 8b38f30a..1997ece1 100644 --- a/src/monitor/process_monitor_main.cpp +++ b/src/monitor/process_monitor_main.cpp @@ -77,11 +77,10 @@ namespace monitor auto current_path = std::filesystem::current_path(); std::vector env; - if(config().use_nvidia) - { - env = { "CUDA_INJECTION64_PATH=" + cuda_path, - "LO2S_RINGBUF_SIZE=1024" }; - } + if (config().use_nvidia) + { + env = { "CUDA_INJECTION64_PATH=" + cuda_path, "LO2S_RINGBUF_SIZE=1024" }; + } std::vector c_env; std::vector tmp;