Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Meta Engineering 7 min read Case study hardMaster

Reverse debugging at scale

Meta continuously records Intel Processor Trace (Intel PT) data for all running processes in production, keeping it in a bounded circular buffer. An eBPF kernel probe notifies the collector within milliseconds of a crash, so the crashed process's trace is saved before other processes overwrite it. Traces and binaries are stored for offline analysis, where an LLDB plugin decodes taken and not-taken branches against the binary, symbolicates the executed instructions, and builds a function call tree that makes reverse-step-over and reverse breakpoints cheap. The same timestamped traces also support latency analysis that sampled call stacks miss, with visualization planned for Meta's Tracery tool and VSCode.

Assumes: debugger conceptsCPU instruction tracingeBPF basics

Related posts

  • Magic-trace: Diagnosing tricky performance issues easily with Intel Processor Trace

    Jane Street Tech Blog hardMaster

    Magic-trace is an open-source tool that uses Intel Processor Trace in circular-buffer mode to capture roughly the last 10ms of execution before a chosen function call, then renders every function call on a nanosecond-resolution timeline in a forked Perfetto UI. Processor Trace records full control flow with about 30ns timing at 2-20% overhead and needs no instrumentation, which suits latency problems far shorter than a sampling profiler's 250µs interval. The build went from wrapping `perf` to using perf_event_open with libipt directly, and hardware breakpoints let it trigger snapshots on any function without the target's cooperation. Along the way it hit a kernel null-pointer bug and a suspected Skylake erratum, and it has already diagnosed 100ns inlining regressions and long Async cycles.

  • Strobelight: A profiling service built on open source technology

    Meta Engineering mediumAdept

    Strobelight is Meta's fleet-wide profiling orchestrator, running 42 profilers (mostly eBPF-based, plus ad-hoc bpftrace scripts) on every production host with safeguards against PMU counter conflicts, concurrency limits and queuing. Default continuous profiling uses dynamic sampling that retunes run probability daily per service to hit target sample counts, with sample weights normalizing data for cross-host and cross-service comparison. LBR data feeds Meta's FDO pipeline (CSSPGO and BOLT), cutting CPU cycles up to 20% for top services, and one efficiency win alone saved an estimated 15,000 servers annually. Stack Schemas and thread-local Strobemeta enrich stacks with tags and request metadata, while a centralized symbolization service built on DWARF, gsym and blazesym avoids on-host debug-info parsing, relying on frame pointers in all user-space binaries.

  • Improving Firefox stability on Linux

    Mozilla Hacks mediumAdept

    Mozilla went from being able to symbolicate under 20% of Linux Firefox crash reports to over 99% by scraping debug information for distro-packaged Firefox builds and their dependencies (GTK, Mesa, fontconfig, SQLite, etc.) from Arch, Debian, Fedora, OpenSUSE and Ubuntu repositories. The scripts convert that debug info into Breakpad symbol files, which the Socorro crash processor uses to turn minidumps into readable stack traces. With those traces the team caught distro-specific regressions such as a Debian fontconfig backport bug within days and sent fixes upstream to Mesa, GTK and glib. The crash analysis tooling was also rewritten in Rust on top of Sentry's crates, making it much faster and lighter on memory.

  • The case of the vanishing CPU: A Linux kernel debugging story

    ClickHouse hardMaster

    Intermittent, indefinite CPU saturation of ClickHouse Cloud pods, seen only on GCP, turned out to be a Linux kernel memory-management livelock. Pods sat just under their cgroup memory limit while every CPU spun in shrink_lruvec during memcg reclaim triggered by page-cache readahead on page faults. The investigation used gdb backtraces, bpftrace syscall latency histograms, perf top/stat, pidstat and an on-call runbook to reach a reproducible test case and a kernel fix, after which another kernel bug surfaced. One lesson along the way: signal-based user-space stack traces hide kernel time entirely, so gdb backtraces pointed the team at the wrong code.

  • Trace similarity systems on top of ClickHouse to analyze crash stack traces from our CI

    ClickHouse mediumAdept

    ClickHouse built a crash-deduplication pipeline for its CI that groups similar stack traces from fuzzing, stress and functional tests using the TraceSim similarity method, implemented almost entirely in ClickHouse SQL. Crash logs are pulled from a CI logs cluster into a separate analysis cluster every 30 minutes via a refreshable materialized view. SQL UDFs strip addresses, file/line info, ABI tags and LLVM suffixes from frames on the fly so cleaning logic can change without reprocessing. Identical cleaned traces are hashed and matched against known GitHub issues, insignificant traces are filtered by PR count and master presence, and the rest are compared with weighted arraySimilarity to open or update issues.

The quest for software engineering knowledge.

Look:
Layout: