[Soot-list] Interthread CFG CG in soot?

Richard L. Halpert richhal22 at gmail.com
Fri Oct 9 12:31:34 EDT 2009


That specific algorithm is not implemented in Soot, but you can obtain an
approximation of the inter-thread call graph using
soot.jimple.toolkits.thread.mhp.SynchObliviousMhpAnalysis.  If you intend to
use Soot as a command line tool, you could do this with the following
command-line options:

-p cg.spark enabled:true -p wjtp.tn enabled:true -p
wjtp.tnlocking-scheme:leave-original -p
wjtp.tn do-tlo:false

Here's an example run on a simple program that contains a main thread and a
worker thread:

---- at ----:~/Sable/example-dev$ for jar in `ls ../soot-dev/lib/*.jar`; do
CLASSPATH=$CLASSPATH:$jar; done;
CLASSPATH=$CLASSPATH:../jasminclasses-2.3.0.jar:../polyglotclasses-1.3.5.jar;
java -classpath $CLASSPATH soot.Main -w -app -cp
/usr/lib/jvm/java-6-sun/jre/lib/rt.jar:/usr/lib/jvm/java-6-sun/jre/lib/jce.jar:/usr/lib/jvm/java-6-sun/jre/lib/jsse.jar:./
-src-prec java -p cg.spark enabled:true -p wjtp.tn enabled:true -p
wjtp.tnlocking-scheme:leave-original -p
wjtp.tn do-tlo:false example.Example
Soot started on Fri Oct 09 09:09:50 PDT 2009
[Call Graph] For information on where the call graph may be incomplete, use
the verbose option to the cg phase.
[Spark] Pointer Assignment Graph in 3.8 seconds.
[Spark] Type masks in 0.4 seconds.
[Spark] Pointer Graph simplified in 0.0 seconds.
[Spark] Propagation in 44.1 seconds.
[Spark] Solution found in 44.1 seconds.
[wjtp.tn] *** Build May-Happen-in-Parallel Info *** Fri Oct 09 09:10:45 PDT
2009
[mhp]
[mhp] User Thread (Single, SRO,---): Started in <example.Example: void
main(java.lang.String[])> by virtualinvoke t1.<java.lang.Thread: void
start()>()
[mhp] [<java.lang.Thread: void run()>
[mhp]   <example.Example: void run()>
[mhp]   <java.util.concurrent.ThreadPoolExecutor$Worker: void run()>
[mhp]   <example.Example: int getThreadNum()>]
[mhp]
[mhp] Main Thread (Single, ---,---):
[mhp] [<example.Example: void main(java.lang.String[])>
[mhp]   <example.Example: void <init>(int)>]
[mhp]
[wjtp.tn] *** Find and Name Transactions *** Fri Oct 09 09:10:45 PDT 2009
[wjtp.tn] *** Find Transitive Read/Write Sets *** Fri Oct 09 09:10:46 PDT
2009
[wjtp.tn] *** Calculate Locking Groups *** Fri Oct 09 09:10:46 PDT 2009
[wjtp.tn] *** Detect the Possibility of Deadlock *** Fri Oct 09 09:10:46 PDT
2009
[wjtp.tn] *** Calculate Locking Objects *** Fri Oct 09 09:10:46 PDT 2009
[wjtp.tn] *** Print Output and Transform Program *** Fri Oct 09 09:10:46 PDT
2009
Transforming example.Example...
Writing to sootOutput/example/Example.class
Soot finished on Fri Oct 09 09:10:46 PDT 2009
Soot has run for 0 min. 55 sec.

The list of methods potentially called by each thread is listed.  Soot also
maintains a complete call graph, so you could combine the two to get what
you're looking for.

-Richard

On Fri, Oct 9, 2009 at 6:25 AM, LuoQingZhou <seriousamlqz at yahoo.cn> wrote:

>  Hi Guys,
>
> I'm wondering if soot has any package(or has a plan to) to generate
> inter-thread call graph/control flow graph, as stated in IBM report "Static
> datarace analysis for multithreaded object-oriented programs" by J.D.Choi
> and so....?
>
> Thanks~
>
>
> Qingzhou
>
> __________________________________________________
> 赶快注册雅虎超大容量免费邮箱?
> http://cn.mail.yahoo.com
>
> _______________________________________________
> Soot-list mailing list
> Soot-list at sable.mcgill.ca
> http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.cs.mcgill.ca/pipermail/soot-list/attachments/20091009/5722bb57/attachment.html 


More information about the Soot-list mailing list