[Soot-list] LOC in Dacapo-2006 benchmark

Zhoulai zell08v at orange.fr
Wed Jan 30 03:25:51 EST 2013


Thank you a lot, Xiao.  Among others, I was doing a small benchmark with
geometric encoding. Luckily the bad result is not yet submitted!

But, the problem is now, why I counted 182 109 LOC for 'fop' benchmark
using the same Soot options? I am running soot from Eclipse, but without
that plugin. I run soot.Main.main with className  dacapo.fop.Main. This
file by itself should not contain 182109 lines, shouldn't it?  I used -app
option. The document of soot command line says,

-app
Run in application mode, processing all classes referenced by argument
classes.

How does Soot get all class referenced by argument class? By a call-graph I
suppose? It is not sufficient to read Soot's document. One needs to guess:(
Sorry  I feel totally confused.

So how can I count so few LOC for xalan, yet  so many for fop, using the
same soot options!!??

Zell.

p.s.

Here is how I specify the class file name.

        ...
        String dacapoName=config.getProperty(Configuration.DACAPONAME);
        String
JRE14="/System/Library/Frameworks/JavaVM.framework/Versions/1.4/Classes/jce.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.4/Classes/classes.jar";

     String sootClassPath=JRE14+":"+prePath+"/"+dacapoName+".jar"+":"
                + prePath+"/"+dacapoName+"-deps.jar";

        className="dacapo."+dacapoName+".Main";


On Wed, Jan 30, 2013 at 9:02 AM, Richard Xiao <richardxx at cse.ust.hk> wrote:

> Hi,
>
> Your code "SootClass c: Scene.v().getApplicationClasses()", that only
> counts the methods manually provided in your soot command line.
>
> Please obtain the reachable methods from CallGraph.ReachableMethods()
> function:
> http://www.sable.mcgill.ca/soot/doc/soot/jimple/toolkits/callgraph/ReachableMethods.html
>
>
> Regards,
> Xiao
>
>
> On Wed, Jan 30, 2013 at 3:51 PM, Zhoulai <zell08v at orange.fr> wrote:
>
>> Thank  you for your quick reply.
>>
>> The codes for LOC counting is mixed in the project. But basically,  it is
>> computed iteratively (accumulated in TotalLoc below) the LOC of all the
>> reachable methods from Main.
>> //*** The computation of LOC is here//
>>        TotalLOC = 0;
>>         for (SootClass sc: class2profiles.keySet()){
>>
>>             for (Profile pf: class2profiles.get(sc)){
>>                 totalLOC+=pf.getBody().getUnits().size();
>>               }
>>        }
>>
>> //*** my analysis is basically here, which collects reachable method from
>> Main,
>>     public MySceneTransformer(Map<SootClass, ArrayList<Profile>>
>> class2profiles) {
>>         this.class2profiles=class2profiles;
>>
>>         @Override
>>         protected void internalTransform(String phaseName, Map options) {
>>          public Map<SootClass, ArrayList<Profile>> class2profiles;
>>           for (SootClass  c: Scene.v().getApplicationClasses()){
>>               ArrayList<Profile> profiles = new ArrayList<Profile>();
>>               for (SootMethod sm:  c.getMethods()){
>>               ...
>>                    if (!sm.isConcrete() || sm.getName().equals("<init>"))
>>                     continue;
>>             ...
>>             profiles.add(sm);
>>           }
>>          class2profiles.put(c,profiles)
>> }
>>
>> Any idea?
>> Zell.
>>
>>
>>
>> On Wed, Jan 30, 2013 at 8:25 AM, Tony Yan <yan at cse.ohio-state.edu> wrote:
>>
>>> Hi,
>>>
>>> Can you show the code to count LOC?
>>>
>>> Thanks,
>>> Tony
>>>
>>> On Wed, Jan 30, 2013 at 2:19 AM, Zhoulai <zell08v at orange.fr> wrote:
>>> > Hello,
>>> >
>>> > Recently, I analyzed Dacapo-2006 using soot. I find the LOC that I got
>>> for
>>> > the benchmark is much less than the one in your 2006's oopsla paper.
>>> >
>>> > In particular, I find xalan has only 4786 LOC, hsqldb has 5634 LOC,
>>> fop has
>>> > 182109 LO . I am aware of issues related to whether to count LOC of
>>> library
>>> > class. But I am using the options that maximal LOC could have been
>>> collected
>>> > started from main class.
>>> >
>>> > The options I used include: -pp, -w, -app, and the following
>>> >
>>> >            sootArgs.add("-include");
>>> >             sootArgs.add("org.apache.");
>>> >             sootArgs.add("-include");
>>> >             sootArgs.add("org.w3c.");
>>> >             sootArgs.add("-p");
>>> >             sootArgs.add("cg.spark");
>>> >             sootArgs.add("enabled:true");
>>> >             sootArgs.add("-p");
>>> >             sootArgs.add("cg.spark");
>>> >             sootArgs.add("on-fly-cg:true");
>>> >
>>> > Do you think it is normal to have 4786 LOC for xalan?
>>> >
>>> > Zell.
>>> >
>>> > _______________________________________________
>>> > Soot-list mailing list
>>> > Soot-list at sable.mcgill.ca
>>> > http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
>>> >
>>>
>>
>>
>> _______________________________________________
>> Soot-list mailing list
>> Soot-list at sable.mcgill.ca
>> http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
>>
>>
>
>
> --
> Richard Xiao Xiao
> PhD Student @ CSE @ Hong Kong University of Science and Technology
> www.cse.ust.hk/~richardxx
>
> _______________________________________________
> 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/20130130/ef2117e3/attachment.html 


More information about the Soot-list mailing list