BSDCan2016 - v1.1.24a

BSDCan 2016
The Technical BSD Conference

George Neville-Neil
Day Tutorials #1 - 8 June - 2016-06-08
Room DMS 1110
Start time 09:00
Duration 03:00
ID 653
Track Tutorial
Language used for presentation English

A Look Inside FreeBSD with DTrace


One of the largest challenges to understanding complex software is a lack of run time visibility into what the system is doing at any particular time. DTrace is a modern tool that gives the user, whether they are a student, system admin, or software developer the ability to look insidea running system to understand how the system works and identify logical and performanc problems.

In this tutorial we will cover the basics of DTrace on FreeBSD, including basic and advanced uses, and then work through several of the major subsystems, including processes, memory, I/O and networking to achieve a better overall understanding of how the system operates. The tutorial includes a set of short labs, carried out on virtual machines, that give the students hands on experience working with DTrace.

The two day tutorial covers the use of DTrace and its application to understanding, debugging and measuring various aspects of the operating system. Student goals for the tutorial are

  • Use the dtrace program.
  • Write simple, one line, DTrace scripts
  • Know the terms in the DTrace glossary (provider, probe, etc.)
  • Extend scripts in the DTraceToolkit
  • Work with the profile, proc, sched, and networking providers

Each section contains a set of lab exercises. Each lab is intended to last 30 minutes, with 20 minutes of work time and 10 minutes of followup discussion.

Course Outline

Introduction Goals, tracing over view, and history

DTrace Command, Glossary, One Liners

Processes Process Model, Process Lifecycle, fork, exec, exit, signals Scheduler Process States, Sched Provider, Running Threads Locking Lock Types, Lock Provider, Lock Stat Collection Networking Sockets, UDP TCP, TCP States Packet Forwarding Filesystem Naming Name Cache VNODEs VFS