diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2016-08-12 18:00:47 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2016-08-12 18:00:47 -0700 |
commit | e07cbe5edfef74005a56205586202e9a224f0500 (patch) | |
tree | 28f15db3a56d77e1716fcc7e82f451f097d0ee1a /html/020run.cc.html | |
parent | 32983f88e46082ebdbf3357ea488beda9497ce38 (diff) | |
download | mu-e07cbe5edfef74005a56205586202e9a224f0500.tar.gz |
3174
Diffstat (limited to 'html/020run.cc.html')
-rw-r--r-- | html/020run.cc.html | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/html/020run.cc.html b/html/020run.cc.html index 77f00c93..f3a54f18 100644 --- a/html/020run.cc.html +++ b/html/020run.cc.html @@ -207,19 +207,28 @@ save_snapshots<span class="Delimiter">();</span> <span class="Comment">// Running Main</span> setup<span class="Delimiter">();</span> <span class="CommentedCode">//? Save_trace = true;</span> -<span class="CommentedCode">//? START_TRACING_UNTIL_END_OF_SCOPE;</span> + <span class="Normal">if</span> <span class="Delimiter">(</span>Trace_main<span class="Delimiter">)</span> Trace_stream = <span class="Normal">new</span> trace_stream<span class="Delimiter">;</span> trace<span class="Delimiter">(</span><span class="Constant">9990</span><span class="Delimiter">,</span> <span class="Constant">"run"</span><span class="Delimiter">)</span> << <span class="Constant">"=== Starting to run"</span> << end<span class="Delimiter">();</span> assert<span class="Delimiter">(</span>Num_calls_to_transform_all == <span class="Constant">1</span><span class="Delimiter">);</span> run_main<span class="Delimiter">(</span>argc<span class="Delimiter">,</span> argv<span class="Delimiter">);</span> + <span class="Normal">if</span> <span class="Delimiter">(</span>Trace_main<span class="Delimiter">)</span> <span class="Normal">delete</span> Trace_stream<span class="Delimiter">,</span> Trace_stream = <span class="Constant">NULL</span><span class="Delimiter">;</span> teardown<span class="Delimiter">();</span> <span class="Delimiter">}</span> - <span class="Delimiter">:(code)</span> <span class="Normal">void</span> run_main<span class="Delimiter">(</span><span class="Normal">int</span> argc<span class="Delimiter">,</span> <span class="Normal">char</span>* argv[]<span class="Delimiter">)</span> <span class="Delimiter">{</span> recipe_ordinal r = get<span class="Delimiter">(</span>Recipe_ordinal<span class="Delimiter">,</span> <span class="Constant">"main"</span><span class="Delimiter">);</span> <span class="Normal">if</span> <span class="Delimiter">(</span>r<span class="Delimiter">)</span> run<span class="Delimiter">(</span>r<span class="Delimiter">);</span> <span class="Delimiter">}</span> +<span class="Comment">//: By default we don't maintain the trace while running main because its</span> +<span class="Comment">//: overheads can grow rapidly. However, it's useful when debugging.</span> +<span class="Delimiter">:(before "End Globals")</span> +<span class="Normal">bool</span> Trace_main = <span class="Constant">false</span><span class="Delimiter">;</span> +<span class="Delimiter">:(before "End Commandline Options(*arg)")</span> +<span class="Normal">else</span> <span class="Normal">if</span> <span class="Delimiter">(</span>is_equal<span class="Delimiter">(</span>*arg<span class="Delimiter">,</span> <span class="Constant">"--trace"</span><span class="Delimiter">))</span> <span class="Delimiter">{</span> + Trace_main = <span class="Constant">true</span><span class="Delimiter">;</span> +<span class="Delimiter">}</span> + <span class="Delimiter">:(code)</span> <span class="Normal">void</span> dump_profile<span class="Delimiter">()</span> <span class="Delimiter">{</span> <span class="Normal">for</span> <span class="Delimiter">(</span>map<string<span class="Delimiter">,</span> <span class="Normal">int</span>>::iterator p = Instructions_running<span class="Delimiter">.</span>begin<span class="Delimiter">();</span> p != Instructions_running<span class="Delimiter">.</span>end<span class="Delimiter">();</span> ++p<span class="Delimiter">)</span> <span class="Delimiter">{</span> |