Bugzilla – Bug 305
Tracing asserts too easily now
Last modified: 2008-09-05 00:05:48 UTC
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?
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.
OK, cool trick, but not easy to come up with the idea :P Maybe we need a FAQ, or code snippets repository :)
(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.
(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.