mirror of
https://github.com/junegunn/fzf.git
synced 2025-05-18 20:30:22 -07:00
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
|
|
}
|