mirror of
https://github.com/junegunn/fzf
synced 2026-07-31 18:21:42 +00:00
3c877c504b
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>
12 lines
307 B
Go
12 lines
307 B
Go
//go:build !pprof
|
|
// +build !pprof
|
|
|
|
package fzf
|
|
|
|
func (o *Options) initProfiling() error {
|
|
if o.CPUProfile != "" || o.MEMProfile != "" || o.BlockProfile != "" || o.MutexProfile != "" {
|
|
errorExit("error: profiling not supported: FZF must be built with '-tags=pprof' to enable profiling")
|
|
}
|
|
return nil
|
|
}
|