tracing: Create trace function

Simplify code slightly be creating a `trace()` function.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
This commit is contained in:
James O. D. Hunt
2018-08-20 17:32:16 +01:00
parent a193366b3d
commit f0073bec2f
18 changed files with 37 additions and 43 deletions

View File

@@ -17,7 +17,6 @@ import (
vc "github.com/kata-containers/runtime/virtcontainers"
"github.com/kata-containers/runtime/virtcontainers/pkg/oci"
specs "github.com/opencontainers/runtime-spec/specs-go"
opentracing "github.com/opentracing/opentracing-go"
"github.com/urfave/cli"
)
@@ -189,7 +188,7 @@ func generateExecParams(context *cli.Context, specProcess *oci.CompatOCIProcess)
}
func execute(ctx context.Context, context *cli.Context) error {
span, ctx := opentracing.StartSpanFromContext(ctx, "execute")
span, ctx := trace(ctx, "execute")
defer span.Finish()
containerID := context.Args().First()