Kernel Tracing David Ferry, Chris Gill CSE 522S - Advanced Operating Systems Washington University in St. Louis St. Louis, MO 63143 1.

Slides:



Advertisements
Similar presentations
COS Operating System Assignment 4 (Precept 2) Inter-Process Communication and Process management Fall 2004.
Advertisements

Debugging code with limited system resource. Minheng Tan Oct
Tools for Investigating Graphics System Performance
Advanced OS Chapter 3p2 Sections 3.4 / 3.5. Interrupts These enable software to respond to signals from hardware. The set of instructions to be executed.
Kernel module programming and debugging Advanced Operating Systems.
Process Description and Control A process is sometimes called a task, it is a program in execution.
Cortex-M3 Debugging System
Debugging techniques in Linux Debugging Techniques in Linux Chetan Kumar S Wipro Technologies.
Operating System Program 5 I/O System DMA Device Driver.
© Imagination TechnologiesInternal Only – Not to be released externally p1 David Lau June 2015 Debugging & MIPS VZ.
Slides created by: Professor Ian G. Harris Test and Debugging  Controllability and observability are required Controllability Ability to control sources.
Self stabilizing Linux Kernel Mechanism Doron Mishali, Alex Plits Supervisors: Prof. Shlomi Dolev Dr. Reuven Yagel.
ITEC 502 컴퓨터 시스템 및 실습 Chapter 8-1: I/O Management Mi-Jung Choi DPNM Lab. Dept. of CSE, POSTECH.
COS 598: Advanced Operating System. Operating System Review What are the two purposes of an OS? What are the two modes of execution? Why do we have two.
Assignment 2 SARAH DIESBURG CO5641. Assignment 2 Other tools exist to ease kernel development and debugging Pick a tool not already explained, set it.
Lecture 3 Process Concepts. What is a Process? A process is the dynamic execution context of an executing program. Several processes may run concurrently,
1 Announcements The fixing the bug part of Lab 4’s assignment 2 is now considered extra credit. Comments for the code should be on the parts you wrote.
Module 6: Debugging a Windows CE Image.  Overview Debug Zones IDE Debug Setup IDE Debug Commands Platform Builder Integrated Kernel Debugger Other Debugging.
A Tutorial on Introduction to gdb By Sasanka Madiraju Graduate Assistant Center for Computation and Technology.
CSE 332: C++ debugging Why Debug a Program? When your program crashes –Finding out where it crashed –Examining program memory at that point When a bug.
Debugging parallel programs. Breakpoint debugging Probably the most widely familiar method of debugging programs is breakpoint debugging. In this method,
CSE 351 GDB Introduction. Lab 1 Status? How is Lab 1 going? I’ll be available at the end of class to answer questions There are office hours later today.
CSE 451: Operating Systems Section 3: Project 0 recap, Project 1.
CSE 374 Programming Concepts & Tools Hal Perkins Fall 2015 Lecture 11 – gdb and Debugging.
4300 Lines Added 1800 Lines Removed 1500 Lines Modified PER DAY DURING SUSE Lab.
Operating Systems CSE 411 CPU Management Sept Lecture 10 Instructor: Bhuvan Urgaonkar.
Unit - V. Debugging GNU Debugger helps you in getting information about the following: 1.If a core dump happened, then what statement or expression did.
Course Introduction David Ferry, Chris Gill Department of Computer Science and Engineering Washington University, St. Louis MO 1E81.
How & When The Kernel Runs David Ferry, Chris Gill Department of Computer Science and Engineering Washington University, St. Louis MO
Time Sources and Timing David Ferry, Chris Gill CSE 522S - Advanced Operating Systems Washington University in St. Louis St. Louis, MO
© 2002 IBM Corporation Confidential | Date | Other Information, if necessary Copyright © 2009 Ericsson, Made available under the Eclipse Public License.
CSE 332: C++ expressions Expressions: Operators and Operands Operators obey arity, associativity, and precedence int result = 2 * 3 + 5; // assigns 11.
1 Advanced.Net Debugging Using Visual Studio, R# and OzCode IT Week, Summer 2015.
Linux Boot Process on the Raspberry Pi 2 1 David Ferry, Chris Gill CSE 522S - Advanced Operating Systems Washington University in St. Louis St. Louis,
Scheduling Classes and Real-Time Scheduling in Linux David Ferry, Chris Gill CSE 522S - Advanced Operating Systems Washington University in St. Louis St.
Interrupts and Interrupt Handling David Ferry, Chris Gill CSE 522S - Advanced Operating Systems Washington University in St. Louis St. Louis, MO
HP-SEE Debugging with GDB Vladimir Slavnic Research Assistant SCL, Institute of Physics Belgrade The HP-SEE initiative.
Processes David Ferry, Chris Gill CSE 522S - Advanced Operating Systems Washington University in St. Louis St. Louis, MO
© 2013 MontaVista Software, LLC. MontaVista Confidential and Proprietary. CGE7 DevRocket7 Feature Demo Divya Vyas.
Program Execution in Linux David Ferry, Chris Gill CSE 522S - Advanced Operating Systems Washington University in St. Louis St. Louis, MO
Kernel Synchronization David Ferry, Chris Gill CSE 522S - Advanced Operating Systems Washington University in St. Louis St. Louis, MO
How & When The Kernel Runs
Midterm Review Chris Gill CSE 422S - Operating Systems Organization
Dynamic Analysis ddaa.
Time Sources and Timing
Anton Burtsev February, 2017
Midterm Review David Ferry, Chris Gill
Chapter 2: System Structures
Department of Computer Science and Engineering
Kernel Tracing David Ferry, Chris Gill
Processes David Ferry, Chris Gill
Program Execution in Linux
Time Sources and Timing
Semester Review Chris Gill CSE 422S - Operating Systems Organization
Interrupts and Interrupt Handling
System Calls David Ferry CSCI 3500 – Operating Systems
Top Half / Bottom Half Processing
Kernel Synchronization I
Overview of the Lab 2 Assignment: Multicore Real-Time Tasks
Midterm Review Brian Kocoloski
How & When The Kernel Runs
Time Sources and Timing
Processes David Ferry CSCI 3500 – Operating Systems
Program Execution in Linux
Kernel Tracing David Ferry, Chris Gill, Brian Kocoloski
Scheduling Classes and Real-Time Scheduling in Linux
Interrupts and Interrupt Handling
Processes David Ferry, Chris Gill, Brian Kocoloski
Lecture 12 Input/Output (programmer view)
Shared Memory David Ferry, Chris Gill
Presentation transcript:

Kernel Tracing David Ferry, Chris Gill CSE 522S - Advanced Operating Systems Washington University in St. Louis St. Louis, MO

Class Notes Piazza page: – Search for CSE 522 under classes – Will become a class FAQ for subsequent semesters Extra readings on class page: – Not always intended to be read in full – Won’t have specific test questions from these CSE 522S – Advanced Operating Systems2

Debugging Linux Debuggers exist: – gdb – kgdb But have serious limitations: – Full debugging requires specialized, two machine setup – Limited ability to do execution stepping – Can still do breakpoints – Can still inspect memory contents – Can still inspect call stack Instead, tracing is used. CSE 522S – Advanced Operating Systems3

Simplest Tracer: printk() printk() prints information to the system log – Messages stored in circular buffer – Can be read with dmesg – Eight possible log levels (set with dmesg –n ) Example: printk(KERN_ALERT “bad thing %ld”, bad_thing); – Uses same format as printf() – Note there is no comma after log level CSE 522S – Advanced Operating Systems4

Kernel Oopses and Panics A kernel panic is unrecoverable and results in an instant halt An oops communicates something bad happened but the kernel tries to continue executing – An oops means the kernel is not totally broken, but is probably in an inconsistent state – An oops in interrupt context, the idle task (pid 0), or the init task (pid 1) results in a panic CSE 522S – Advanced Operating Systems5 "Kernel-panic" by Kevin

Ftrace – the Function Tracer Not just functions! Many features: – Event tracepoints (scheduler, interrupts, etc.) – Trace any kernel function – Call graphs – Kernel stack size – Latency tracing How long interrupts disabled How long preemption disabled Has a user interface called trace-cmd Very nice graphical trace browser called Kernelshark CSE 522S – Advanced Operating Systems6

Ftrace Internals When tracing is enabled, the kernel maintains: – Per-CPU ring buffer for holding events – Per-CPU kernel thread that empties ring buffer If readers can’t keep up, data is lost Tracepoints in kernel: – Kernel maintains list of tracepoint locations – Locations normally converted to no-ops ( ftrace_make_nop() ) – Trace code is runtime-patched into kernel code when activated ( ftrace_make_call() ) CSE 522S – Advanced Operating Systems7

Userspace Tracing: Strace Allows one userspace process (tracer) to inspect the system calls made by another thread (tracee). 1.Tracer calls ptrace() on tracee 2.Tracee halts at every system call, system call return, and signal (except SIGKILL ) 3.Tracer records info, and releases tracee to continue Note: Tracing is per-thread Seriously warps program timings CSE 522S – Advanced Operating Systems8