LiteOS Application Note AN-103: LiteOS Event Logging. Last updated: Jan 18 2008



Similar documents
Using the CoreSight ITM for debug and testing in RTX applications

How To Port A Program To Dynamic C (C) (C-Based) (Program) (For A Non Portable Program) (Un Portable) (Permanent) (Non Portable) C-Based (Programs) (Powerpoint)

Static Analysis of Virtualization- Obfuscated Binaries

Android, Bluetooth and MIAC

Linux Driver Devices. Why, When, Which, How?

Chapter 3 Create an EasyBuilder Project... 2

RTOS Debugger for ecos

Using Internet or Windows Explorer to Upload Your Site

Monitoring, Tracing, Debugging (Under Construction)

CSC 2405: Computer Systems II

Illustration 1: Diagram of program function and data flow

Implementing SPI Master and Slave Functionality Using the Z8 Encore! F083A

The BSN Hardware and Software Platform: Enabling Easy Development of Body Sensor Network Applications

Monitor and Troubleshoot AnyConnect

Virtuozzo Virtualization SDK

SMTP-32 Library. Simple Mail Transfer Protocol Dynamic Link Library for Microsoft Windows. Version 5.2

System Log Setup (RTA1025W Rev2)

Debugging Multi-threaded Applications in Windows

Leak Check Version 2.1 for Linux TM

E-Blocks Easy RFID Bundle

#pragma omp critical x = x + 1; !$OMP CRITICAL X = X + 1!$OMP END CRITICAL. (Very inefficiant) example using critical instead of reduction:

Event Center (rev b) EVENT CENTER. VPI 160 Camino Ruiz, Camarillo, CA (Voice) (Fax)

An Introduction To Simple Scheduling (Primarily targeted at Arduino Platform)

The LiteOS Operating System: Towards Unix-like Abstractions for Wireless Sensor Networks

SUDT AccessPort TM Advanced Terminal / Monitor / Debugger Version 1.37 User Manual

Logging. Working with the POCO logging framework.

Using Microsoft Expression Web to Upload Your Site

Wind River Device Management Wind River

To install Multifront you need to have familiarity with Internet Information Services (IIS), Microsoft.NET Framework and SQL Server 2008.

Compute Cluster Server Lab 3: Debugging the parallel MPI programs in Microsoft Visual Studio 2005

Last Class: OS and Computer Architecture. Last Class: OS and Computer Architecture

Practice #3: Receive, Process and Transmit

Laboratory Report. An Appendix to SELinux & grsecurity: A Side-by-Side Comparison of Mandatory Access Control & Access Control List Implementations

Fast Arithmetic Coding (FastAC) Implementations

EMC RepliStor for Microsoft Windows ERROR MESSAGE AND CODE GUIDE P/N REV A02

Application Note: AN00141 xcore-xa - Application Development

Technical Note. Micron NAND Flash Controller via Xilinx Spartan -3 FPGA. Overview. TN-29-06: NAND Flash Controller on Spartan-3 Overview

What is LOG Storm and what is it useful for?

Operating Systems and Networks

COS 318: Operating Systems

An Integrated End-to-End Data Integrity Solution to Protect Against Silent Data Corruption

Operating Systems. Privileged Instructions

Monitoring of Tritium release at PTC.

HelenOS IPC and Behavior Protocols

RTI Monitoring Library Getting Started Guide

Yun Shield User Manual VERSION: 1.0. Yun Shield User Manual 1 / 22.

Server Manager Performance Monitor. Server Manager Diagnostics Page. . Information. . Audit Success. . Audit Failure

GPU Tools Sandra Wienke

the high-performance embedded kernel User Guide Version 5.0 Express Logic, Inc Toll Free 888.THREADX FAX

Debugging with TotalView

UM0853 User manual. 1 Introduction. M24LRxx application software user guide

Problems and Measures Regarding Waste 1 Management and 3R Era of public health improvement Situation subsequent to the Meiji Restoration

Project No. 2: Process Scheduling in Linux Submission due: April 28, 2014, 11:59pm

Lab 2-2: Exploring Threads

Optimize with Shark: Big Payoff, Small Effort

Troubleshooting Procedures for Cisco TelePresence Video Communication Server

Using Protothreads for Sensor Node Programming

LabVIEW DSP Test Integration Toolkit for TI DSP

Peach Fuzzer Platform

Binary Upgrade Procedure

10 STEPS TO YOUR FIRST QNX PROGRAM. QUICKSTART GUIDE Second Edition

Copyright 2013 wolfssl Inc. All rights reserved. 2

CB-OLP425 DEVELOPMENT KIT GETTING STARTED

Troubleshooting the Firewall Services Module

Learn CUDA in an Afternoon: Hands-on Practical Exercises

Instructions on how to use the HTTP- Trace extension for Chrome:

Monitoring Replication

Frequently Asked Questions

Cosmic Board for phycore AM335x System on Module and Carrier Board. Application Development User Manual

CANnes PC CAN Interface Manual

Mobile Application Development Android

Personal Cloud. Support Guide for Mac Computers. Storing and sharing your content 2

MINIMUM TOOL REQUIREMENT FOR EPROM UPGRADE

Application Security: Web service and

First Java Programs. V. Paúl Pauca. CSC 111D Fall, Department of Computer Science Wake Forest University. Introduction to Computer Science

A Comparison Of Shared Memory Parallel Programming Models. Jace A Mogill David Haglin

Bluetooth for device discovery. Networking Guide

Also on the Performance tab, you will find a button labeled Resource Monitor. You can invoke Resource Monitor for additional analysis of the system.

GIVE WINGS TO YOUR IDEAS TUTORIAL

How to Run the MQX RTOS on Various RAM Memories for i.mx 6SoloX

MatrixSSL Porting Guide

Computer Systems II. Unix system calls. fork( ) wait( ) exit( ) How To Create New Processes? Creating and Executing Processes

Easy CramBible Lab DEMO ONLY VERSION Partner Certification for IAM:Foundation Exam 41

Programming NDS with NetWare Loadable Modules (NLMs), Part 2

MarkLogic Server. Connector for SharePoint Administrator s Guide. MarkLogic 8 February, 2015

Table of Contents. ARM Evaluation Board (AEB-1) Welcome Guide ARM DGI 0005D. Proprietary Notice

Android device with Bluetooth enabled and paired with another Bluetooth device.

SAS Decision Services Engine XXXXXX Loggers Logger(file:///myMachine/Lev1/Web/Common/LogConfig/SASDecisionService Level sengine-log4j.

Installing Java (Windows) and Writing your First Program

CIA405.lib. Contents. WAGO-I/O-PRO 32 Library

Get the Better of Memory Leaks with Valgrind Whitepaper

Dustminer: Troubleshooting Interactive Complexity Bugs in Sensor Networks

Wimba Create. Version 2.6. Installation Guide

Priority Based Implementation in Pintos

Chapter 11 Managing Core Database Downloads

SIM900_Custom Application Building Tutorial_Application Note_V1.00

Interpreters and virtual machines. Interpreters. Interpreters. Why interpreters? Tree-based interpreters. Text-based interpreters

Point-Of-Sale Business Application. System Architecture

MetroPro Remote Access OMP-0476F. Zygo Corporation Laurel Brook Road P.O. Box 448 Middlefield, Connecticut 06455

Introduction to Compiler Consultant

Transcription:

LiteOS Application Note AN-103: LiteOS Event Logging Last updated: Jan 18 2008 This application note documents how to use the logging provided by LiteOS to record internal event traces for debugging, profiling, and application behavior analysis. Download location: www.liteos.net Copyright 2008 LiteOS developers, all rights reserved.

Purpose This application note documents how to use the event logger that is built into LiteOS kernel to record traces of user applications and kernel behavior. The event logger is useful for post-experiment analysis, debugging, and profiling of user applications, in that it faithfully records all traces that the user is interested in. Using the event logger requires modifying the eventlogger.h file in the kernel and recompiles it. In this document, we explain the general rules we follow when we organize the evnetlogger.h file and its macro definitions. Macro Definition Levels Open the eventlogger.h file, you will observe the following macro definitions: #define TRACE_ENABLE #define TRACE_ENABLE_SYSCALLEVENT These two macro definitions are the key control knobs for the event logging. If they are commented out, then the event logging functions will not be compiled into the kernel, because they are controlled using #ifdef macro in the kernel source code. On the other hand, if these definitions are effective, then the event logging code will be generated in the kernel image. While the previous two macro definitions serve as the toplevel macro, there are also many low-level control knobs also in the form of macro definitions. For example, the following definition: #define TRACE_ENABLE_CONTEXTSWITCH determines whether the context switch event will be logged or not by the kernel. 2

If such control knobs are enabled, each event is recorded as one byte in the event recording buffer, a chunk of memory whose size can be dynamically adjusted. If this buffer is full of events, it can be written into a file located in the root directory. The function: void addtrace(uint8_t traceid) is the key function that allows recording different types of events. This function is defined in the eventlogger.c file. Another important category of logging is the system calls. In the eventlogger.h file, these macro definitions are organized as follows: #define TRACE_ENABLE_SYSCALL_YIELDFUNCTION #define TRACE_SYSCALL_YIELDFUNCTION 101 Notice that such definitions are organized in pairs. If the yield system call is logged, then the value 101 will be added into the eventlogger buffer. The trace could be retrieved at the end of experiments for post-experiment analysis. Example to use the event logger We use a very simple example, the Hello, world example to demonstrate the traces recorded by the event logger, and how such traces could provide very valuable insight on the behavior of the applications. The example we use is as follows. Note that, although we only use a very simple example here, the event logger is more useful for larger experiments where the behavior of the application could be highly complicated and even faulty. By examining the event traces, a user could locate potential sources of bugs and unexpected behavior. Further use in this direction will be documented in the future application notes. 3

int main() { int index; for (index = 0; index < 10; index++) { radiosend_string("hello, world!\n"); greentoggle(); sleepthread(100); } return 0; } By running this application and runs the event logger with only application specific events turned on (system calls and user application behavior), a user could easily get a trace file that is located under the root directory named logtrace. By copying this file back to PC, this file has a content like the following (Note the real experiment trace might differ slightly depending on which trace switches are turned on): 17 18 All such numbers correspond to individual events in the kernel, and simple analysis illustrates that the above trace 4

could be interpreted as follows: //user thread starts Create thread system call (The following loop ten times) //Radio_send function Get radio mutex system call Get current thread address system call Get current radio data structure system call //Mutex_lock function called in Radio_send Get current thread address system call Get current thread index system call //Radio_send function Radio send operation system call //SleepThread function called in Radio_send Get current thread system call Yield system call //Radio_send function Reset radio state system call //Mutex_unlock function Mutex unlock system call //Green_toggle function Green toggle system call //SleepThread function Get current thread address system call Yield system call (The above loop ten times) Destroy thread system call 5

As shown in this example, the event logger faithfully records the details of the logging procedure. Conclusions In this application note, we have briefly outlined the steps to use the event logger to reconstruct the program behavior in LiteOS applications. 6