#!/usr/bin/env bash
set -euo pipefail

output_file="$1"
pid="$2"

echo "Recording flame graph performance data."
exec perf record --no-buildid-cache --freq=97 --pid="${pid}" -g --quiet --output="$output_file"
