diff options
Diffstat (limited to 'cmd/btrfs-rec')
-rw-r--r-- | cmd/btrfs-rec/main.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/cmd/btrfs-rec/main.go b/cmd/btrfs-rec/main.go index d9ab485..d4165bf 100644 --- a/cmd/btrfs-rec/main.go +++ b/cmd/btrfs-rec/main.go @@ -16,6 +16,7 @@ import ( "git.lukeshu.com/btrfs-progs-ng/lib/btrfs" "git.lukeshu.com/btrfs-progs-ng/lib/btrfs/btrfsvol" "git.lukeshu.com/btrfs-progs-ng/lib/btrfsprogs/btrfsutil" + "git.lukeshu.com/btrfs-progs-ng/lib/profile" "git.lukeshu.com/btrfs-progs-ng/lib/textui" ) @@ -61,6 +62,7 @@ func main() { if err := argparser.MarkPersistentFlagFilename("mappings"); err != nil { panic(err) } + stopProfiling := profile.AddProfileFlags(argparser.PersistentFlags(), "profile.") openFlag := os.O_RDONLY @@ -113,6 +115,9 @@ func main() { err = _err } } + defer func() { + maybeSetErr(stopProfiling()) + }() fs, err := btrfsutil.Open(ctx, openFlag, pvsFlag...) if err != nil { return err |