GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
* Sign Up! *

Support
Customer Portal
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
DTRACE_PROFILE(4) FreeBSD Kernel Interfaces Manual DTRACE_PROFILE(4)

dtrace_profilea DTrace provider for firing probes at a given time interval

profile:::profile-rate[unit]

profile:::tick-rate[unit]

The profile provider implements three special probes related to the life cycle of the DTrace program itself.

The profile:::profile probes fire on all CPUs and are suitable for measuring the whole system periodically.

The profile:::tick probes fire on a single CPU, potentially a different one every time. They are useful, e.g., for printing partial results periodically.

The profile provider probes will fire at the specified rate.

The default unit is hz. The profile provider supports the following time units:

, nsec nanoseconds
, usec microseconds
, msec milliseconds
, sec seconds
, min minutes
, hour hours
, day days
Hertz (frequency per second)

The arguments of the profile provider probes are:

arg0
The PC (program counter) in the kernel when the probe triggered, or 0 if the process was not in the kernel at that time.
arg1
The PC in the user process when the probe triggered, or 0 if the process was in the kernel when the probe triggered.

Use arguments arg0 and arg1 to tell if the profile provider probe fired in the kernel or in the userspace context.

The sysctl(8) variable kern.dtrace.profile.aframes controls the number of skipped artificial frames for the profile provider.

The following DTrace one-liner uses the profile provider to collect stack traces over 60 seconds.

dtrace -x stackframes=100 -n 'profile-197 /arg0/ {@[stack()] = count();} tick-60s {exit(0);}

The system is profiled at the 197 Hz to avoid sampling in lockstep with other periodic activities. This unnatural frequency minimizes the chance of overlapping with other events.

Option -x stackframes=100 increases the maximum number of kernel stack frames to unwind during stack().

Checking if arg0 is not zero makes sure that profiling happens when the program is in the kernel context.

Refer to https://www.brendangregg.com/flamegraphs.html to learn about generating flame graphs from the obtained stack traces.

dtrace(1), tracing(7)

The illumos Dynamic Tracing Guide, https://www.illumos.org/books/dtrace/chp-profile.html, 2008, Chapter profile Provider.

Brendan Gregg and Jim Mauro, DTrace: Dynamic Tracing in Oracle Solaris, Mac OS X and FreeBSD, Prentice Hall, https://www.brendangregg.com/dtracebook/, pp. 24–25, 2011.

This manual page was written by Mateusz Piotrowski <0mp@FreeBSD.org>.

July 14, 2025 FreeBSD 15.1-RELEASE

Search for    or go to Top of page |  Section 4 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.