about summary refs log tree commit diff stats
path: root/html/003trace.cc.html
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2016-08-17 19:04:35 -0700
committerKartik K. Agaram <vc@akkartik.com>2016-08-17 19:04:35 -0700
commitd990e8f07aee36f68bcd270889d20c2d22b9aa0b (patch)
tree07a624ea81f2974e1bb038462f4d0607237ea431 /html/003trace.cc.html
parentcb159b8c8a888f089676a63273b76b641e860d88 (diff)
downloadmu-d990e8f07aee36f68bcd270889d20c2d22b9aa0b.tar.gz
3219
Trying keeping html in the master branch:
  https://github.com/blog/2228-simpler-github-pages-publishing

Let's see if https://akkartik.github.io/mu updates after I push this
commit to just the master branch.
Diffstat (limited to 'html/003trace.cc.html')
-rw-r--r--html/003trace.cc.html12
1 files changed, 12 insertions, 0 deletions
diff --git a/html/003trace.cc.html b/html/003trace.cc.html
index 13cba511..33c54ba1 100644
--- a/html/003trace.cc.html
+++ b/html/003trace.cc.html
@@ -309,6 +309,18 @@ START_TRACING_UNTIL_END_OF_SCOPE
   <span class="Identifier">return</span> result<span class="Delimiter">;</span>
 <span class="Delimiter">}</span>
 
+<span class="Normal">int</span> trace_count_prefix<span class="Delimiter">(</span>string label<span class="Delimiter">,</span> string prefix<span class="Delimiter">)</span> <span class="Delimiter">{</span>
+  <span class="Normal">if</span> <span class="Delimiter">(</span>!Trace_stream<span class="Delimiter">)</span> <span class="Identifier">return</span> <span class="Constant">0</span><span class="Delimiter">;</span>
+  <span class="Normal">long</span> result = <span class="Constant">0</span><span class="Delimiter">;</span>
+  <span class="Normal">for</span> <span class="Delimiter">(</span>vector&lt;trace_line&gt;::iterator p = Trace_stream<span class="Delimiter">-&gt;</span>past_lines<span class="Delimiter">.</span>begin<span class="Delimiter">();</span> p != Trace_stream<span class="Delimiter">-&gt;</span>past_lines<span class="Delimiter">.</span>end<span class="Delimiter">();</span> ++p<span class="Delimiter">)</span> <span class="Delimiter">{</span>
+    <span class="Normal">if</span> <span class="Delimiter">(</span>label == p<span class="Delimiter">-&gt;</span>label<span class="Delimiter">)</span> <span class="Delimiter">{</span>
+      <span class="Normal">if</span> <span class="Delimiter">(</span>starts_with<span class="Delimiter">(</span>trim<span class="Delimiter">(</span>p<span class="Delimiter">-&gt;</span>contents<span class="Delimiter">),</span> trim<span class="Delimiter">(</span>prefix<span class="Delimiter">)))</span>
+        ++result<span class="Delimiter">;</span>
+    <span class="Delimiter">}</span>
+  <span class="Delimiter">}</span>
+  <span class="Identifier">return</span> result<span class="Delimiter">;</span>
+<span class="Delimiter">}</span>
+
 <span class="PreProc">#define CHECK_TRACE_CONTAINS_ERROR()  CHECK(trace_count(</span><span class="Constant">&quot;error&quot;</span><span class="PreProc">) &gt; </span><span class="Constant">0</span><span class="PreProc">)</span>
 <span class="PreProc">#define CHECK_TRACE_DOESNT_CONTAIN_ERROR() \</span>
 <span class="PreProc">  </span><span class="Normal">if</span><span class="PreProc"> (trace_count(</span><span class="Constant">&quot;error&quot;</span><span class="PreProc">) &gt; </span><span class="Constant">0</span><span class="PreProc">) </span><span class="Delimiter">{</span><span class="PreProc"> \</span>
41' href='#n241'>241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289