Labs
Reproduce behavior with small C and C++ programs, observe it with tools, and compare results.
Each lab lists its tools and permissions, commands, and expected observations. How are experiments verified?
A first GDB investigation — from C to machine code ↗
Pause a small C program, watch a number change in memory, then change one argument yourself.
LAB 02 C / LinuxBranches and pointers under optimization ↗
Compare two builds of the same condition and catch the moment a pointer target changes.
LAB 03 C / LinuxObserving a memory permission change ↗
Watch a memory page change from writable to executable, then explain what that observation proves.
LAB 04 C / LinuxSymbol selection and function interposition with LD_PRELOAD ↗
Make the same program print 11 or 22 by choosing which library supplies a function.
LAB 05 C / LinuxSeparating, stripping, and reconnecting debug information ↗
Move debugging information to a separate file and help GDB find the source again.
LAB 06 C / LinuxExamining compiler differences and optimization levels ↗
Compile one calculation three ways: keep the answer and compare the instructions.
LAB 07 C / LinuxCPU profiling and flame graphs with perf ↗
Profile a C program with perf stat, perf record, and a flame graph; confirm the hotspot and prove the fix.
LAB 08 C / LinuxFirst steps with bpftrace ↗
Trace a deterministic C program and check every bpftrace count, histogram, and stack against the source.
LAB 09 C / LinuxDiagnosing a slow program that barely uses the CPU ↗
Find a lock held across a slow step when the CPU is idle: syscalls, uprobes, a timeline, and GDB.
LAB 10 C++ / LinuxMeasuring call intervals, elapsed time, and thread CPU time ↗
Read the C++ measurement points and calculate elapsed, CPU, and entry-to-entry time from raw CSV rows.
LAB 11 C++ / LinuxCorrelating six event boundaries across direct and queued calls ↗
Inspect direct calls and queue handoffs, then calculate each stage from six matching event markers.
LAB 12 Bash / LinuxSampling thread counters without scheduler tracing ↗
Read procfs files directly, check task identity, and subtract thread counters yourself in Bash.
LAB 13 C++ / LinuxMeasuring function entries and returns with probes ↗
Write an entry counter and entry/return probes, then explain clocks, pairing, and histogram counts.
LAB 14 Bash / LinuxReading a scheduler timeline one transition at a time ↗
Inspect scheduler tracepoints, pair raw task transitions, and calculate blocked and runnable time.