1/*	$OpenBSD: uprofile.bt,v 1.1 2023/05/12 14:34:00 claudio Exp $	*/
2
3/*
4 * uprofile.bt	Userland profiling (stack sampling) at 100Hz.
5 *
6 * To produce a FlameGraph process the output with stackcollapse-bpftrace.pl
7 * and flamegraph.pl found in:
8 *	https://github.com/brendangregg/FlameGraph
9 *
10 * The PID of the to be monitored process is the first optional argument to
11 * btrace(8).
12 * This only works for a single static binary where everything was compiled
13 * with -fno-omit-frame-pointer.
14 */
15profile:hz:100 / pid == $1 / {
16	@[ustack] = count();
17}
18