From 8f931cff65384972ea2a10d19538689e42e88bea Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Tue, 17 Dec 2024 13:58:32 -0500 Subject: [PATCH] Revert "ops_replayer: fix signed/unsigned warning and add parameter range checking." Signed-off-by: Casey Bodley --- src/test/objectstore/allocsim/ops_replayer.cc | 27 +++---------------- 1 file changed, 4 insertions(+), 23 deletions(-) diff --git a/src/test/objectstore/allocsim/ops_replayer.cc b/src/test/objectstore/allocsim/ops_replayer.cc index ec76d6eb7a857..fd947f5c4547a 100644 --- a/src/test/objectstore/allocsim/ops_replayer.cc +++ b/src/test/objectstore/allocsim/ops_replayer.cc @@ -1,5 +1,4 @@ #include -#include #include #include #include @@ -24,7 +23,6 @@ #include #include #include -#include #include #include @@ -35,23 +33,6 @@ namespace po = boost::program_options; using namespace std; using namespace ceph; -namespace settings { - -// Returns a function which restricts a value to a specified range by throwing if it is not in range: -// (Note: std::clamp() does not throw.) -auto clamp_or_throw(auto min, auto max) -{ - return [=](auto& x) { - if(std::less<>{}(x, min) or std::greater<>{}(x, max)) { - throw std::out_of_range(std::format("value expected between {} and {}, but got {}", min, max, x)); - } - - return x; - }; -} - -} // namespace settings - // compare shared_ptr struct StringPtrCompare { @@ -357,8 +338,8 @@ int main(int argc, char** argv) { // options uint64_t io_depth = 8; - int nparser_threads = 16; - int nworker_threads = 16; + uint64_t nparser_threads = 16; + uint64_t nworker_threads = 16; string file("input.txt"); string ceph_conf_path("./ceph.conf"); string pool("test_pool"); @@ -370,8 +351,8 @@ int main(int argc, char** argv) { ("input-files,i", po::value>()->multitoken(), "List of input files (output of op_scraper.py). Multiple files will be merged and sorted by time order") ("ceph-conf", po::value(&ceph_conf_path)->default_value("ceph.conf"), "Path to ceph conf") ("io-depth", po::value(&io_depth)->default_value(64), "I/O depth") - ("parser-threads", po::value(&nparser_threads)->default_value(16)->notifier(settings::clamp_or_throw(1, 256)), "Number of parser threads") - ("worker-threads", po::value(&nworker_threads)->default_value(16)->notifier(settings::clamp_or_throw(1, 256)), "Number of I/O worker threads") + ("parser-threads", po::value(&nparser_threads)->default_value(16), "Number of parser threads") + ("worker-threads", po::value(&nworker_threads)->default_value(16), "Number of I/O worker threads") ("pool", po::value(&pool)->default_value("test_pool"), "Pool to use for I/O") ("skip-do-ops", po::bool_switch(&skip_do_ops)->default_value(false), "Skip doing operations") ; -- 2.39.5