Skip to content

Commit

Permalink
Remove mem/cpu profiling CLI flags. (#49)
Browse files Browse the repository at this point in the history
I don't believe anyone is using these flags. And removing them reduces
the clutter in the CLI's `--help`.
  • Loading branch information
cwize1 authored Dec 20, 2024
1 parent 334d766 commit 11ad05f
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions toolkit/tools/imagecustomizer/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (
"github.com/microsoft/azurelinux/toolkit/tools/internal/logger"
"github.com/microsoft/azurelinux/toolkit/tools/internal/timestamp"
"github.com/microsoft/azurelinux/toolkit/tools/pkg/imagecustomizerlib"
"github.com/microsoft/azurelinux/toolkit/tools/pkg/profile"
"gopkg.in/alecthomas/kingpin.v2"
)

Expand All @@ -29,7 +28,6 @@ var (
enableShrinkFilesystems = app.Flag("shrink-filesystems", "Enable shrinking of filesystems to minimum size. Supports ext2, ext3, ext4 filesystem types.").Bool()
outputPXEArtifactsDir = app.Flag("output-pxe-artifacts-dir", "Create a directory with customized image PXE booting artifacts. '--output-image-format' must be set to 'iso'.").String()
logFlags = exe.SetupLogFlags(app)
profFlags = exe.SetupProfileFlags(app)
timestampFile = app.Flag("timestamp-file", "File that stores timestamps for this program.").String()
)

Expand All @@ -52,14 +50,10 @@ func main() {
logger.Log.Fatalf("--output-image-format cannot be used with --shrink-filesystems enabled.")
}

prof, err := profile.StartProfiling(profFlags)
if err != nil {
logger.Log.Warnf("Could not start profiling: %s", err)
if *timestampFile != "" {
timestamp.BeginTiming("imagecustomizer", *timestampFile)
defer timestamp.CompleteTiming()
}
defer prof.StopProfiler()

timestamp.BeginTiming("imagecustomizer", *timestampFile)
defer timestamp.CompleteTiming()

err = customizeImage()
if err != nil {
Expand Down

0 comments on commit 11ad05f

Please sign in to comment.