Enable profiling options when 'pprof' tag is set (#2813)

This commit enables cpu, mem, block, and mutex profling of the FZF
executable. To support flushing the profiles at program exit it adds
util.AtExit to register "at exit" functions and mandates that util.Exit
is used instead of os.Exit to stop the program.

Co-authored-by: Junegunn Choi <junegunn.c@gmail.com>
This commit is contained in:
Charlie Vieth
2024-04-13 01:58:11 -04:00
committed by GitHub
parent 892d1acccb
commit 3c877c504b
12 changed files with 435 additions and 13 deletions

View File

@@ -58,7 +58,7 @@ func openTtyIn() *os.File {
}
}
fmt.Fprintln(os.Stderr, "Failed to open "+consoleDevice)
os.Exit(2)
util.Exit(2)
}
return in
}