Allow overiding profiler rate.
This commit is contained in:
parent
07932d134a
commit
3019b1807f
|
@ -207,13 +207,15 @@ def debug(cmd: list[str], debugger: str = "lldb", wait: bool = False):
|
||||||
raise RuntimeError(f"Unknown debugger {debugger}")
|
raise RuntimeError(f"Unknown debugger {debugger}")
|
||||||
|
|
||||||
|
|
||||||
def profile(cmd: list[str]):
|
def profile(cmd: list[str], rate=1000):
|
||||||
mkdir(const.TMP_DIR)
|
mkdir(const.TMP_DIR)
|
||||||
perfFile = f"{const.TMP_DIR}/perf.data"
|
perfFile = f"{const.TMP_DIR}/perf.data"
|
||||||
try:
|
try:
|
||||||
exec(
|
exec(
|
||||||
"perf",
|
"perf",
|
||||||
"record",
|
"record",
|
||||||
|
"-F",
|
||||||
|
str(rate),
|
||||||
"-g",
|
"-g",
|
||||||
"-o",
|
"-o",
|
||||||
perfFile,
|
perfFile,
|
||||||
|
|
Loading…
Reference in a new issue