Merge pull request #3036 from jhowardmsft/jjh/etw

Windows: Enable ETW logging
This commit is contained in:
Michael Crosby
2019-02-21 20:12:35 -05:00
committed by GitHub
36 changed files with 2305 additions and 366 deletions

View File

@@ -24,6 +24,7 @@ import (
"unsafe"
winio "github.com/Microsoft/go-winio"
"github.com/Microsoft/go-winio/pkg/etwlogrus"
"github.com/containerd/containerd/log"
"github.com/containerd/containerd/services/server"
"github.com/sirupsen/logrus"
@@ -89,3 +90,12 @@ func setupDumpStacks() {
}
}()
}
func init() {
// Provider ID: {2acb92c0-eb9b-571a-69cf-8f3410f383ad}
// Hook isn't closed explicitly, as it will exist until process exit.
// GUID is generated based on name - see Microsoft/go-winio/tools/etw-provider-gen.
if hook, err := etwlogrus.NewHook("ContainerD"); err == nil {
logrus.AddHook(hook)
}
}