aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.md5
-rw-r--r--Makefile.common31
-rw-r--r--VERSION2
-rw-r--r--go.mod2
-rw-r--r--go.sum4
-rw-r--r--vendor/golang.org/x/sys/windows/env_windows.go11
-rw-r--r--vendor/golang.org/x/sys/windows/security_windows.go20
-rw-r--r--vendor/golang.org/x/sys/windows/syscall_windows.go30
-rw-r--r--vendor/modules.txt2
9 files changed, 81 insertions, 26 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 9e05d0f..7f32b94 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -3,9 +3,9 @@
3* [CHANGE] 3* [CHANGE]
4* [FEATURE] 4* [FEATURE]
5* [ENHANCEMENT] 5* [ENHANCEMENT]
6* [BUGFIX] Linux CPU: Cache CPU metrics to make them monotonically increasing #1711 6* [BUGFIX]
7 7
8## 1.0.0-rc.1 / 2020-05-14 8## 1.0.0 / 2020-05-25
9 9
10### **Breaking changes** 10### **Breaking changes**
11 11
@@ -59,6 +59,7 @@
59* [ENHANCEMENT] Add metrics for IO errors and retires on Darwin. #1636 59* [ENHANCEMENT] Add metrics for IO errors and retires on Darwin. #1636
60* [ENHANCEMENT] Add perf tracepoint collection flag #1664 60* [ENHANCEMENT] Add perf tracepoint collection flag #1664
61* [ENHANCEMENT] ZFS: read contents of objset file #1632 61* [ENHANCEMENT] ZFS: read contents of objset file #1632
62* [ENHANCEMENT] Linux CPU: Cache CPU metrics to make them monotonically increasing #1711
62* [BUGFIX] Read /proc/net files with a single read syscall #1380 63* [BUGFIX] Read /proc/net files with a single read syscall #1380
63* [BUGFIX] Renamed label `state` to `name` on `node_systemd_service_restart_total`. #1393 64* [BUGFIX] Renamed label `state` to `name` on `node_systemd_service_restart_total`. #1393
64* [BUGFIX] Fix netdev nil reference on Darwin #1414 65* [BUGFIX] Fix netdev nil reference on Darwin #1414
diff --git a/Makefile.common b/Makefile.common
index 066866e..9320176 100644
--- a/Makefile.common
+++ b/Makefile.common
@@ -69,6 +69,15 @@ else
69 GO_BUILD_PLATFORM ?= $(GOHOSTOS)-$(GOHOSTARCH) 69 GO_BUILD_PLATFORM ?= $(GOHOSTOS)-$(GOHOSTARCH)
70endif 70endif
71 71
72GOTEST := $(GO) test
73GOTEST_DIR :=
74ifneq ($(CIRCLE_JOB),)
75ifneq ($(shell which gotestsum),)
76 GOTEST_DIR := test-results
77 GOTEST := gotestsum --junitfile $(GOTEST_DIR)/unit-tests.xml --
78endif
79endif
80
72PROMU_VERSION ?= 0.5.0 81PROMU_VERSION ?= 0.5.0
73PROMU_URL := https://github.com/prometheus/promu/releases/download/v$(PROMU_VERSION)/promu-$(PROMU_VERSION).$(GO_BUILD_PLATFORM).tar.gz 82PROMU_URL := https://github.com/prometheus/promu/releases/download/v$(PROMU_VERSION)/promu-$(PROMU_VERSION).$(GO_BUILD_PLATFORM).tar.gz
74 83
@@ -141,15 +150,29 @@ else
141 $(GO) get $(GOOPTS) -t ./... 150 $(GO) get $(GOOPTS) -t ./...
142endif 151endif
143 152
153.PHONY: update-go-deps
154update-go-deps:
155 @echo ">> updating Go dependencies"
156 @for m in $$($(GO) list -mod=readonly -m -f '{{ if and (not .Indirect) (not .Main)}}{{.Path}}{{end}}' all); do \
157 $(GO) get $$m; \
158 done
159 GO111MODULE=$(GO111MODULE) $(GO) mod tidy
160ifneq (,$(wildcard vendor))
161 GO111MODULE=$(GO111MODULE) $(GO) mod vendor
162endif
163
144.PHONY: common-test-short 164.PHONY: common-test-short
145common-test-short: 165common-test-short: $(GOTEST_DIR)
146 @echo ">> running short tests" 166 @echo ">> running short tests"
147 GO111MODULE=$(GO111MODULE) $(GO) test -short $(GOOPTS) $(pkgs) 167 GO111MODULE=$(GO111MODULE) $(GOTEST) -short $(GOOPTS) $(pkgs)
148 168
149.PHONY: common-test 169.PHONY: common-test
150common-test: 170common-test: $(GOTEST_DIR)
151 @echo ">> running all tests" 171 @echo ">> running all tests"
152 GO111MODULE=$(GO111MODULE) $(GO) test $(test-flags) $(GOOPTS) $(pkgs) 172 GO111MODULE=$(GO111MODULE) $(GOTEST) $(test-flags) $(GOOPTS) $(pkgs)
173
174$(GOTEST_DIR):
175 @mkdir -p $@
153 176
154.PHONY: common-format 177.PHONY: common-format
155common-format: 178common-format:
diff --git a/VERSION b/VERSION
index 9c21819..3eefcb9 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
1.0.0-rc.1 1.0.0
diff --git a/go.mod b/go.mod
index 8a7d4a5..dd11712 100644
--- a/go.mod
+++ b/go.mod
@@ -28,7 +28,7 @@ require (
28 golang.org/x/lint v0.0.0-20200302205851-738671d3881b // indirect 28 golang.org/x/lint v0.0.0-20200302205851-738671d3881b // indirect
29 golang.org/x/net v0.0.0-20200513185701-a91f0712d120 // indirect 29 golang.org/x/net v0.0.0-20200513185701-a91f0712d120 // indirect
30 golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a // indirect 30 golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a // indirect
31 golang.org/x/sys v0.0.0-20200513112337-417ce2331b5c 31 golang.org/x/sys v0.0.0-20200523222454-059865788121
32 golang.org/x/tools v0.0.0-20200513201620-d5fe73897c97 // indirect 32 golang.org/x/tools v0.0.0-20200513201620-d5fe73897c97 // indirect
33 gopkg.in/alecthomas/kingpin.v2 v2.2.6 33 gopkg.in/alecthomas/kingpin.v2 v2.2.6
34 gopkg.in/yaml.v2 v2.3.0 34 gopkg.in/yaml.v2 v2.3.0
diff --git a/go.sum b/go.sum
index 4090dff..a02aef6 100644
--- a/go.sum
+++ b/go.sum
@@ -432,8 +432,8 @@ golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7w
432golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 432golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
433golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 433golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
434golang.org/x/sys v0.0.0-20200420163511-1957bb5e6d1f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 434golang.org/x/sys v0.0.0-20200420163511-1957bb5e6d1f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
435golang.org/x/sys v0.0.0-20200513112337-417ce2331b5c h1:kISX68E8gSkNYAFRFiDU8rl5RIn1sJYKYb/r2vMLDrU= 435golang.org/x/sys v0.0.0-20200523222454-059865788121 h1:rITEj+UZHYC927n8GT97eC3zrpzXdb/voyeOuVKS46o=
436golang.org/x/sys v0.0.0-20200513112337-417ce2331b5c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 436golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
437golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= 437golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
438golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= 438golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs=
439golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= 439golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
diff --git a/vendor/golang.org/x/sys/windows/env_windows.go b/vendor/golang.org/x/sys/windows/env_windows.go
index f482a9f..92ac05f 100644
--- a/vendor/golang.org/x/sys/windows/env_windows.go
+++ b/vendor/golang.org/x/sys/windows/env_windows.go
@@ -8,7 +8,6 @@ package windows
8 8
9import ( 9import (
10 "syscall" 10 "syscall"
11 "unicode/utf16"
12 "unsafe" 11 "unsafe"
13) 12)
14 13
@@ -40,17 +39,11 @@ func (token Token) Environ(inheritExisting bool) (env []string, err error) {
40 defer DestroyEnvironmentBlock(block) 39 defer DestroyEnvironmentBlock(block)
41 blockp := uintptr(unsafe.Pointer(block)) 40 blockp := uintptr(unsafe.Pointer(block))
42 for { 41 for {
43 entry := (*[(1 << 30) - 1]uint16)(unsafe.Pointer(blockp))[:] 42 entry := UTF16PtrToString((*uint16)(unsafe.Pointer(blockp)))
44 for i, v := range entry {
45 if v == 0 {
46 entry = entry[:i]
47 break
48 }
49 }
50 if len(entry) == 0 { 43 if len(entry) == 0 {
51 break 44 break
52 } 45 }
53 env = append(env, string(utf16.Decode(entry))) 46 env = append(env, entry)
54 blockp += 2 * (uintptr(len(entry)) + 1) 47 blockp += 2 * (uintptr(len(entry)) + 1)
55 } 48 }
56 return env, nil 49 return env, nil
diff --git a/vendor/golang.org/x/sys/windows/security_windows.go b/vendor/golang.org/x/sys/windows/security_windows.go
index 4b6eff1..9e3c44a 100644
--- a/vendor/golang.org/x/sys/windows/security_windows.go
+++ b/vendor/golang.org/x/sys/windows/security_windows.go
@@ -7,6 +7,8 @@ package windows
7import ( 7import (
8 "syscall" 8 "syscall"
9 "unsafe" 9 "unsafe"
10
11 "golang.org/x/sys/internal/unsafeheader"
10) 12)
11 13
12const ( 14const (
@@ -1229,7 +1231,7 @@ func (sd *SECURITY_DESCRIPTOR) String() string {
1229 return "" 1231 return ""
1230 } 1232 }
1231 defer LocalFree(Handle(unsafe.Pointer(sddl))) 1233 defer LocalFree(Handle(unsafe.Pointer(sddl)))
1232 return UTF16ToString((*[(1 << 30) - 1]uint16)(unsafe.Pointer(sddl))[:]) 1234 return UTF16PtrToString(sddl)
1233} 1235}
1234 1236
1235// ToAbsolute converts a self-relative security descriptor into an absolute one. 1237// ToAbsolute converts a self-relative security descriptor into an absolute one.
@@ -1307,9 +1309,17 @@ func (absoluteSD *SECURITY_DESCRIPTOR) ToSelfRelative() (selfRelativeSD *SECURIT
1307} 1309}
1308 1310
1309func (selfRelativeSD *SECURITY_DESCRIPTOR) copySelfRelativeSecurityDescriptor() *SECURITY_DESCRIPTOR { 1311func (selfRelativeSD *SECURITY_DESCRIPTOR) copySelfRelativeSecurityDescriptor() *SECURITY_DESCRIPTOR {
1310 sdBytes := make([]byte, selfRelativeSD.Length()) 1312 sdLen := (int)(selfRelativeSD.Length())
1311 copy(sdBytes, (*[(1 << 31) - 1]byte)(unsafe.Pointer(selfRelativeSD))[:len(sdBytes)]) 1313
1312 return (*SECURITY_DESCRIPTOR)(unsafe.Pointer(&sdBytes[0])) 1314 var src []byte
1315 h := (*unsafeheader.Slice)(unsafe.Pointer(&src))
1316 h.Data = unsafe.Pointer(selfRelativeSD)
1317 h.Len = sdLen
1318 h.Cap = sdLen
1319
1320 dst := make([]byte, sdLen)
1321 copy(dst, src)
1322 return (*SECURITY_DESCRIPTOR)(unsafe.Pointer(&dst[0]))
1313} 1323}
1314 1324
1315// SecurityDescriptorFromString converts an SDDL string describing a security descriptor into a 1325// SecurityDescriptorFromString converts an SDDL string describing a security descriptor into a
@@ -1391,6 +1401,6 @@ func ACLFromEntries(explicitEntries []EXPLICIT_ACCESS, mergedACL *ACL) (acl *ACL
1391 } 1401 }
1392 defer LocalFree(Handle(unsafe.Pointer(winHeapACL))) 1402 defer LocalFree(Handle(unsafe.Pointer(winHeapACL)))
1393 aclBytes := make([]byte, winHeapACL.aclSize) 1403 aclBytes := make([]byte, winHeapACL.aclSize)
1394 copy(aclBytes, (*[(1 << 31) - 1]byte)(unsafe.Pointer(winHeapACL))[:len(aclBytes)]) 1404 copy(aclBytes, (*[(1 << 31) - 1]byte)(unsafe.Pointer(winHeapACL))[:len(aclBytes):len(aclBytes)])
1395 return (*ACL)(unsafe.Pointer(&aclBytes[0])), nil 1405 return (*ACL)(unsafe.Pointer(&aclBytes[0])), nil
1396} 1406}
diff --git a/vendor/golang.org/x/sys/windows/syscall_windows.go b/vendor/golang.org/x/sys/windows/syscall_windows.go
index b3e5503..12c0544 100644
--- a/vendor/golang.org/x/sys/windows/syscall_windows.go
+++ b/vendor/golang.org/x/sys/windows/syscall_windows.go
@@ -13,6 +13,8 @@ import (
13 "time" 13 "time"
14 "unicode/utf16" 14 "unicode/utf16"
15 "unsafe" 15 "unsafe"
16
17 "golang.org/x/sys/internal/unsafeheader"
16) 18)
17 19
18type Handle uintptr 20type Handle uintptr
@@ -117,6 +119,32 @@ func UTF16PtrFromString(s string) (*uint16, error) {
117 return &a[0], nil 119 return &a[0], nil
118} 120}
119 121
122// UTF16PtrToString takes a pointer to a UTF-16 sequence and returns the corresponding UTF-8 encoded string.
123// If the pointer is nil, this returns the empty string. This assumes that the UTF-16 sequence is terminated
124// at a zero word; if the zero word is not present, the program may crash.
125func UTF16PtrToString(p *uint16) string {
126 if p == nil {
127 return ""
128 }
129 if *p == 0 {
130 return ""
131 }
132
133 // Find NUL terminator.
134 n := 0
135 for ptr := unsafe.Pointer(p); *(*uint16)(ptr) != 0; n++ {
136 ptr = unsafe.Pointer(uintptr(ptr) + unsafe.Sizeof(*p))
137 }
138
139 var s []uint16
140 h := (*unsafeheader.Slice)(unsafe.Pointer(&s))
141 h.Data = unsafe.Pointer(p)
142 h.Len = n
143 h.Cap = n
144
145 return string(utf16.Decode(s))
146}
147
120func Getpagesize() int { return 4096 } 148func Getpagesize() int { return 4096 }
121 149
122// NewCallback converts a Go function to a function pointer conforming to the stdcall calling convention. 150// NewCallback converts a Go function to a function pointer conforming to the stdcall calling convention.
@@ -1383,7 +1411,7 @@ func (t Token) KnownFolderPath(folderID *KNOWNFOLDERID, flags uint32) (string, e
1383 return "", err 1411 return "", err
1384 } 1412 }
1385 defer CoTaskMemFree(unsafe.Pointer(p)) 1413 defer CoTaskMemFree(unsafe.Pointer(p))
1386 return UTF16ToString((*[(1 << 30) - 1]uint16)(unsafe.Pointer(p))[:]), nil 1414 return UTF16PtrToString(p), nil
1387} 1415}
1388 1416
1389// RtlGetVersion returns the version of the underlying operating system, ignoring 1417// RtlGetVersion returns the version of the underlying operating system, ignoring
diff --git a/vendor/modules.txt b/vendor/modules.txt
index 3af82f3..50c44d6 100644
--- a/vendor/modules.txt
+++ b/vendor/modules.txt
@@ -123,7 +123,7 @@ golang.org/x/net/trace
123# golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a 123# golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a
124## explicit 124## explicit
125golang.org/x/sync/errgroup 125golang.org/x/sync/errgroup
126# golang.org/x/sys v0.0.0-20200513112337-417ce2331b5c 126# golang.org/x/sys v0.0.0-20200523222454-059865788121
127## explicit 127## explicit
128golang.org/x/sys/internal/unsafeheader 128golang.org/x/sys/internal/unsafeheader
129golang.org/x/sys/unix 129golang.org/x/sys/unix