Skip to content

Commit dea27b1

Browse files
Merge pull request #3036 from jhowardmsft/jjh/etw
Windows: Enable ETW logging
2 parents 0cff074 + d83e4e9 commit dea27b1

36 files changed

Lines changed: 2301 additions & 362 deletions

cmd/containerd/command/main_windows.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import (
2424
"unsafe"
2525

2626
winio "github.com/Microsoft/go-winio"
27+
"github.com/Microsoft/go-winio/pkg/etwlogrus"
2728
"github.com/containerd/containerd/log"
2829
"github.com/containerd/containerd/services/server"
2930
"github.com/sirupsen/logrus"
@@ -89,3 +90,12 @@ func setupDumpStacks() {
8990
}
9091
}()
9192
}
93+
94+
func init() {
95+
// Provider ID: {2acb92c0-eb9b-571a-69cf-8f3410f383ad}
96+
// Hook isn't closed explicitly, as it will exist until process exit.
97+
// GUID is generated based on name - see Microsoft/go-winio/tools/etw-provider-gen.
98+
if hook, err := etwlogrus.NewHook("ContainerD"); err == nil {
99+
logrus.AddHook(hook)
100+
}
101+
}

vendor.conf

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ github.com/gogo/googleapis 08a7655d27152912db7aaf4f983275eaf8d128ef
2121
github.com/golang/protobuf v1.1.0
2222
github.com/opencontainers/runtime-spec 29686dbc5559d93fb1ef402eeda3e35c38d75af4 # v1.0.1-59-g29686db
2323
github.com/opencontainers/runc 6635b4f0c6af3810594d2770f662f34ddc15b40d
24-
github.com/sirupsen/logrus v1.0.3
24+
github.com/konsorten/go-windows-terminal-sequences v1.0.1
25+
github.com/sirupsen/logrus v1.3.0
2526
github.com/urfave/cli 7bc6a0acffa589f415f88aca16cc1de5ffd66f9c
2627
golang.org/x/net b3756b4b77d7b13260a0a2ec658753cf48922eac
2728
google.golang.org/grpc v1.12.0
@@ -32,7 +33,7 @@ github.com/opencontainers/image-spec v1.0.1
3233
golang.org/x/sync 42b317875d0fa942474b76e1b46a6060d720ae6e
3334
github.com/BurntSushi/toml a368813c5e648fee92e5f6c30e3944ff9d5e8895
3435
github.com/grpc-ecosystem/go-grpc-prometheus 6b7015e65d366bf3f19b2b2a000a831940f0f7e0
35-
github.com/Microsoft/go-winio v0.4.11
36+
github.com/Microsoft/go-winio v0.4.12
3637
github.com/Microsoft/hcsshim v0.8.5
3738
google.golang.org/genproto d80a6e20e776b0b17a324d0ba1ab50a39c8e8944
3839
golang.org/x/text 19e51611da83d6be54ddafce4a4af510cb3e9ea4

vendor/github.com/Microsoft/go-winio/internal/etw/etw.go

Lines changed: 15 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/Microsoft/go-winio/internal/etw/eventdata.go

Lines changed: 65 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/Microsoft/go-winio/internal/etw/eventdatadescriptor.go

Lines changed: 29 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/Microsoft/go-winio/internal/etw/eventdescriptor.go

Lines changed: 67 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/Microsoft/go-winio/internal/etw/eventmetadata.go

Lines changed: 177 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)