---
name: "tracing"
section: "7"
platform: "freebsd"
package: "base"
version: "16.0-CURRENT-20261027-61c70dc16a79"
release: "FreeBSD 16.0-CURRENT (2026-10-27)"
platforms: ["freebsd"]
url: "https://new.carta.tech/tracing"
---

# tracing(7)

introduction to FreeBSD tracing and performance monitoring

## NAME

**tracing** – introduction to FreeBSD tracing and performance monitoring

## DESCRIPTION

FreeBSD features a large variety of tracing and performance monitoring facilities. Use them to measure performance and troubleshoot kernel and userland problems both during [development(7)](/development/7.md) and potentially on production systems. The facilities differ in scope, ease of use, overhead, design, and limitations.

### DTrace

[dtrace(1)](/dtrace/1.md) is the most versatile tracing framework available on FreeBSD and is capable of tracing throughout the FreeBSD software stack from the kernel to the applications running in userland. Refer to [dtrace(1)](/dtrace/1.md) and [SDT(9)](/SDT/9.md) for more details.

[dwatch(1)](/dwatch/1.md) is a user-friendly wrapper for DTrace. It simplifies common DTrace usage patterns and requires less expert knowledge to operate.

### Userland Tracing

[truss(1)](/truss/1.md) traces system calls. It uses [sysdecode(3)](/sysdecode/3.md) to pretty-print system call arguments and [ptrace(2)](/ptrace/2.md) to trace processes.

[ktrace(1)](/ktrace/1.md) is useful for debugging user programs. It enables kernel trace logging for specified processes. Like [truss(1)](/truss/1.md), it mainly traces system calls, but instead of using [ptrace(2)](/ptrace/2.md), it asynchronously logs entries to a trace file configured with [ktrace(2)](/ktrace/2.md) (typically *ktrace.out*), and it can log other types of kernel events, such as page faults and name lookups (refer to **-t** in [ktrace(1)](/ktrace/1.md)). Also, programs can log to a [ktrace(1)](/ktrace/1.md) stream using the [utrace(2)](/utrace/2.md) system call.

### Kernel Tracing

[ktr(4)](/ktr/4.md) is a facility for logging strings in the kernel. It comes in handy for some niche purposes during kernel development. It lets kernel programmers log events to a global ring buffer, which can later be dumped using [ktrdump(8)](/ktrdump/8.md).

### Hardware-Accelerated Tracing

[hwt(4)](/hwt/4.md) is a kernel trace framework providing infrastructure for hardware-assisted tracing.

### Hardware Counters

[pmcstat(8)](/pmcstat/8.md), and its kernel counterpart, [hwpmc(4)](/hwpmc/4.md), is the FreeBSD facility for conducting performance measurements with hardware counters.

### Boot-Time And Shutdown Tracing

[boottrace(4)](/boottrace/4.md) is a facility for tracing events at boot and shutdown. Its target audience are system administrators.

[tslog(4)](/tslog/4.md) is a developer-oriented tool for tracing boot-time events.

## HISTORY

The **tracing** manual page was written by Mateusz Piotrowski ⟨*0mp@FreeBSD.org*⟩. It first appeared in FreeBSD 15.0.
