Bug 305 - Tracing asserts too easily now
: Tracing asserts too easily now
Status: RESOLVED INVALID
: ns-3
simulation core
: pre-release
: All All
: P3 normal
Assigned To:
:
:
:
:
  Show dependency treegraph
 
Reported: 2008-09-03 10:22 EDT by
Modified: 2008-09-05 00:05 EDT (History)


Attachments


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2008-09-03 10:22:50 EDT
With this simple tracing code:
http://code.nsnam.org/gjc/ns-3-pyviz/rev/6eccb090137c

This happens:

Incompatible types. (feed to "c++filt -t")
got=N3ns318MemPtrCallbackImplIPNS_5PyVizEMS1_FvSsNS_3PtrIKNS_6PacketEEENS_12Mac48AddressEEvSsS6_S7_NS_5emptyESA_SA_EE,
expected=PN3ns312CallbackImplIvSsNS_3PtrIKNS_6PacketEEENS_5emptyES5_S5_S5_EE
Command ['/usr/bin/python', 'examples/mixed-wireless.py'] exited with code -11 

It turns out that CsmaNetDevice and WifiNetDevice have different Tx/Rx trace
event signatures:

wifi:   TracedCallback<Ptr<const Packet>, Mac48Address> m_rxLogger;
csma:   TracedCallback<Ptr<const Packet> > m_rxTrace;

The code asserted when connecting on a csma netdevice, which has a different
signature.

Why they have different signatures is another problem.  Right now I am
concerned about why TraceConnect asserts.  Why does this common use case of
catching every transmission have to be so damn hard in NS-3? :-(

Thoughts?
------- Comment #1 From 2008-09-03 11:18:28 EDT -------
There is no such thing as "connect to all tx events" and I said so many times.
You have to be specific to request to which events you want to connect. I would
suggest using the $ns3::CsmaNetDevice notation:

"/NodeList/*/DeviceList/*/$ns3::CsmaNetDevice/Tx"
"/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Tx"

If you want an API which hides this, you need to use the Helper API.
------- Comment #2 From 2008-09-03 12:51:52 EDT -------
OK, cool trick, but not easy to come up with the idea :P
Maybe we need a FAQ, or code snippets repository :)
------- Comment #3 From 2008-09-03 12:57:02 EDT -------
(In reply to comment #2)
> OK, cool trick, but not easy to come up with the idea :P
> Maybe we need a FAQ, or code snippets repository :)

I am all for a FAQ and I will fill answers for questions added there.
------- Comment #4 From 2008-09-05 00:05:48 EDT -------
(In reply to comment #3)
> (In reply to comment #2)
> > OK, cool trick, but not easy to come up with the idea :P
> > Maybe we need a FAQ, or code snippets repository :)
> 
> I am all for a FAQ and I will fill answers for questions added there.
> 

There are several places for this type of information.

Joe started this page:
http://www.nsnam.org/wiki/index.php/Category:Samples

We also have a user FAQ:
http://www.nsnam.org/wiki/index.php/User_FAQ

Or the manual.