From 58aff37db98d2bc1baa82b1cabf98869163c215b Mon Sep 17 00:00:00 2001 From: Alexandre Duret-Lutz Date: Thu, 16 Dec 2004 21:49:46 +0000 Subject: [PATCH] * src/tgbatest/randtgba.cc: Add option -O, so we can profile each emptiness-check on its own. --- ChangeLog | 3 +++ src/tgbatest/randtgba.cc | 24 ++++++++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/ChangeLog b/ChangeLog index f8f808ec5..3b5418259 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2004-12-16 Alexandre Duret-Lutz + * src/tgbatest/randtgba.cc: Add option -O, so we can profile each + emptiness-check on its own. + * src/ltlparse/ltlscan.ll: Pass yyleng to the std::string constructor, so it doesn't have to compute it. * src/tgbaparse/tgbascan.ll: Likewise. diff --git a/src/tgbatest/randtgba.cc b/src/tgbatest/randtgba.cc index 3a7a6e2fb..8a398d8a4 100644 --- a/src/tgbatest/randtgba.cc +++ b/src/tgbatest/randtgba.cc @@ -131,6 +131,7 @@ syntax(char* prog) << " -m try to reduce runs, in a second pass (implies -r)" << std::endl << " -n N number of nodes of the graph [20]" << std::endl + << " -O ALGO run Only ALGO" << std::endl << " -r compute and replay acceptance runs (implies -e)" << std::endl << " -R N repeat each emptiness-check and accepting run " @@ -354,6 +355,8 @@ main(int argc, char** argv) int opt_R = 0; + const char* opt_O = 0; + bool opt_dot = false; int opt_ec = 0; int opt_ec_seed = 0; @@ -418,6 +421,25 @@ main(int argc, char** argv) syntax(argv[0]); opt_n = to_int(argv[++argn]); } + else if (!strcmp(argv[argn], "-O")) + { + if (argc < argn + 2) + syntax(argv[0]); + opt_O = argv[++argn]; + int s = sizeof(ec_algos) / sizeof(*ec_algos); + int i; + for (i = 0; i < s; ++i) + if (!strcmp(opt_O, ec_algos[i].name)) + break; + if (i == s) + { + std::cerr << "Unknown algorithm. Available algorithms are:" + << std::endl; + for (i = 0; i < s; ++i) + std::cerr << " " << ec_algos[i].name << std::endl; + exit(1); + } + } else if (!strcmp(argv[argn], "-r")) { opt_replay = true; @@ -497,6 +519,8 @@ main(int argc, char** argv) { spot::emptiness_check* ec; spot::emptiness_check_result* res; + if (opt_O && strcmp(opt_O, ec_algos[i].name)) + continue; ec = cons_emptiness_check(i, a, degen, opt_n_acc); if (!ec) continue;