<div dir="ltr"><div dir="ltr">I've built something like this before using Soot and another tool called Atlas. The code is public, but not very clean/reliable at this time and it's not using an official branch of Soot. Anyway, the idea is relatively simple. Soot lets you insert statements before/after statements. You can use this to insert counters before each statement in your control flow graph. A similar example for counting GOTOs is included with Soot: <a href="https://github.com/Sable/soot/wiki/Adding-profiling-instructions-to-applications">https://github.com/Sable/soot/wiki/Adding-profiling-instructions-to-applications</a>. Each edge in a control flow graph is a transition from one node to another in the control flow graph, so if you were to track the sequence that nodes were visited you could easily correlate that to an edge and keep counters for each edge. The trick will be to implement it so it's not tracking too much at a time. You only need to the node which node was the previous node to infer the edge, so you should only have to track one item at a time, otherwise, you will be adding a lot of overhead in your instrumentation.</div></div><br><div class="gmail_quote"><div dir="ltr">On Sat, Nov 3, 2018 at 2:30 PM Zhou, Tong <<a href="mailto:tz@gatech.edu">tz@gatech.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">
<div id="m_5022641995296760732divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif" dir="ltr">
<p style="margin-top:0;margin-bottom:0">Hi,</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">Is there any existing project that builds an interpreter on top of Jimple or Shimple? I am currently trying to profile the dynamical basic block counts of a program using an instrumentation-based approach (insert code
that increments a counter) but couldn't find a way instrument the library classes (java.lang.xxx etc). So I was thinking if there's such an interpreter that works on Soot's IR, certain profiling would be quite easy to do in such an interpreter. If no such
thing exists, can someone shed some light on how to profile <span style="font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols;font-size:16px">the </span><span style="font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols;font-size:16px">dynamical
basic block counts of an entire program including libraries?</span> Thanks a lot! Any comment is appreciated.</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">Tong</p>
</div>
</div>
_______________________________________________<br>
Soot-list mailing list<br>
<a href="mailto:Soot-list@CS.McGill.CA" target="_blank">Soot-list@CS.McGill.CA</a><br>
<a href="https://mailman.CS.McGill.CA/mailman/listinfo/soot-list" rel="noreferrer" target="_blank">https://mailman.CS.McGill.CA/mailman/listinfo/soot-list</a><br>
</blockquote></div>