Allow overiding profiler rate.

This commit is contained in:
Sleepy Monax 2024-01-22 13:17:30 +01:00
parent 07932d134a
commit 3019b1807f

View file

@ -207,13 +207,15 @@ def debug(cmd: list[str], debugger: str = "lldb", wait: bool = False):
raise RuntimeError(f"Unknown debugger {debugger}")
def profile(cmd: list[str]):
def profile(cmd: list[str], rate=1000):
mkdir(const.TMP_DIR)
perfFile = f"{const.TMP_DIR}/perf.data"
try:
exec(
"perf",
"record",
"-F",
str(rate),
"-g",
"-o",
perfFile,