[Soot-list] Questions about profiler2 example

Kelvin Tian kevinn.tian at gmail.com
Thu Jul 16 10:48:35 EDT 2009


    I'm using Soot to do some instrumentation, and I've some questions
related to the profiler2 example, under link
http://www.sable.mcgill.ca/soot/tutorial/profiler2/index.html ?
 In this example, I see it use a counter class to add a counter to count the
number of InvokeStatic statements, and there's only one counter.  If I want
to create several counters to get different profiling information, can I
create several instances of counter class and use each instance to count
different things?
I tried to do that, coding similarly like below,
(ie:
   SootClass counter1 =  Scene.v().loadClassAndSupport("MyCounter");
   increaseCounter1 = counter1.getMethod("void increase(int)");
   .....
   SootClass counter2 =  Scene.v().loadClassAndSupport("MyCounter");
   increaseCounter2 = counter2.getMethod("void increase(int)");
   ...
)
but I got a lot of runtime errors like this: " Exception in thread "main"
java.lang.RuntimeException: This operation requires resolving level
SIGNATURES but MyCounter is at resolving level HIERARCHY  If you are
extending Soot, try to add the following call before calling soot.Main.main
"

So I just wonder if this is applicable to create different instances of
counter class, and if not, are there any better ways to create more than one
counter? Or do I have to instrument jimple code to manually add counter code
for each counter I want?  Thanks so much for answers!



--
Best regards,
Kelvin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.cs.mcgill.ca/pipermail/soot-list/attachments/20090716/ef0e6844/attachment.html 


More information about the Soot-list mailing list