about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--001help.cc6
-rw-r--r--020run.cc6
-rw-r--r--050scenario.cc4
3 files changed, 13 insertions, 3 deletions
diff --git a/001help.cc b/001help.cc
index 03c21d4c..4fc42d13 100644
--- a/001help.cc
+++ b/001help.cc
@@ -18,10 +18,16 @@ if (argc <= 1 || is_equal(argv[1], "--help")) {
        << "Examples:\n"
        << "  To load files and run 'main':\n"
        << "    mu file1.mu file2.mu ...\n"
+       << "  To run 'main' and dump a trace of all operations at the end:\n"
+       << "    mu --trace file1.mu file2.mu ...\n"
        << "  To run all tests:\n"
        << "    mu test\n"
        << "  To load files and then run all tests:\n"
        << "    mu test file1.mu file2.mu ...\n"
+       << "  To run a single Mu scenario:\n"
+       << "    mu test file1.mu file2.mu ... scenario\n"
+       << "  To run a single Mu scenario and dump a trace at the end:\n"
+       << "    mu --trace test file1.mu file2.mu ... scenario1 scenario2 ... \n"
        << "  To load files and run only the tests in explicitly loaded files (for apps):\n"
        << "    mu --test-only-app test file1.mu file2.mu ...\n"
        << "  To load all files with a numeric prefix in a directory:\n"
diff --git a/020run.cc b/020run.cc
index 8675e4c5..3d0935f4 100644
--- a/020run.cc
+++ b/020run.cc
@@ -187,7 +187,7 @@ if (!Run_tests && contains_key(Recipe_ordinal, "main") && contains_key(Recipe, g
   // Running Main
   setup();
 //?   Save_trace = true;
-  if (Trace_main) Trace_stream = new trace_stream;
+  if (Start_tracing) Trace_stream = new trace_stream;
   trace(9990, "run") << "=== Starting to run" << end();
   assert(Num_calls_to_transform_all == 1);
   run_main(argc, argv);
@@ -202,10 +202,10 @@ void run_main(int argc, char* argv[]) {
 //: By default we don't maintain the trace while running main because its
 //: overheads can grow rapidly. However, it's useful when debugging.
 :(before "End Globals")
-bool Trace_main = false;
+bool Start_tracing = false;
 :(before "End Commandline Options(*arg)")
 else if (is_equal(*arg, "--trace")) {
-  Trace_main = true;
+  Start_tracing = true;
 }
 
 :(code)
diff --git a/050scenario.cc b/050scenario.cc
index ba4a2309..0ee3aa53 100644
--- a/050scenario.cc
+++ b/050scenario.cc
@@ -162,6 +162,10 @@ if (Test_only_app && Num_core_mu_scenarios < SIZE(Scenarios)) {
 :(after "Test Runs")
 for (int i = 0;  i < SIZE(Scenarios);  ++i) {
   if (Scenarios.at(i).name == argv[argc-1]) {
+    if (Start_tracing) {
+      Trace_stream = new trace_stream;
+      Save_trace = true;
+    }
     run_mu_scenario(Scenarios.at(i));
     if (Passed) cerr << ".\n";
     return 0;