summaryrefslogtreecommitdiff
path: root/cmd/podman
diff options
context:
space:
mode:
authorValentin Rothberg <rothberg@redhat.com>2021-02-25 20:47:21 +0100
committerValentin Rothberg <rothberg@redhat.com>2021-03-08 09:22:42 +0100
commitd0d084dd8ce37141e0a2f0e9def78ffbb613ab94 (patch)
treebd626d1310b64b2f5410a2ca8a7f5a7232634d2b /cmd/podman
parent320df838810cbdb0f3dc0e2092f5ed04fc9b6e5d (diff)
downloadpodman-d0d084dd8ce37141e0a2f0e9def78ffbb613ab94.tar.gz
podman-d0d084dd8ce37141e0a2f0e9def78ffbb613ab94.tar.bz2
podman-d0d084dd8ce37141e0a2f0e9def78ffbb613ab94.zip
turn hidden --trace into a NOP
The --trace has helped in early stages analyze Podman code. However, it's contributing to dependency and binary bloat. The standard go tooling can also help in profiling, so let's turn `--trace` into a NOP. [NO TESTS NEEDED] Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
Diffstat (limited to 'cmd/podman')
-rw-r--r--cmd/podman/root.go19
1 files changed, 0 insertions, 19 deletions
diff --git a/cmd/podman/root.go b/cmd/podman/root.go
index 874573bb9..7722e35dd 100644
--- a/cmd/podman/root.go
+++ b/cmd/podman/root.go
@@ -17,9 +17,7 @@ import (
"github.com/containers/podman/v3/pkg/domain/entities"
"github.com/containers/podman/v3/pkg/parallel"
"github.com/containers/podman/v3/pkg/rootless"
- "github.com/containers/podman/v3/pkg/tracing"
"github.com/containers/podman/v3/version"
- "github.com/opentracing/opentracing-go"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
@@ -103,7 +101,6 @@ func Execute() {
}
func persistentPreRunE(cmd *cobra.Command, args []string) error {
- // TODO: Remove trace statement in podman V2.1
logrus.Debugf("Called %s.PersistentPreRunE(%s)", cmd.Name(), strings.Join(os.Args, " "))
// Help, completion and commands with subcommands are special cases, no need for more setup
@@ -194,16 +191,6 @@ func persistentPreRunE(cmd *cobra.Command, args []string) error {
}
}
- if cmd.Flag("trace").Changed {
- tracer, closer := tracing.Init("podman")
- opentracing.SetGlobalTracer(tracer)
- cfg.SpanCloser = closer
-
- cfg.Span = tracer.StartSpan("before-context")
- cfg.SpanCtx = opentracing.ContextWithSpan(registry.Context(), cfg.Span)
- opentracing.StartSpanFromContext(cfg.SpanCtx, cmd.Name())
- }
-
if cfg.MaxWorks <= 0 {
return errors.Errorf("maximum workers must be set to a positive number (got %d)", cfg.MaxWorks)
}
@@ -226,22 +213,16 @@ func persistentPreRunE(cmd *cobra.Command, args []string) error {
}
func persistentPostRunE(cmd *cobra.Command, args []string) error {
- // TODO: Remove trace statement in podman V2.1
logrus.Debugf("Called %s.PersistentPostRunE(%s)", cmd.Name(), strings.Join(os.Args, " "))
if !requireCleanup {
return nil
}
- cfg := registry.PodmanConfig()
if !registry.IsRemote() {
if cmd.Flag("cpu-profile").Changed {
pprof.StopCPUProfile()
}
- if cmd.Flag("trace").Changed {
- cfg.Span.Finish()
- cfg.SpanCloser.Close()
- }
}
registry.ImageEngine().Shutdown(registry.Context())