Ns-3 Training Debugging support ns-3 training, June 2016.

Slides:



Advertisements
Similar presentations
11-Jun-14 The assert statement. 2 About the assert statement The purpose of the assert statement is to give you a way to catch program errors early The.
Advertisements

Introduction to NS-3 Part - 2 Katsaros Konstantinos PhD Student PGSDP Workshop on NS-3 2 April 2012.
1 THE ARCHITECTURE FOR THE DIGITAL WORLD TM THE ARCHITECTURE FOR THE DIGITAL WORLD Embedded Linux for ARM Architecture.
Microsoft ® Official Course Monitoring and Troubleshooting Custom SharePoint Solutions SharePoint Practice Microsoft SharePoint 2013.
Unit Testing & Defensive Programming. F-22 Raptor Fighter.
Introduction to the Enterprise Library. Sounds familiar? Writing a component to encapsulate data access Building a component that allows you to log errors.
© 2008 Intel Corporation; made available under the EPL v1.0 | February 12, 2008 | Integrating a custom tool-chain in CDT.
© 2008, Renesas Technology America, Inc., All Rights Reserved 1 Purpose  This training course describes how to configure the the C/C++ compiler options.
© 2008, Renesas Technology America, Inc., All Rights Reserved 1 Purpose  This training module provides an overview of optimization techniques used in.
Ns-3 Training Computer and Communication Network Lab Department of Electrical Engineering National Sun Yat-Sen University 5/13/2013.
Programming Tools gcc make utility Open Source code Static and Shared Libraries gdb Memory debugging tools.
Developing C/C++ applications with the Eclipse CDT David Gallardo.
1 Conditions Logical Expressions Selection Control Structures Chapter 5.
Ns-3 tutorial Katto lab Tadashi Yamazaki 8 November 2012.
Introduction Purpose This training course covers debugging an application on an SH target in the Renesas HEW (High-performance Embedded Workshop) development.
Active-HDL Interfaces Debugging C Code Course 10.
6. Testing and Verification
Editing & Compiling: UNIX vs. IDE and an Intro to Architecture.
Eclipse 24-Apr-17.
1 SEEM3460 Tutorial Compiling and Debugging C programs.
Test Specifications A Specification System for Multi-Platform Test Suite Configuration, Build, and Execution Greg Cooksey.
CSE 374 Programming Concepts & Tools Hal Perkins Fall 2015 Lecture 11 – gdb and Debugging.
 Programming - the process of creating computer programs.
Debugging 1/6/2016. Debugging 1/6/2016 Debugging  Debugging is a methodical process of finding and reducing the number of bugs, or defects, in a program.
Technical Validation The Technical Validation is a testing framework of the AUGER offline to monitor the code development process. It is not a validation.
Lab 9 Department of Computer Science and Information Engineering National Taiwan University Lab9 - Debugging I 2014/11/4/ 28 1.
© 2002 IBM Corporation Confidential | Date | Other Information, if necessary Copyright © 2009 Ericsson, Made available under the Eclipse Public License.
CMSC 104, Version 8/061L14AssignmentOps.ppt Assignment Operators Topics Increment and Decrement Operators Assignment Operators Debugging Tips Reading Section.
Defensive Programming. Good programming practices that protect you from your own programming mistakes, as well as those of others – Assertions – Parameter.
Pre-Compiler Directives for TTCN-3 Ina Schieferdecker in response to CR5089 and 5090.
The World Leader in High Performance Signal Processing Solutions How to Fix Bugs with Toolchain Jie Zhang.
Debugging using By: Samuel Ashby. What is debugging?  A bug is an error in either a program or the hardware itself.  Debugging is first locating and.
© 2008, Renesas Technology America, Inc., All Rights Reserved 1 Introduction Purpose  This training course demonstrates the use of the High-performance.
C Debugging Workshop using gdb Jürgen Weigert Documentation & Legal Team openSUSE.org
Institute of Radio Physics and Electronics ILug-Cal Introduction to GDB Institute of Radio Physics and Electronics and Indian GNU/Linux Users Group Kolkata.
Chapter Goals Describe the application development process and the role of methodologies, models, and tools Compare and contrast programming language generations.
DEBUG.
ns-3 Training 5/08/2017 Computer and Communication Network Lab
Build and Test system for FairRoot
Visual Basic.NET Windows Programming
Muen Policy & Toolchain
Testing Tutorial 7.
Dept of Computer Science University of Maryland College Park
CSE 374 Programming Concepts & Tools
PVS-Studio static analyzer: advanced features
Debugging with gdb gdb is the GNU debugger on our CS machines.
LESSON 20.
CE-105 Spring 2007 Engr. Faisal ur Rehman
Ns-3 Training Session 2: Monday May 11 ns-3 Annual meeting May 2015.
SharePoint Framework Extensions
Session 1. ns-3 기초 신연철 Multimedia & Wireless Networking Laboratory, SNU
CodePeer Update Arnaud Charlet CodePeer Update Arnaud Charlet
Using Visual Studio and VS Code for Embedded C/C++ Development
CodePeer Update Arnaud Charlet CodePeer Update Arnaud Charlet
Tivoli Common Reporting v1.2 Overview
ns-3 Waf build system ns-3 Annual Meeting June 2017
Ns-3 Training Session 4: Monday 3:30pm ns-3 Annual Meeting May 2014.
Testing, debugging, and using support libraries
Chapter 7 –Implementation Issues
Our Environment We will exercise on Microsoft Visual C++ v.6
Ns-3 Tutorial Xin Li.
CSE 1020:Software Development
ns-3 training Tom Henderson ns-3 annual meeting 2019
Makefiles, GDB, Valgrind
Ns-3 Training ns-3 Objects ns-3 training, June 2016.
3.8 static vs dynamic thread management
Dynamic Binary Translators and Instrumenters
Hello World Program In Visual Studio and Debugging
Defensive Programming
Presentation transcript:

ns-3 Training Debugging support ns-3 training, June 2016

Writing and debugging new programs Choosing between Python and C++ Reading existing code Understanding and controlling logging code Error conditions Running programs through a debugger ns-3 training, June 2016

Python bindings ns-3 uses the 'pybindgen' tool to generate Python bindings for the underlying C++ libraries Existing bindings are typically found in the bindings/ directory of a module Some methods are not provided in Python (e.g. hooking trace sources) Generating new bindings requires a toolchain documented on the ns-3 web site ns-3 training, June 2016

Debugging support Assertions: NS_ASSERT (expression); Aborts the program if expression evaluates to false Includes source file name and line number Unconditional Breakpoints: NS_BREAKPOINT (); Forces an unconditional breakpoint, compiled in Debug Logging (not to be confused with tracing!) Purpose Used to trace code execution logic For debugging, not to extract results! Properties NS_LOG* macros work with C++ IO streams E.g.: NS_LOG_UNCOND (”I have received ” << p->GetSize () << ” bytes”); NS_LOG macros evaluate to nothing in optimized builds When debugging is done, logging does not get in the way of execution performance ns-3 training, June 2016

Debugging support (cont.) Logging levels: NS_LOG_ERROR (...): serious error messages only NS_LOG_WARN (...): warning messages NS_LOG_DEBUG (...): rare ad-hoc debug messages NS_LOG_INFO (...): informational messages (eg. banners) NS_LOG_FUNCTION (...):function tracing NS_LOG_PARAM (...): parameters to functions NS_LOG_LOGIC (...): control flow tracing within functions Logging ”components” Logging messages organized by components Usually one component is one .cc source file NS_LOG_COMPONENT_DEFINE ("OlsrAgent"); Displaying log messages. Two ways: Programatically: LogComponentEnable("OlsrAgent", LOG_LEVEL_ALL); From the environment: NS_LOG="OlsrAgent" ./my-program ns-3 training, June 2016

Running C++ programs through gdb The gdb debugger can be used directly on binaries in the build directory An easier way is to use a waf shortcut ./waf --command-template="gdb %s" --run <program- name> ns-3 training, June 2016

Running C++ programs through valgrind valgrind memcheck can be used directly on binaries in the build directory An easier way is to use a waf shortcut ./waf --command-template="valgrind %s" --run <program-name> Note: disable GTK at configure time when running valgrind (to suppress spurious reports) ./waf configure --disable-gtk --enable-tests ... ns-3 training, June 2016

Testing ns-3 models need tests verifiable by others (often overlooked) Onus is on the simulation project to validate and document results Onus is also on the researcher to verify results ns-3 strategies: regression tests Aim for event-based rather than trace-based unit tests for verification validation of models on testbeds where possible reuse of code ns-3 training, June 2016

Test framework ns-3-dev is checked nightly on multiple platforms Linux gcc-4.x, i386 and x86_64, OS X, FreeBSD clang, and Cygwin (occasionally) ./test.py will run regression tests Walk through test code, test terminology (suite, case), and examples of how tests are run ns-3 training, June 2016

Improving performance Debug vs optimized builds ./waf -d debug configure ./waf -d debug optimized Build ns-3 with static libraries ./waf --enable-static Use different compilers (icc) has been done in past, not regularly tested ns-3 training, June 2016