[Contiki-developers] execution trace with mspsim and cooja

164 views
Skip to first unread message

Leonardo Steinfeld

unread,
May 26, 2011, 7:53:48 PM5/26/11
to contiki-d...@lists.sourceforge.net
Hi all,

I want to get a sky node execution trace simulating a network using
cooja. Since, at this moment it's ok for me to get a single node trace,
maybe the easiest way it is to use the already "Debug On" option of
mspsim, that just print the disassemble to console. I tried the trace
command of the msp plug-in CLI (command line interface) but throws an
exception. Besides that, I need a trace of millions of instructions.
My idea is to add a new CLI (command line interface) command. Inspired
from the implementation of other commands, I do modified the class
DebugCommands to add a new command "debug" to call cpu.SetDebug(true)
(above the code snippet). I recompiled mspsim and copy the mspsim.jar to
contiki/tools/mspsim, so that the cooja build process will copy this
file to cooja/apps/mspsim/lib directory. However, this small change will
prevent compiling cooja. After many attempts I verified that the mspsim
downloaded using git, will make the cooja halt after a few ms of
simulation. So I tried with the mspsim-source-2009-04-30 version, but
this time a exception is trowed: java.lang.NoSuchMethodError:
se.sics.mspsim.core.MSP430.setTrace(I)V.
I've seen there is also a "TODO" in the classs
se.sics.cooja.mspmote.MspMote.java in cooja/apps/mspsim/MspMote.java
(line: this.myCpu.setTrace(0); /* TODO Enable */), and such a methods
there is not in the mspsim version I get. I imagine mspsim.jar coming
with the contiki-2.5.rc1.zp has this method, but it is not clear how to
"call" this method from cooja or even if it is appropriate for my purposes.

I hope if I get a compatible version of the source code of mspsim and
cooja I will manage to implement and use the proposed modification.

Any clue? I would appreciate also any suggestion about how to get an
execution trace.

Best regards,
Leo

---------------------
DebugCommands.java [snippet]

ch.registerCommand("debug", new BasicCommand("debug, print
execution trace", "<on|off>") {
public int executeCommand(final CommandContext context) {
if ("on".equals(context.getArgument(0)))
cpu.setDebug(true);
else if ("off".equals(context.getArgument(0)))
cpu.setDebug(false);
return 0;
}
});

------------------------------------------------------------------------------
vRanger cuts backup time in half-while increasing security.
With the market-leading solution for virtual backup and recovery,
you get blazing-fast, flexible, and affordable data protection.
Download your free trial now.
http://p.sf.net/sfu/quest-d2dcopy1
_______________________________________________
Contiki-developers mailing list
Contiki-d...@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/contiki-developers

Leonardo Steinfeld

unread,
Jun 1, 2011, 11:31:16 AM6/1/11
to contiki-d...@lists.sourceforge.net
Hi,
Please could someone indicate a pair of contiki-mspsim version that work
together.
If I recompile mspsim, regardless of where I get it -git, svn (last
activity 3 month ago), or the mspsim-source-2009-04-30.zip- does not
work with any of the contiki versions. I tried many combinations and I
get compilation errors or runtime exceptions. Above follows some examples.
Best regards,
Leo S.
PS: Last week I post a mail asking for help, explaining the purpose for
recompiling mspsim. Maybe this simple issue of compatibility versions
between mspsim and cooja get lost along the long explanation of my
needs....

------------------------
Listing.
1.- mspsim from git and contiki from git => compilation error
...
compile:
[javac] Compiling 15 source files to
/home/leo/work/contiki/tools/cooja/apps/mspsim/build
[javac]
/home/leo/work/contiki/tools/cooja/apps/mspsim/src/se/sics/cooja/mspmote/interfaces/MspSerial.java:75:
<anonymous se.sics.cooja.mspmote.interfaces.MspSerial$1> is not abstract
and does not override abstract method
dataReceived(se.sics.mspsim.core.USARTSource,int) in
se.sics.mspsim.core.USARTListener
[javac] usart.setUSARTListener(new USARTListener() {
[javac] ^
[javac]
/home/leo/work/contiki/tools/cooja/apps/mspsim/src/se/sics/cooja/mspmote/interfaces/TR1001Radio.java:73:
se.sics.cooja.mspmote.interfaces.TR1001Radio is not abstract and does
not override abstract method
dataReceived(se.sics.mspsim.core.USARTSource,int) in
se.sics.mspsim.core.USARTListener
[javac] public class TR1001Radio extends Radio implements
USARTListener, CustomDataRadio {
[javac] ^
[javac] 2 errors
2.- mspsim form git and contiki-2.5.rc1 => runtime error
[java] **** Warning - writing to CC2420 when VREG is off!!!
[java] Exception in thread "Thread-3" java.lang.AbstractMethodError
[java] at se.sics.mspsim.core.USART.handleTransmit(USART.java:375)
[java] at se.sics.mspsim.core.USART.access$000(USART.java:44)
[java] at se.sics.mspsim.core.USART$1.execute(USART.java:123)
[java] at
se.sics.mspsim.core.MSP430Core.executeEvents(MSP430Core.java:557)
[java] at
se.sics.mspsim.core.MSP430Core.emulateOP(MSP430Core.java:1574)
[java] at se.sics.mspsim.core.MSP430.stepMicros(MSP430.java:265)
[java] at se.sics.cooja.mspmote.MspMote.execute(MspMote.java:327)
[java] at se.sics.cooja.mspmote.MspMote.execute(MspMote.java:300)
[java] at
se.sics.cooja.motes.AbstractWakeupMote$1.execute(AbstractWakeupMote.java:46)
[java] at se.sics.cooja.Simulation.run(Simulation.java:270)
[java] at java.lang.Thread.run(Thread.java:636)

------------------------------------------------------------------------------
Simplify data backup and recovery for your virtual environment with vRanger.
Installation's a snap, and flexible recovery options mean your data is safe,
secure and there when you need it. Data protection magic?
Nope - It's vRanger. Get your free trial download today.
http://p.sf.net/sfu/quest-sfdev2dev

Niclas Finne

unread,
Jun 9, 2011, 5:56:11 PM6/9/11
to contiki-d...@lists.sourceforge.net
Hi,

I have updated Contiki with latest version of MSPSim.

MSPSim from git and Contiki from git should now work together.

Best regards,
-- Niclas Finne

------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev

Niclas Finne

unread,
Jun 9, 2011, 6:56:43 PM6/9/11
to Contiki developer mailing list
Hi,

Do you need an instruction trace? I often use the MSPSim command
'logcalls' to trace function calls.

Best regards,
-- Niclas Finne

------------------------------------------------------------------------------


EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev

Leonardo Steinfeld

unread,
Jun 13, 2011, 8:40:59 AM6/13/11
to contiki-d...@lists.sourceforge.net
Hi Niclas ,
Thanks. I tried the modification I proposed and worked fine.
I need a instruction by instruction execution trace, thanks for your
suggestion anyway.
Best regards,
Leo Steinfeld

------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev

Moritz Struebe

unread,
Jun 14, 2011, 3:12:17 AM6/14/11
to Contiki developer mailing list
On 2011-05-27 01:53, Leonardo Steinfeld wrote:
> Any clue? I would appreciate also any suggestion about how to get an
> execution trace.

If I remember right, there is something like I a next tick hook. You
could try using that to dump the PC. This might even work platform
independent.

Cheers
Morty

--
Dipl.-Ing. Moritz 'Morty' Struebe (Wissenschaftlicher Mitarbeiter)
Lehrstuhl für Informatik 4 (Verteilte Systeme und Betriebssysteme)
Friedrich-Alexander-Universität Erlangen-Nürnberg
Martensstr. 1
91058 Erlangen

Tel : +49 9131 85-25419
Fax : +49 9131 85-28732
eMail : str...@informatik.uni-erlangen.de
WWW : http://www4.informatik.uni-erlangen.de/~morty


Alexandre Boeglin

unread,
Jul 8, 2011, 11:28:59 AM7/8/11
to Contiki developer mailing list
Le jeudi 09 juin 2011 à 23:56, Niclas Finne a écrit:
> Hi,
>
> I have updated Contiki with latest version of MSPSim.
>
> MSPSim from git and Contiki from git should now work together.

Hi,

It seems that the DwarfReader class in mspsim doesn't implement the
getExecutableAddresses and getSourceFiles methods.

Does someone, by any chance, already have code for them, or should I get
to it?


Best regards,
Alexandre

------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2

Reply all
Reply to author
Forward
0 new messages