资源预览内容
第1页 / 共68页
第2页 / 共68页
第3页 / 共68页
第4页 / 共68页
第5页 / 共68页
第6页 / 共68页
第7页 / 共68页
第8页 / 共68页
第9页 / 共68页
第10页 / 共68页
亲,该文档总共68页,到这儿已超出免费预览范围,如果喜欢就下载吧!
资源描述
Copyright 1999 MIL 3, Inc.Debugging Simulation Models (Introduction) 1Debugging Simulation Models (Introduction)Presented byYevgeny GurevichCopyright 1999 MIL 3, Inc.Debugging Simulation Models (Introduction) 2GoalsTeach use of OPNET Debugger (ODB)How to debug modelsReview features and commandsExplain their useDiscuss the debugging processStep-by step methods for debugging modelsWill not cover source-level debuggingC programmingSegmentation violation, bus errorCopyright 1999 MIL 3, Inc.Debugging Simulation Models (Introduction) 3AgendaInterpreting Error Messages Using the OPNET Debugger (ODB)Invoking ODBODB concepts-Development Kernel-Breakpoints, traces, labels, maps, entity information-Diagnostic block-Identification of memory allocationTwo hands-on labs use ODBUsing Animation for DebuggingCopyright 1999 MIL 3, Inc.Debugging Simulation Models (Introduction) 4The ChallengeDebugging can be like finding a needle in a haystackNarrow down the problemTime (event #)Space (code segment)Different types of problemsStructuralSimulation fails to execute successfullyIllustrated in Lab 1BehavioralSimulation executes successfully, but does notaccurately represent modelers intentIllustrated in Lab 2Copyright 1999 MIL 3, Inc.Debugging Simulation Models (Introduction) 5Object ReferenceObjects can be identified in two waysObject ID: Unique integer identifying objectObject Name: Hierarchical name of object:Format: .top.e_campus.bldg_10.router.in_queuetop.e_campus.bldg_10routerin_queueCopyright 1999 MIL 3, Inc.Debugging Simulation Models (Introduction) 6Simulation Error ClassificationsSimulation traps errorsClassified into the following types:Program AbortProblem that prohibits the simulation from proceedingRecoverable ErrorProblem that does not prohibit the simulation from proceeding,but may result in cancellation of the current operation Diagnostic ErrorProblem that is recoverable, but minor; only reported ifdiag_enable environment attribute is TRUEWarningTypically generated by model to identify problems withinmodel itself, written by model developer usingop_sim_message() Kernel Procedure (KP)Copyright 1999 MIL 3, Inc.Debugging Simulation Models (Introduction) 7Example of a Simulation Error Message|-| | Output stream index (1) is out-of-range. | T (21.4), EV (254), MOD (top.sample_net.stn_5.mac), KP (op_pk_send) |-|Type: Type of error (recoverable error)Messages: Match in Kernel Procedure docs (non existing stream)T: Simulation time of errorEV: Event ID of simulation eventMOD: Name of module where error occurred (mac module of stn_5)KP: Name of Kernel Procedure that reported the problemCopyright 1999 MIL 3, Inc.Debugging Simulation Models (Introduction) 8Obtaining a Function Call Stack (FCS)FCS provides the user withMore detailsLocates error in spaceContains function listingserr_log file in /op_admin records all FCSsThis file will grow over time and may be periodically removedm3_vuerr utility extracts last FCS from err_log-num_err attribute can be used to extract the last N errors in case the error of interest is not the most recentExample:m3_vuerr -num_err 5Copyright 1999 MIL 3, Inc.Debugging Simulation Models (Introduction) 9Example Function Call Stack * Function call stack: (builds down) - Call Block Count Line# Function - 0) 1 141 main (argc, argv, envp) 1) 1 414 sim_init (argc, argv, envp, num_procs, proc_set_ptr) 2) 1 363 sim_ev_loop () 3) 17 212 sim_obj_qps_intrpt (simev_ptr) 4) 10 23 bursty_gen () init enter execs 5) 10 57 op_pk_send (objid, direction, objmtype, index) . 6) 1 123 *sim_err_issue (pkg_id, msg_id, ) 7) 1 181 sim_err_print (severity_level, str0, str1) 8) 1 282 Vos_Error_Print (level, package, err0, err1, err2) -Sim.KernelErrorMessagePrintingProcess modeland stateKP reportingproblemCopyright 1999 MIL 3, Inc.Debugging Simulation Models (Introduction) 10Block Line Numbers in Function Call Stacks Block Line Numbers refer to last curly brace passed 1int function(void)23int x, z;45FIN (function (void)6z = 0;A7for (x = 0; x promptTo exit the simulation: quit - terminates the simulation normally (creates output files)exit - immediately exits ODB, no output file created% op_runsim -net_name example -debug_ OPNET Simulation Debugger _Type help for Command SummaryodbTime 0, before begsim interrupts are deliveredCopyright 1999 MIL 3, Inc.Debugging Simulation Models (Introduction) 16Getting Help in ODBhelp command is available at odb prompthelp: displays summary of help categorieshelp : displays help on specified categoryhelp : displays help on specified commandodb help_ OPNET Debugger Help _ There are three levels of help: help - displays summary of help categories. help - display help on specified category. help - display help on specified command._ Command Categories builtin _ all basic action .Copyright 1999 MIL 3, Inc.Debugging Simulation Models (Introduction) 17Agenda: ODB ConceptsBreakpointsTracesLabelsLab 1BreakMapsEntity InformationLab 2Diagnostic BlockIdentification of Memory AllocationCopyright 1999 MIL 3, Inc.Debugging Simulation Models (Introduction) 18ODB Concept 1: BreakpointsInterrupt simulation executionAllow the user to issue commands at the odb promptTwo methods of advancing simulation execution within ODB:Single event executionContinuation of event execution until a breakpoint occursCommandsnext - executes one event and stops before the next eventcont - continues simulation execution until a pending breakpoint-May be equivalent to several next commandsCopyright 1999 MIL 3, Inc.Debugging Simulation Models (Introduction) 19Interpreting the Event BannerAt each breakpoint, event banner for next pending event is displayed_ (ODB 6.0.L: Event) _ * Time : 9.08349170694 sec, 00d 00h 00m 09s . 083ms 491us 706ns 942ps * Event : execution ID (10), schedule ID (#20), type (stream intrpt) * Source : execution ID (9), top.pksw1.node_0. src (ideal generator) * Data : instrm (1), packet ID (1) Module : top.pksw1.node_0.proc (processor)TimeSimulation time associated with the eventEventEvent ID associated with the eventSourceModule generating the interruptTypeType of interrupt that will be deliveredDataOther information associated with the eventModuleSimulation object where the event will occurCopyright 1999 MIL 3, Inc.Debugging Simulation Models (Introduction) 20Basic Breakpoint CommandsNextExecute the next pending event andset a breakpoint after its completionThe following commands set breakpoints:evstopFor specified pending eventtstopFor specified timemstopFor all interrupts delivered to a specific moduleprostopWhen a specified process is about to be invokedintstopFor a specified module and type of interrupt Copyright 1999 MIL 3, Inc.Debugging Simulation Models (Introduction) 21Status Command to Review Existing Breakpointsstatus command displays all pending breakpointsodb evstop 34odb tstop 40odb statusBreakpoints : 1) stop at event (34) 2) stop at time = (40) sec.Traces : NoneCopyright 1999 MIL 3, Inc.Debugging Simulation Models (Introduction) 22Deletion and Suspension of BreakpointsBreakpoints may be deleted while still pendingCommand: delstopBreakpoints may be suspended, then re-activated so that complete recreation is not necessaryCommands: suspstop, actstopCopyright 1999 MIL 3, Inc.Debugging Simulation Models (Introduction) 23ODB Concept 2: TracesA list of KPs called by a processUsed to print detailed information about event executionTypical traces:Display details of Kernel Procedures invoked during events, includingthe KP name, argument names and their values, return valueContain information about the process being executedOnce activated, a trace remains active until deactivatedCopyright 1999 MIL 3, Inc.Debugging Simulation Models (Introduction) 24Interpreting the ODB Process Message Format* invoking process (“pk_sink”)_state (st_0): exit executives_* op_intrpt_strm ()active strm(0)* op_pk_get (instrm_index)strm. index(0)packet ID (1)* op_pk_destroy (pkptr)packet ID(1)_state (st_1): enter executives_*returning from process (“pk_sink”) Process invocation Process return State banner KP invocations State bannerCopyright 1999 MIL 3, Inc.Debugging Simulation Models (Introduction) 25Interpreting the KP Invocation Trace FormatKernel Procedure invocation argument valuesKernel Procedure return valuesCopyright 1999 MIL 3, Inc.Debugging Simulation Models (Introduction) 26Basic Trace Commandsfulltrace: Global tracing of all KP invocationsToggles between enabled or disabledOther commands restrict traces to focused conditions:mtraceKPs invoked within a specified moduleprotraceKPs invoked within a specified module processpktraceKPs which affect a certain packetpttraceKPs which affect a certain packet traceCopyright 1999 MIL 3, Inc.Debugging Simulation Models (Introduction) 27odb pktrace 5odb mtrace 11odb protrace 0odb statusBreakpoints : NoneTraces : 0) trace on packet with ID (5) (packet not in system) 1) trace on module (top.pksw1.node_0. proc) 2) trace on process (0)Status Command to Review Existing Tracesstatus command displays all pending tracesCopyright 1999 MIL 3, Inc.Debugging Simulation Models (Introduction) 28Deletion and Suspension of TracesTraces may be deletedCommand: deltraceTrace may be suspended, then re-activated so that complete recreation is not necessaryCommands: susptrace, acttraceIf fulltrace is active, fulltrace again toggles to inactiveCopyright 1999 MIL 3, Inc.Debugging Simulation Models (Introduction) 29ODB Concept 3: LabelsLabels may be established by process model code to allow traces restricted to classes of activity (print the values of state or temporary variables, results of statements)User-defined trace statements may be added to a process modelMany OPNET standard models use labelse.g. TCP, ATMCommands:ltrace: sets a trace for a specified label-Example: ltrace atmmltrace:sets a trace for a specified module and labelproltrace - sets a trace for a specified process model and labelCopyright 1999 MIL 3, Inc.Debugging Simulation Models (Introduction) 30_ (ODB 6.0.L: Event) _ * Time : 972.409334997 sec, 00d 00h 16m 12s . 409ms 334us 997ns 496ps * Event : execution ID (15204), schedule ID (#15605), type (remote intrpt) * Source : execution ID (15203), top.Office network.DEVELOPMENT. tcp (processor) * Data : code (10) Module : top.Office network.DEVELOPMENT.tcp (processor) | Removing connection (14) from TCB list./* Print trace information if enabled */if (op_prg_odb_ltrace_active (“tcp”)sprintf (msg0, “Removing connection (%d) from TCB list.”, conn_id);op_prg_odb_print_minor (msg0, OPC_NIL);Example: Label TraceUser-defined code in a that checks for a label and prints the relevant information:Output when running a simulation with the TCP trace turned on (ltrace tcp):Copyright 1999 MIL 3, Inc.Debugging Simulation Models (Introduction) 31A Basic Debugging Paradigm1. Locate the errorFrom error message, identify event number of an error2. Stop the simulation at the last event before the errorIn ODB, evstop with that event numbercont to “skip ahead” to that event of interest3. Turn on traces fulltrace to turn on detailed tracenext to view execution details of the event of interest4. Inspect the traces5. Fix the problemCopyright 1999 MIL 3, Inc.Debugging Simulation Models (Introduction) 32LAB: Using evstop and fulltraceContext: Packet Switching Tutorial model Packets are evenly routed between 4 nodes via a hubOpen Project Editor and load pksw_net modelOpen Lab1 scenarioNetwork Modelnode_0 modelhub modelCopyright 1999 MIL 3, Inc.Debugging Simulation Models (Introduction) 33 * Time: 13:05:05 Mon Jul 19 1999 * Program: op_runsim (Version 6.0.L PL5) * Error: Packet pointer is NIL T (8.93569), EV (6), MOD (top.pksw1.node_1.proc), KP (op_pk_nfd_set)Error Message from pksw_net1. Execute simulation from command lineop_runsim -net_name pksw_net-lab12. Inspect error message3. Note: Event ID 6Copyright 1999 MIL 3, Inc.Debugging Simulation Models (Introduction) 34Obtain fulltrace Information of Error Event1. Execute simulation in debug modeop_runsim -net_name pksw_net-lab1 -debug -noprompt2. Set evstop for event 6 (evstop 6)3. cont to continue until event 64. fulltrace to toggle global tracing5. next to execute pending event_ (ODB 6.0.L: Event) _ * Time : 8.9356938109 sec, 00d 00h 00m 08s . 935ms 693us 810ns 900ps* Event : execution ID (6), schedule ID (#14), type (stream intrpt)* Source : execution ID (5), top.pksw1.node_1.src (ideal generator)* Data : instrm (1), packet ID (0) Module : top.pksw1.node_1.proc (processor)breakpoint trapped : stop at event (6)Copyright 1999 MIL 3, Inc.Debugging Simulation Models (Introduction) 35Inspect fulltrace Information of Error Event _state (xmt): enter executives_* op_pk_get (instrm_index)strm. index (0)strm. is empty.* op_dist_outcome (dist_ptr)dist. ptr. (0x00893438)distribution (uniform_int (0.000000000000e+000, 3.000000000000+000)outcome (1.0) * Time: 15:05:54 Mon Jul 19 1999 * Program: op_runsim (Version 6.0.L PL0) * Error: Packet pointer is NILT (8.93569), EV (6), MOD (top.pksw1.node_1.proc), KP (op_pk_nfd_set)6. Observe: packet arrived on stream 1, but op_pk_get() attempts to access stream 07. quit to quit ODB.Copyright 1999 MIL 3, Inc.Debugging Simulation Models (Introduction) 36Edit Process Model1.In the Project Editor double click onnode_1 to edit module proc module proc to edit process model pksw_nd_proc2. Edit enter executive of xmt stateChangepkptr = op_pk_get (RCV_IN_STRM)topkptr = op_pk_get (SRC_IN_STRM)3. Compile process modelCopyright 1999 MIL 3, Inc.Debugging Simulation Models (Introduction) 37Execute Corrected pksw_netprompt% op_runsim -net_name pksw_net-lab1|-| Module (11), (top.pksw1.node_0.proc) | From procedure: pksw_nd_proc () end enter execs | Node node_0: received 81 packets. |-|-| Module (22), (top.pksw1.node_1.proc) | From procedure: pksw_nd_proc () end enter execs | Node node_1: received 0 packets. |-|-| Simulation Completed - Collating Results. | Simulated: Time (16 min. 40 sec.), Events (1077) | Time: Elapsed (3 sec.) |-|Copyright 1999 MIL 3, Inc.Debugging Simulation Models (Introduction) 38BreakCopyright 1999 MIL 3, Inc.Debugging Simulation Models (Introduction) 39ODB Concept 4: Maps A list of simulation objects corresponding to some criteriaProvides object IDs and corresponding topological “location”Objects are identified by name or object IDInspect state of simulation objects and packetsTypically:Selection of a specific object (RIP process at Router_4) Selection of all objects of a specific type (map of all queue objects in the simulation, packets from the same packet tree)Copyright 1999 MIL 3, Inc.Debugging Simulation Models (Introduction) 40odb objmap proc hubObj ID Obj Name Obj Type Parent ID- 55 top.pksw1.hub.hub processor 6Interpreting Map Command OutputPacket switching tutorial network:Object ID:Unique integer identifying objectObject Name: Hierarchical name of objectObject Type:Description of class of objectParent ID:Obj ID of parent objectCopyright 1999 MIL 3, Inc.Debugging Simulation Models (Introduction) 41Basic Map CommandsobjmapList of objects matching specified criteriapromapList of processes associated with a specifiedprocessor or queueobjidObject id of a specified objectobjassoc List of objects of the specified type that areassociated with the specified objectpkmap List of packets matching specified criteriaptmap List of packets belonging to a specified treeCopyright 1999 MIL 3, Inc.Debugging Simulation Models (Introduction) 42ODB Concept 5: Entity InformationCommands can be applied to objects to display verbose information about the state of the objectExamples: Print the current state of a subqueue including list of packets it containsPrint contents of packet fieldsCopyright 1999 MIL 3, Inc.Debugging Simulation Models (Introduction) 43Basic Entity Information Commandsobjprint: Display information about an object (attribute values, queue sizes and contents, process information)pkprint: Display information about a packet (ID, field values, current location, size)attrgetDisplay the current value of an attribute of an object attrsetAssign a new value to an attribute of an objectattrprintDisplay information about the internal state of a specified attributeCopyright 1999 MIL 3, Inc.Debugging Simulation Models (Introduction) 44Interpreting Entity Information Outputodb pkprint 6937* packet contents:ID : 6937format : ethernetcreation module : top.ethcoax_net.stn_8.maccreation time : 5.32919total size : 12208owner : top.ethcoax_net.stn_8.mac Index Name Type Value Size 0 preamble info unspecified 64 1 dst_addr integer 2 48 2 src_addr integer 6 48 3 type integer 0 16 4 data packet pk id (6936) 12000 5 last_sent_MAC_ID integer 148 0 Copyright 1999 MIL 3, Inc.Debugging Simulation Models (Introduction) 45Paradigm for Obtaining Entity InformationDetermine Object ID of object of interestobjmap to obtain a list of selected objectsorVisually identify object of interest from hierarchical names in mapand find its object IDPrint information about the objectUse objprint Copyright 1999 MIL 3, Inc.Debugging Simulation Models (Introduction) 46LAB: Using Entity Information CommandsProblem: Unexpected simulation results: all packets are received by node_0The error may indicate a problem with setting destination address field in packetsUse pkprint to investigate contents of packet fieldsCopyright 1999 MIL 3, Inc.Debugging Simulation Models (Introduction) 47Context: pksw_net Not Behaving Properlyprompt% op_runsim -net_name pksw_net-lab1|-| Module (11), (top.pksw1.node_0.proc) | From procedure: pksw_nd_proc () end enter execs | Node node_0: received 81 packets. |-|-| Module (22), (top.pksw1.node_1.proc) | From procedure: pksw_nd_proc () end enter execs | Node node_1: received 0 packets. |-| |-| Simulation Completed - Collating Results. | Simulated: Time (16 min. 40 sec.), Events (1077) | Time: Elapsed (3 sec.) |-|Copyright 1999 MIL 3, Inc.Debugging Simulation Models (Introduction) 48Approach: Trace One Packet1. Execute simulation in debug modeop_runsim -net_name pksw_net-lab1 -debug2. Set pktrace for packet 0 (pktrace 0)3. next until event involving packet 0 is encountered* Time : 8.9356938109 sec, 00d 00h 00m 08s . 935ms 693us 810ns 900ps* Event : execution ID (5), schedule ID (#10), type (self intrpt)* Source : execution ID (-1), top.pksw1.node_1.src (ideal generator)* Data : code (0) Module : top.pksw1.node_1.src (ideal generator)odb next* generating packetpacket ID(0)bulk size(9600)total size(9600)Copyright 1999 MIL 3, Inc.Debugging Simulation Models (Introduction) 49odb next* op_pk_get (instrm_index)strm. index (1)packet ID (0)* op_pk_nfd_set (pkptr, fd_name, value, )packet ID (0)field name (dest_address)field type (integer)field value (1)field size (0)* op_pk_send (pkptr, outstrm_index)packet ID (0)stream index (0)Tracing One Packet (continued)4. next to observe a packet field being setCopyright 1999 MIL 3, Inc.Debugging Simulation Models (Introduction) 50odb pkprint 0* packet contents:ID : 0tree ID : 0address : 0x8223F0format : pksw_formatcreation module : top.pksw1.node_1.srccreation time : 8.93569stamp module : top.pksw1.node_1.srcstamp time : 8.93569bulk size : 9600total size : 9600owner : top.pksw1.node_1.strm_2ICI ID : NONEID trace : ontree ID trace : offencap flags : NONEIndex Name Type Value Size0 dest_address integer 1 0Tracing One Packet (continued)5. pkprint to observe contents of packet fieldsCopyright 1999 MIL 3, Inc.Debugging Simulation Models (Introduction) 51Tracing One Packet (continued)6. next to continue tracing7. Hub receives packet at event 15, stop the simulation at event 15odb evstop 15odb cont._ (ODB 6.0.L: Event) _ * Time : 9.9356938109 sec, 00d 00h 00m 09s . 935ms 693us 810ns 900ps * Event : execution ID (15), schedule ID (#25), type (stream intrpt) * Source : execution ID (14), top.pksw1.hub.rcv3 (pt-pt receiver) * Data : instrm (3), packet ID (0) Module : top.pksw1.hub.hub (processor)Copyright 1999 MIL 3, Inc.Debugging Simulation Models (Introduction) 52Tracing One Packet (continued)8. next to continue tracing9. Observe further manipulation of packetodb next * op_pk_get (instrm_index) strm. index (3) packet ID (0) * op_pk_nfd_set (pkptr, fd_name, value, ) packet ID (0) field name (dest_address) field type (integer) field value (0) field size (0) * op_pk_send (pkptr, outstrm_index) packet ID (0) stream index (0)Copyright 1999 MIL 3, Inc.Debugging Simulation Models (Introduction) 53odb pkprint 0 * packet contents: ID : 0 tree ID : 0 address : 0x8223F0 format : pksw_format creation module : top.pksw1.node_1.src creation time : 8.93569 stamp module : top.pksw1.node_1.src stamp time : 8.93569 bulk size : 9600 total size : 9600 owner : top.pksw1.hub.strm_8 ICI ID : NONE ID trace : on tree ID trace : off encap flags : NONE Index Name Type Value Size 0 dest_address integer 0 0Tracing One Packet (continued)10. pkprint to observe contents of packet fieldsCopyright 1999 MIL 3, Inc.Debugging Simulation Models (Introduction) 54Localization of Error Observe: Value of packet field 0 has been changed to 0 from its originally set value of 1Packet is therefore sent on stream 0, not on stream 1 as expected11. Exit debuggerCopyright 1999 MIL 3, Inc.Debugging Simulation Models (Introduction) 55Edit Process Model1. In the project editor double click onnode hub to see module hub module hub to edit process model pksw_hub_proc2. Edit enter executive state route_pk Note that the destination address was never initialized3. Changeop_pk_nfd_set (pkptr, “dest_address”, dest_address);toop_pk_nfd_get (pkptr, “dest_address”, &dest_address);4. Compile process modelCopyright 1999 MIL 3, Inc.Debugging Simulation Models (Introduction) 56Execute Corrected pksw_netprompt% op_runsim -net_name pksw_net-lab1|-| Module (11), (top.pksw1.node_0.proc) | From procedure: pksw_nd_proc () end enter execs | Node node_0: received 22 packets. |-|-| Module (22), (top.pksw1.node_1.proc) | From procedure: pksw_nd_proc () end enter execs | Node node_1: received 23 packets. |-|Other nodes receive similar numbers of packets|-| Simulation Completed - Collating Results. | Simulated: Time (16 min. 40 sec.), Events (1077) | Time: Elapsed (2 sec.) |-|Copyright 1999 MIL 3, Inc.Debugging Simulation Models (Introduction) 57ODB Concept 6: Diagnostic BlockA section of process model code that may be invoked via an ODB commandTypically contains statements that display state information of interestvalues of state variablesContents of key data structures (example TCP Transmission Control Block, routing tables)Diagnostic block may be invoked from any breakpointCreated in Process EditorDiagnostic block buttonCopyright 1999 MIL 3, Inc.Debugging Simulation Models (Introduction) 58Example: Diagnostic BlockCode in Diagnostic block:Text in ODB:op_prg_odb_print_major (TCB list:, OPC_NIL);list_size = op_prg_list_size (tcb_list);for (i = 0; i conn_id, tcb_ptr-state_name);.| TCB list:| Connection (1) information: state (LISTEN)| Application objid (26034), Type of Service: As Requested by Client,| traffic through stream (1)Copyright 1999 MIL 3, Inc.Debugging Simulation Models (Introduction) 59Basic Diagnostic Block Commandsprodiag: invokes the diagnostic block of a specified processproldiag: executes the diagnostic block of the specified process and sets a trace for a specified label restricted to the execution of the blockExample: (Diagnostic block of ip_rte_v4.pr.m)if (op_prg_odb_ltrace_active (ip_frag) ip_frag_sup_print (dgram_list_ptr); Copyright 1999 MIL 3, Inc.Debugging Simulation Models (Introduction) 60Paradigm for Printing Information from Diagnostic Block 1. Find the object ID of module containing the process of interest Use objmap to obtain a list of selected objects-Example: objmap proc rip gives the list of all rip modulesLocate the desired node and note the module id of the module2. Find the object ID of the processor of interestUse promap where objid is the object ID of the module found in step 1Example: promap 1043. Run the simulation in debug mode and stop it at some time4. Print the information from the diagnostic blockExample: proldiag (0, rip_route_table)Copyright 1999 MIL 3, Inc.Debugging Simulation Models (Introduction) 61ODB Concept 7: Identification of Memory AllocationSimulation Kernel tracks memory allocation, organized by source categoriesDisplay of memory categories can identify areas of memory buildupExample: Packets received by a sink but never destroyedMemory Usage Monitor object located in Utility object palette can also be used Copyright 1999 MIL 3, Inc.Debugging Simulation Models (Introduction) 62Memory Allocation Identification Commandsmemstats: Displays a list of statistics for memory categories High-levelCan be limited to categories accounting for more thana specified amount of memoryAdvanced:memsrc: Displays list of allocation sources for a memory categorymemsnk: Displays list of deallocation sinks for a memory categoryCopyright 1999 MIL 3, Inc.Debugging Simulation Models (Introduction) 63odb memstats 10 - Object Allocation Statistics-Memory Category Bytes #Use #Free #Total Total(KB)-general - - - - 308linked list cell 12 43405 4 44000 516linked list cell long 12 249 0 1000 12linked list cell short 12 0 143 1000 12linked list desc. 24 70 436 550 13-obj attribute props 176 67 - 67 13other - - - - 72packet 136 36153 0 37001 4915packet field block (pksw_format) 24 36154 0 36201 849process descriptor 152 5 0 1001 149-.-Total (KB) 15299Interpreting memstats OutputModel: Packet switching tutorial run for 100 hours without destroying packetsCopyright 1999 MIL 3, Inc.Debugging Simulation Models (Introduction) 64Paradigm for Identifying Areas of Memory Buildupmemstats at some time Ttstop T + T for some future timememstatsCompareRepeat to identify areas of buildupCopyright 1999 MIL 3, Inc.Debugging Simulation Models (Introduction) 65Animation as a Debugging TechniqueAnimation can be used to visualize the behavior of a simulationCan help identify location on which to focus in ODBDemo: Visualizing a failure in packet routingCopyright 1999 MIL 3, Inc.Debugging Simulation Models (Introduction) 66Summary ODB allows interactive control over a simulation to investigate its behavior Set breakpoints, traces, query object information, print information from diagnostic blocksKey commands:helpevstop, tstop, mstopnext, contfulltrace, mtrace, pktracepkmap, objmappkprint, objprintCopyright 1999 MIL 3, Inc.Debugging Simulation Models (Introduction) 67Reference All ODB documentationSimx chapter of External Interfaces ManualOPNET Simulation Debugger sectionGeneral ODB ConceptsODB ConceptsODB Command ReferenceODB Command ReferenceODB TutorialODB Usage ScenariosCopyright 1999 MIL 3, Inc.Debugging Simulation Models (Introduction) 68Question & Answer
收藏 下载该资源
网站客服QQ:2055934822
金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号