diff options
author | Ben Kochie <superq@gmail.com> | 2020-03-19 19:51:20 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-19 19:51:20 +0100 |
commit | 47610d0d2b0e8bccc0595e413f232c24bdd56260 (patch) | |
tree | 834bd90ab9df0b18015d4e0c3b7f6193b55945b2 | |
parent | e49a13d0cfeabc3ab00a613401e941b3fbe71c40 (diff) | |
download | prometheus_node_collector-47610d0d2b0e8bccc0595e413f232c24bdd56260.tar.bz2 prometheus_node_collector-47610d0d2b0e8bccc0595e413f232c24bdd56260.tar.xz prometheus_node_collector-47610d0d2b0e8bccc0595e413f232c24bdd56260.zip |
Update procfs library (#1640)
Bump procfs to latest release.
Fixes: https://github.com/prometheus/node_exporter/issues/1625
Fixes: https://github.com/prometheus/node_exporter/issues/1634
Signed-off-by: Ben Kochie <superq@gmail.com>
-rw-r--r-- | go.mod | 2 | ||||
-rw-r--r-- | go.sum | 5 | ||||
-rw-r--r-- | vendor/github.com/prometheus/procfs/.golangci.yml | 4 | ||||
-rw-r--r-- | vendor/github.com/prometheus/procfs/Makefile.common | 20 | ||||
-rw-r--r-- | vendor/github.com/prometheus/procfs/bcache/bcache.go | 2 | ||||
-rw-r--r-- | vendor/github.com/prometheus/procfs/bcache/get.go | 25 | ||||
-rw-r--r-- | vendor/github.com/prometheus/procfs/fixtures.ttar | 42 | ||||
-rw-r--r-- | vendor/github.com/prometheus/procfs/go.mod | 1 | ||||
-rw-r--r-- | vendor/github.com/prometheus/procfs/go.sum | 2 | ||||
-rw-r--r-- | vendor/github.com/prometheus/procfs/mountinfo.go | 12 | ||||
-rw-r--r-- | vendor/github.com/prometheus/procfs/net_softnet.go | 14 | ||||
-rw-r--r-- | vendor/github.com/prometheus/procfs/proc_fdinfo.go | 32 | ||||
-rw-r--r-- | vendor/github.com/prometheus/procfs/proc_maps.go | 208 | ||||
-rw-r--r-- | vendor/github.com/prometheus/procfs/proc_status.go | 32 | ||||
-rw-r--r-- | vendor/github.com/prometheus/procfs/sysfs/class_infiniband.go | 4 | ||||
-rw-r--r-- | vendor/github.com/prometheus/procfs/sysfs/net_class.go | 2 | ||||
-rw-r--r-- | vendor/modules.txt | 2 |
17 files changed, 345 insertions, 64 deletions
@@ -18,7 +18,7 @@ require ( | |||
18 | github.com/prometheus/client_golang v1.4.1 | 18 | github.com/prometheus/client_golang v1.4.1 |
19 | github.com/prometheus/client_model v0.2.0 | 19 | github.com/prometheus/client_model v0.2.0 |
20 | github.com/prometheus/common v0.9.1 | 20 | github.com/prometheus/common v0.9.1 |
21 | github.com/prometheus/procfs v0.0.10 | 21 | github.com/prometheus/procfs v0.0.11 |
22 | github.com/siebenmann/go-kstat v0.0.0-20160321171754-d34789b79745 | 22 | github.com/siebenmann/go-kstat v0.0.0-20160321171754-d34789b79745 |
23 | github.com/soundcloud/go-runit v0.0.0-20150630195641-06ad41a06c4a | 23 | github.com/soundcloud/go-runit v0.0.0-20150630195641-06ad41a06c4a |
24 | go.uber.org/atomic v1.5.1 // indirect | 24 | go.uber.org/atomic v1.5.1 // indirect |
@@ -275,8 +275,8 @@ github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R | |||
275 | github.com/prometheus/procfs v0.0.2 h1:6LJUbpNm42llc4HRCuvApCSWB/WfhuNo9K98Q9sNGfs= | 275 | github.com/prometheus/procfs v0.0.2 h1:6LJUbpNm42llc4HRCuvApCSWB/WfhuNo9K98Q9sNGfs= |
276 | github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= | 276 | github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= |
277 | github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= | 277 | github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= |
278 | github.com/prometheus/procfs v0.0.10 h1:QJQN3jYQhkamO4mhfUWqdDH2asK7ONOI9MTWjyAxNKM= | 278 | github.com/prometheus/procfs v0.0.11 h1:DhHlBtkHWPYi8O2y31JkK0TF+DGM+51OopZjH/Ia5qI= |
279 | github.com/prometheus/procfs v0.0.10/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= | 279 | github.com/prometheus/procfs v0.0.11/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= |
280 | github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= | 280 | github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= |
281 | github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= | 281 | github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= |
282 | github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= | 282 | github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= |
@@ -405,6 +405,7 @@ golang.org/x/sys v0.0.0-20190902133755-9109b7679e13/go.mod h1:h1NjWce9XRLGQEsW7w | |||
405 | golang.org/x/sys v0.0.0-20191008105621-543471e840be h1:QAcqgptGM8IQBC9K/RC4o+O9YmqEm0diQn9QmZw/0mU= | 405 | golang.org/x/sys v0.0.0-20191008105621-543471e840be h1:QAcqgptGM8IQBC9K/RC4o+O9YmqEm0diQn9QmZw/0mU= |
406 | golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | 406 | golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= |
407 | golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | 407 | golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= |
408 | golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | ||
408 | golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | 409 | golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= |
409 | golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | 410 | golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= |
410 | golang.org/x/sys v0.0.0-20200217220822-9197077df867 h1:JoRuNIf+rpHl+VhScRQQvzbHed86tKkqwPMV34T8myw= | 411 | golang.org/x/sys v0.0.0-20200217220822-9197077df867 h1:JoRuNIf+rpHl+VhScRQQvzbHed86tKkqwPMV34T8myw= |
diff --git a/vendor/github.com/prometheus/procfs/.golangci.yml b/vendor/github.com/prometheus/procfs/.golangci.yml index 7c4ce1f..0aa09ed 100644 --- a/vendor/github.com/prometheus/procfs/.golangci.yml +++ b/vendor/github.com/prometheus/procfs/.golangci.yml | |||
@@ -1,4 +1,4 @@ | |||
1 | --- | ||
1 | linters: | 2 | linters: |
2 | enable: | 3 | enable: |
3 | - staticcheck | 4 | - golint |
4 | - govet | ||
diff --git a/vendor/github.com/prometheus/procfs/Makefile.common b/vendor/github.com/prometheus/procfs/Makefile.common index 066866e..b978dfc 100644 --- a/vendor/github.com/prometheus/procfs/Makefile.common +++ b/vendor/github.com/prometheus/procfs/Makefile.common | |||
@@ -69,6 +69,15 @@ else | |||
69 | GO_BUILD_PLATFORM ?= $(GOHOSTOS)-$(GOHOSTARCH) | 69 | GO_BUILD_PLATFORM ?= $(GOHOSTOS)-$(GOHOSTARCH) |
70 | endif | 70 | endif |
71 | 71 | ||
72 | GOTEST := $(GO) test | ||
73 | GOTEST_DIR := | ||
74 | ifneq ($(CIRCLE_JOB),) | ||
75 | ifneq ($(shell which gotestsum),) | ||
76 | GOTEST_DIR := test-results | ||
77 | GOTEST := gotestsum --junitfile $(GOTEST_DIR)/unit-tests.xml -- | ||
78 | endif | ||
79 | endif | ||
80 | |||
72 | PROMU_VERSION ?= 0.5.0 | 81 | PROMU_VERSION ?= 0.5.0 |
73 | PROMU_URL := https://github.com/prometheus/promu/releases/download/v$(PROMU_VERSION)/promu-$(PROMU_VERSION).$(GO_BUILD_PLATFORM).tar.gz | 82 | PROMU_URL := https://github.com/prometheus/promu/releases/download/v$(PROMU_VERSION)/promu-$(PROMU_VERSION).$(GO_BUILD_PLATFORM).tar.gz |
74 | 83 | ||
@@ -142,14 +151,17 @@ else | |||
142 | endif | 151 | endif |
143 | 152 | ||
144 | .PHONY: common-test-short | 153 | .PHONY: common-test-short |
145 | common-test-short: | 154 | common-test-short: $(GOTEST_DIR) |
146 | @echo ">> running short tests" | 155 | @echo ">> running short tests" |
147 | GO111MODULE=$(GO111MODULE) $(GO) test -short $(GOOPTS) $(pkgs) | 156 | GO111MODULE=$(GO111MODULE) $(GOTEST) -short $(GOOPTS) $(pkgs) |
148 | 157 | ||
149 | .PHONY: common-test | 158 | .PHONY: common-test |
150 | common-test: | 159 | common-test: $(GOTEST_DIR) |
151 | @echo ">> running all tests" | 160 | @echo ">> running all tests" |
152 | GO111MODULE=$(GO111MODULE) $(GO) test $(test-flags) $(GOOPTS) $(pkgs) | 161 | GO111MODULE=$(GO111MODULE) $(GOTEST) $(test-flags) $(GOOPTS) $(pkgs) |
162 | |||
163 | $(GOTEST_DIR): | ||
164 | @mkdir -p $@ | ||
153 | 165 | ||
154 | .PHONY: common-format | 166 | .PHONY: common-format |
155 | common-format: | 167 | common-format: |
diff --git a/vendor/github.com/prometheus/procfs/bcache/bcache.go b/vendor/github.com/prometheus/procfs/bcache/bcache.go index 1db178c..df724ed 100644 --- a/vendor/github.com/prometheus/procfs/bcache/bcache.go +++ b/vendor/github.com/prometheus/procfs/bcache/bcache.go | |||
@@ -29,7 +29,7 @@ type Stats struct { | |||
29 | } | 29 | } |
30 | 30 | ||
31 | // BcacheStats contains statistics tied to a bcache ID. | 31 | // BcacheStats contains statistics tied to a bcache ID. |
32 | type BcacheStats struct { | 32 | type BcacheStats struct { // nolint:golint |
33 | AverageKeySize uint64 | 33 | AverageKeySize uint64 |
34 | BtreeCacheSize uint64 | 34 | BtreeCacheSize uint64 |
35 | CacheAvailablePercent uint64 | 35 | CacheAvailablePercent uint64 |
diff --git a/vendor/github.com/prometheus/procfs/bcache/get.go b/vendor/github.com/prometheus/procfs/bcache/get.go index a8896bd..67fcf8b 100644 --- a/vendor/github.com/prometheus/procfs/bcache/get.go +++ b/vendor/github.com/prometheus/procfs/bcache/get.go | |||
@@ -51,8 +51,21 @@ func NewFS(mountPoint string) (FS, error) { | |||
51 | return FS{&fs}, nil | 51 | return FS{&fs}, nil |
52 | } | 52 | } |
53 | 53 | ||
54 | // Stats retrieves bcache runtime statistics for each bcache. | 54 | // Stats is a wrapper around stats() |
55 | // It returns full available statistics | ||
55 | func (fs FS) Stats() ([]*Stats, error) { | 56 | func (fs FS) Stats() ([]*Stats, error) { |
57 | return fs.stats(true) | ||
58 | } | ||
59 | |||
60 | // StatsWithoutPriority is a wrapper around stats(). | ||
61 | // It ignores priority_stats file, because it is expensive to read. | ||
62 | func (fs FS) StatsWithoutPriority() ([]*Stats, error) { | ||
63 | return fs.stats(false) | ||
64 | } | ||
65 | |||
66 | // stats() retrieves bcache runtime statistics for each bcache. | ||
67 | // priorityStats flag controls if we need to read priority_stats. | ||
68 | func (fs FS) stats(priorityStats bool) ([]*Stats, error) { | ||
56 | matches, err := filepath.Glob(fs.sys.Path("fs/bcache/*-*")) | 69 | matches, err := filepath.Glob(fs.sys.Path("fs/bcache/*-*")) |
57 | if err != nil { | 70 | if err != nil { |
58 | return nil, err | 71 | return nil, err |
@@ -64,7 +77,7 @@ func (fs FS) Stats() ([]*Stats, error) { | |||
64 | name := filepath.Base(uuidPath) | 77 | name := filepath.Base(uuidPath) |
65 | 78 | ||
66 | // stats | 79 | // stats |
67 | s, err := GetStats(uuidPath) | 80 | s, err := GetStats(uuidPath, priorityStats) |
68 | if err != nil { | 81 | if err != nil { |
69 | return nil, err | 82 | return nil, err |
70 | } | 83 | } |
@@ -251,7 +264,7 @@ func (p *parser) getPriorityStats() PriorityStats { | |||
251 | } | 264 | } |
252 | 265 | ||
253 | // GetStats collects from sysfs files data tied to one bcache ID. | 266 | // GetStats collects from sysfs files data tied to one bcache ID. |
254 | func GetStats(uuidPath string) (*Stats, error) { | 267 | func GetStats(uuidPath string, priorityStats bool) (*Stats, error) { |
255 | var bs Stats | 268 | var bs Stats |
256 | 269 | ||
257 | par := parser{uuidPath: uuidPath} | 270 | par := parser{uuidPath: uuidPath} |
@@ -370,8 +383,10 @@ func GetStats(uuidPath string) (*Stats, error) { | |||
370 | cs.MetadataWritten = par.readValue("metadata_written") | 383 | cs.MetadataWritten = par.readValue("metadata_written") |
371 | cs.Written = par.readValue("written") | 384 | cs.Written = par.readValue("written") |
372 | 385 | ||
373 | ps := par.getPriorityStats() | 386 | if priorityStats { |
374 | cs.Priority = ps | 387 | ps := par.getPriorityStats() |
388 | cs.Priority = ps | ||
389 | } | ||
375 | } | 390 | } |
376 | 391 | ||
377 | if par.err != nil { | 392 | if par.err != nil { |
diff --git a/vendor/github.com/prometheus/procfs/fixtures.ttar b/vendor/github.com/prometheus/procfs/fixtures.ttar index a21ccad..45a7321 100644 --- a/vendor/github.com/prometheus/procfs/fixtures.ttar +++ b/vendor/github.com/prometheus/procfs/fixtures.ttar | |||
@@ -289,6 +289,19 @@ Max realtime priority 0 0 | |||
289 | Max realtime timeout unlimited unlimited us | 289 | Max realtime timeout unlimited unlimited us |
290 | Mode: 644 | 290 | Mode: 644 |
291 | # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | 291 | # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
292 | Path: fixtures/proc/26232/maps | ||
293 | Lines: 9 | ||
294 | 55680ae1e000-55680ae20000 r--p 00000000 fd:01 47316994 /bin/cat | ||
295 | 55680ae29000-55680ae2a000 rwxs 0000a000 fd:01 47316994 /bin/cat | ||
296 | 55680bed6000-55680bef7000 rw-p 00000000 00:00 0 [heap] | ||
297 | 7fdf964fc000-7fdf973f2000 r--p 00000000 fd:01 17432624 /usr/lib/locale/locale-archive | ||
298 | 7fdf973f2000-7fdf97417000 r--p 00000000 fd:01 60571062 /lib/x86_64-linux-gnu/libc-2.29.so | ||
299 | 7ffe9215c000-7ffe9217f000 rw-p 00000000 00:00 0 [stack] | ||
300 | 7ffe921da000-7ffe921dd000 r--p 00000000 00:00 0 [vvar] | ||
301 | 7ffe921dd000-7ffe921de000 r-xp 00000000 00:00 0 [vdso] | ||
302 | ffffffffff600000-ffffffffff601000 --xp 00000000 00:00 0 [vsyscall] | ||
303 | Mode: 644 | ||
304 | # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||
292 | Path: fixtures/proc/26232/root | 305 | Path: fixtures/proc/26232/root |
293 | SymlinkTo: /does/not/exist | 306 | SymlinkTo: /does/not/exist |
294 | # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | 307 | # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
@@ -317,6 +330,17 @@ Lines: 8 | |||
317 | || || | 330 | || || |
318 | Mode: 644 | 331 | Mode: 644 |
319 | # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | 332 | # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
333 | Directory: fixtures/proc/26234 | ||
334 | Mode: 755 | ||
335 | # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||
336 | Path: fixtures/proc/26234/maps | ||
337 | Lines: 4 | ||
338 | 08048000-08089000 r-xp 00000000 03:01 104219 /bin/tcsh | ||
339 | 08089000-0808c000 rw-p 00041000 03:01 104219 /bin/tcsh | ||
340 | 0808c000-08146000 rwxp 00000000 00:00 0 | ||
341 | 40000000-40015000 r-xp 00000000 03:01 61874 /lib/ld-2.3.2.so | ||
342 | Mode: 644 | ||
343 | # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||
320 | Directory: fixtures/proc/584 | 344 | Directory: fixtures/proc/584 |
321 | Mode: 755 | 345 | Mode: 755 |
322 | # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | 346 | # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
@@ -1529,11 +1553,6 @@ max keysize : 32 | |||
1529 | 1553 | ||
1530 | Mode: 444 | 1554 | Mode: 444 |
1531 | # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | 1555 | # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
1532 | Path: fixtures/proc/loadavg | ||
1533 | Lines: 1 | ||
1534 | 0.02 0.04 0.05 1/497 11947 | ||
1535 | Mode: 444 | ||
1536 | # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||
1537 | Path: fixtures/proc/diskstats | 1556 | Path: fixtures/proc/diskstats |
1538 | Lines: 49 | 1557 | Lines: 49 |
1539 | 1 0 ram0 0 0 0 0 0 0 0 0 0 0 0 | 1558 | 1 0 ram0 0 0 0 0 0 0 0 0 0 0 0 |
@@ -1620,6 +1639,11 @@ xpc 399724544 92823103 86219234 | |||
1620 | debug 0 | 1639 | debug 0 |
1621 | Mode: 644 | 1640 | Mode: 644 |
1622 | # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | 1641 | # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
1642 | Path: fixtures/proc/loadavg | ||
1643 | Lines: 1 | ||
1644 | 0.02 0.04 0.05 1/497 11947 | ||
1645 | Mode: 444 | ||
1646 | # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||
1623 | Path: fixtures/proc/mdstat | 1647 | Path: fixtures/proc/mdstat |
1624 | Lines: 56 | 1648 | Lines: 56 |
1625 | Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10] | 1649 | Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10] |
@@ -1827,8 +1851,14 @@ FRAG6: inuse 0 memory 0 | |||
1827 | Mode: 444 | 1851 | Mode: 444 |
1828 | # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | 1852 | # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
1829 | Path: fixtures/proc/net/softnet_stat | 1853 | Path: fixtures/proc/net/softnet_stat |
1830 | Lines: 1 | 1854 | Lines: 2 |
1831 | 00015c73 00020e76 F0000769 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 | 1855 | 00015c73 00020e76 F0000769 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 |
1856 | 01663fb2 00000000 000109a4 00000000 00000000 00000000 00000000 00000000 00000000 | ||
1857 | Mode: 644 | ||
1858 | # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||
1859 | Path: fixtures/proc/net/softnet_stat.broken | ||
1860 | Lines: 1 | ||
1861 | 00015c73 00020e76 F0000769 00000000 | ||
1832 | Mode: 644 | 1862 | Mode: 644 |
1833 | # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | 1863 | # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
1834 | Path: fixtures/proc/net/udp | 1864 | Path: fixtures/proc/net/udp |
diff --git a/vendor/github.com/prometheus/procfs/go.mod b/vendor/github.com/prometheus/procfs/go.mod index 0e04e5d..ded4825 100644 --- a/vendor/github.com/prometheus/procfs/go.mod +++ b/vendor/github.com/prometheus/procfs/go.mod | |||
@@ -5,4 +5,5 @@ go 1.12 | |||
5 | require ( | 5 | require ( |
6 | github.com/google/go-cmp v0.3.1 | 6 | github.com/google/go-cmp v0.3.1 |
7 | golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e | 7 | golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e |
8 | golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e | ||
8 | ) | 9 | ) |
diff --git a/vendor/github.com/prometheus/procfs/go.sum b/vendor/github.com/prometheus/procfs/go.sum index 33b824b..54b5f33 100644 --- a/vendor/github.com/prometheus/procfs/go.sum +++ b/vendor/github.com/prometheus/procfs/go.sum | |||
@@ -2,3 +2,5 @@ github.com/google/go-cmp v0.3.1 h1:Xye71clBPdm5HgqGwUkwhbynsUJZhDbS20FvLhQ2izg= | |||
2 | github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= | 2 | github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= |
3 | golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e h1:vcxGaoTs7kV8m5Np9uUNQin4BrLOthgV7252N8V+FwY= | 3 | golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e h1:vcxGaoTs7kV8m5Np9uUNQin4BrLOthgV7252N8V+FwY= |
4 | golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= | 4 | golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= |
5 | golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e h1:LwyF2AFISC9nVbS6MgzsaQNSUsRXI49GS+YQ5KX/QH0= | ||
6 | golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | ||
diff --git a/vendor/github.com/prometheus/procfs/mountinfo.go b/vendor/github.com/prometheus/procfs/mountinfo.go index bb01bb5..9471136 100644 --- a/vendor/github.com/prometheus/procfs/mountinfo.go +++ b/vendor/github.com/prometheus/procfs/mountinfo.go | |||
@@ -29,10 +29,10 @@ import ( | |||
29 | // is described in the following man page. | 29 | // is described in the following man page. |
30 | // http://man7.org/linux/man-pages/man5/proc.5.html | 30 | // http://man7.org/linux/man-pages/man5/proc.5.html |
31 | type MountInfo struct { | 31 | type MountInfo struct { |
32 | // Unique Id for the mount | 32 | // Unique ID for the mount |
33 | MountId int | 33 | MountID int |
34 | // The Id of the parent mount | 34 | // The ID of the parent mount |
35 | ParentId int | 35 | ParentID int |
36 | // The value of `st_dev` for the files on this FS | 36 | // The value of `st_dev` for the files on this FS |
37 | MajorMinorVer string | 37 | MajorMinorVer string |
38 | // The pathname of the directory in the FS that forms | 38 | // The pathname of the directory in the FS that forms |
@@ -96,11 +96,11 @@ func parseMountInfoString(mountString string) (*MountInfo, error) { | |||
96 | SuperOptions: mountOptionsParser(mountInfo[mountInfoLength-1]), | 96 | SuperOptions: mountOptionsParser(mountInfo[mountInfoLength-1]), |
97 | } | 97 | } |
98 | 98 | ||
99 | mount.MountId, err = strconv.Atoi(mountInfo[0]) | 99 | mount.MountID, err = strconv.Atoi(mountInfo[0]) |
100 | if err != nil { | 100 | if err != nil { |
101 | return nil, fmt.Errorf("failed to parse mount ID") | 101 | return nil, fmt.Errorf("failed to parse mount ID") |
102 | } | 102 | } |
103 | mount.ParentId, err = strconv.Atoi(mountInfo[1]) | 103 | mount.ParentID, err = strconv.Atoi(mountInfo[1]) |
104 | if err != nil { | 104 | if err != nil { |
105 | return nil, fmt.Errorf("failed to parse parent ID") | 105 | return nil, fmt.Errorf("failed to parse parent ID") |
106 | } | 106 | } |
diff --git a/vendor/github.com/prometheus/procfs/net_softnet.go b/vendor/github.com/prometheus/procfs/net_softnet.go index 2a65cf1..db5debd 100644 --- a/vendor/github.com/prometheus/procfs/net_softnet.go +++ b/vendor/github.com/prometheus/procfs/net_softnet.go | |||
@@ -25,7 +25,9 @@ import ( | |||
25 | ) | 25 | ) |
26 | 26 | ||
27 | // For the proc file format details, | 27 | // For the proc file format details, |
28 | // see https://elixir.bootlin.com/linux/v4.17/source/net/core/net-procfs.c#L162 | 28 | // See: |
29 | // * Linux 2.6.23 https://elixir.bootlin.com/linux/v2.6.23/source/net/core/dev.c#L2343 | ||
30 | // * Linux 4.17 https://elixir.bootlin.com/linux/v4.17/source/net/core/net-procfs.c#L162 | ||
29 | // and https://elixir.bootlin.com/linux/v4.17/source/include/linux/netdevice.h#L2810. | 31 | // and https://elixir.bootlin.com/linux/v4.17/source/include/linux/netdevice.h#L2810. |
30 | 32 | ||
31 | // SoftnetStat contains a single row of data from /proc/net/softnet_stat | 33 | // SoftnetStat contains a single row of data from /proc/net/softnet_stat |
@@ -38,9 +40,11 @@ type SoftnetStat struct { | |||
38 | TimeSqueezed uint32 | 40 | TimeSqueezed uint32 |
39 | } | 41 | } |
40 | 42 | ||
43 | var softNetProcFile = "net/softnet_stat" | ||
44 | |||
41 | // NetSoftnetStat reads data from /proc/net/softnet_stat. | 45 | // NetSoftnetStat reads data from /proc/net/softnet_stat. |
42 | func (fs FS) NetSoftnetStat() ([]SoftnetStat, error) { | 46 | func (fs FS) NetSoftnetStat() ([]SoftnetStat, error) { |
43 | b, err := util.ReadFileNoStat(fs.proc.Path("net/softnet_stat")) | 47 | b, err := util.ReadFileNoStat(fs.proc.Path(softNetProcFile)) |
44 | if err != nil { | 48 | if err != nil { |
45 | return nil, err | 49 | return nil, err |
46 | } | 50 | } |
@@ -54,7 +58,7 @@ func (fs FS) NetSoftnetStat() ([]SoftnetStat, error) { | |||
54 | } | 58 | } |
55 | 59 | ||
56 | func parseSoftnet(r io.Reader) ([]SoftnetStat, error) { | 60 | func parseSoftnet(r io.Reader) ([]SoftnetStat, error) { |
57 | const expectedColumns = 11 | 61 | const minColumns = 9 |
58 | 62 | ||
59 | s := bufio.NewScanner(r) | 63 | s := bufio.NewScanner(r) |
60 | 64 | ||
@@ -63,8 +67,8 @@ func parseSoftnet(r io.Reader) ([]SoftnetStat, error) { | |||
63 | columns := strings.Fields(s.Text()) | 67 | columns := strings.Fields(s.Text()) |
64 | width := len(columns) | 68 | width := len(columns) |
65 | 69 | ||
66 | if width != 11 { | 70 | if width < minColumns { |
67 | return nil, fmt.Errorf("%d columns were detected, but %d were expected", width, expectedColumns) | 71 | return nil, fmt.Errorf("%d columns were detected, but at least %d were expected", width, minColumns) |
68 | } | 72 | } |
69 | 73 | ||
70 | // We only parse the first three columns at the moment. | 74 | // We only parse the first three columns at the moment. |
diff --git a/vendor/github.com/prometheus/procfs/proc_fdinfo.go b/vendor/github.com/prometheus/procfs/proc_fdinfo.go index 4e7597f..0c9c402 100644 --- a/vendor/github.com/prometheus/procfs/proc_fdinfo.go +++ b/vendor/github.com/prometheus/procfs/proc_fdinfo.go | |||
@@ -16,6 +16,7 @@ package procfs | |||
16 | import ( | 16 | import ( |
17 | "bufio" | 17 | "bufio" |
18 | "bytes" | 18 | "bytes" |
19 | "errors" | ||
19 | "regexp" | 20 | "regexp" |
20 | 21 | ||
21 | "github.com/prometheus/procfs/internal/util" | 22 | "github.com/prometheus/procfs/internal/util" |
@@ -23,10 +24,11 @@ import ( | |||
23 | 24 | ||
24 | // Regexp variables | 25 | // Regexp variables |
25 | var ( | 26 | var ( |
26 | rPos = regexp.MustCompile(`^pos:\s+(\d+)$`) | 27 | rPos = regexp.MustCompile(`^pos:\s+(\d+)$`) |
27 | rFlags = regexp.MustCompile(`^flags:\s+(\d+)$`) | 28 | rFlags = regexp.MustCompile(`^flags:\s+(\d+)$`) |
28 | rMntID = regexp.MustCompile(`^mnt_id:\s+(\d+)$`) | 29 | rMntID = regexp.MustCompile(`^mnt_id:\s+(\d+)$`) |
29 | rInotify = regexp.MustCompile(`^inotify`) | 30 | rInotify = regexp.MustCompile(`^inotify`) |
31 | rInotifyParts = regexp.MustCompile(`^inotify\s+wd:([0-9a-f]+)\s+ino:([0-9a-f]+)\s+sdev:([0-9a-f]+)(?:\s+mask:([0-9a-f]+))?`) | ||
30 | ) | 32 | ) |
31 | 33 | ||
32 | // ProcFDInfo contains represents file descriptor information. | 34 | // ProcFDInfo contains represents file descriptor information. |
@@ -96,15 +98,21 @@ type InotifyInfo struct { | |||
96 | 98 | ||
97 | // InotifyInfo constructor. Only available on kernel 3.8+. | 99 | // InotifyInfo constructor. Only available on kernel 3.8+. |
98 | func parseInotifyInfo(line string) (*InotifyInfo, error) { | 100 | func parseInotifyInfo(line string) (*InotifyInfo, error) { |
99 | r := regexp.MustCompile(`^inotify\s+wd:([0-9a-f]+)\s+ino:([0-9a-f]+)\s+sdev:([0-9a-f]+)\s+mask:([0-9a-f]+)`) | 101 | m := rInotifyParts.FindStringSubmatch(line) |
100 | m := r.FindStringSubmatch(line) | 102 | if len(m) >= 4 { |
101 | i := &InotifyInfo{ | 103 | var mask string |
102 | WD: m[1], | 104 | if len(m) == 5 { |
103 | Ino: m[2], | 105 | mask = m[4] |
104 | Sdev: m[3], | 106 | } |
105 | Mask: m[4], | 107 | i := &InotifyInfo{ |
108 | WD: m[1], | ||
109 | Ino: m[2], | ||
110 | Sdev: m[3], | ||
111 | Mask: mask, | ||
112 | } | ||
113 | return i, nil | ||
106 | } | 114 | } |
107 | return i, nil | 115 | return nil, errors.New("invalid inode entry: " + line) |
108 | } | 116 | } |
109 | 117 | ||
110 | // ProcFDInfos represents a list of ProcFDInfo structs. | 118 | // ProcFDInfos represents a list of ProcFDInfo structs. |
diff --git a/vendor/github.com/prometheus/procfs/proc_maps.go b/vendor/github.com/prometheus/procfs/proc_maps.go new file mode 100644 index 0000000..28d5c6e --- /dev/null +++ b/vendor/github.com/prometheus/procfs/proc_maps.go | |||
@@ -0,0 +1,208 @@ | |||
1 | // Copyright 2019 The Prometheus Authors | ||
2 | // Licensed under the Apache License, Version 2.0 (the "License"); | ||
3 | // you may not use this file except in compliance with the License. | ||
4 | // You may obtain a copy of the License at | ||
5 | // | ||
6 | // http://www.apache.org/licenses/LICENSE-2.0 | ||
7 | // | ||
8 | // Unless required by applicable law or agreed to in writing, software | ||
9 | // distributed under the License is distributed on an "AS IS" BASIS, | ||
10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
11 | // See the License for the specific language governing permissions and | ||
12 | // limitations under the License. | ||
13 | |||
14 | // +build !windows | ||
15 | |||
16 | package procfs | ||
17 | |||
18 | import ( | ||
19 | "bufio" | ||
20 | "fmt" | ||
21 | "os" | ||
22 | "strconv" | ||
23 | "strings" | ||
24 | |||
25 | "golang.org/x/sys/unix" | ||
26 | ) | ||
27 | |||
28 | type ProcMapPermissions struct { | ||
29 | // mapping has the [R]ead flag set | ||
30 | Read bool | ||
31 | // mapping has the [W]rite flag set | ||
32 | Write bool | ||
33 | // mapping has the [X]ecutable flag set | ||
34 | Execute bool | ||
35 | // mapping has the [S]hared flag set | ||
36 | Shared bool | ||
37 | // mapping is marked as [P]rivate (copy on write) | ||
38 | Private bool | ||
39 | } | ||
40 | |||
41 | // ProcMap contains the process memory-mappings of the process, | ||
42 | // read from /proc/[pid]/maps | ||
43 | type ProcMap struct { | ||
44 | // The start address of current mapping. | ||
45 | StartAddr uintptr | ||
46 | // The end address of the current mapping | ||
47 | EndAddr uintptr | ||
48 | // The permissions for this mapping | ||
49 | Perms *ProcMapPermissions | ||
50 | // The current offset into the file/fd (e.g., shared libs) | ||
51 | Offset int64 | ||
52 | // Device owner of this mapping (major:minor) in Mkdev format. | ||
53 | Dev uint64 | ||
54 | // The inode of the device above | ||
55 | Inode uint64 | ||
56 | // The file or psuedofile (or empty==anonymous) | ||
57 | Pathname string | ||
58 | } | ||
59 | |||
60 | // parseDevice parses the device token of a line and converts it to a dev_t | ||
61 | // (mkdev) like structure. | ||
62 | func parseDevice(s string) (uint64, error) { | ||
63 | toks := strings.Split(s, ":") | ||
64 | if len(toks) < 2 { | ||
65 | return 0, fmt.Errorf("unexpected number of fields") | ||
66 | } | ||
67 | |||
68 | major, err := strconv.ParseUint(toks[0], 16, 0) | ||
69 | if err != nil { | ||
70 | return 0, err | ||
71 | } | ||
72 | |||
73 | minor, err := strconv.ParseUint(toks[1], 16, 0) | ||
74 | if err != nil { | ||
75 | return 0, err | ||
76 | } | ||
77 | |||
78 | return unix.Mkdev(uint32(major), uint32(minor)), nil | ||
79 | } | ||
80 | |||
81 | // parseAddress just converts a hex-string to a uintptr | ||
82 | func parseAddress(s string) (uintptr, error) { | ||
83 | a, err := strconv.ParseUint(s, 16, 0) | ||
84 | if err != nil { | ||
85 | return 0, err | ||
86 | } | ||
87 | |||
88 | return uintptr(a), nil | ||
89 | } | ||
90 | |||
91 | // parseAddresses parses the start-end address | ||
92 | func parseAddresses(s string) (uintptr, uintptr, error) { | ||
93 | toks := strings.Split(s, "-") | ||
94 | if len(toks) < 2 { | ||
95 | return 0, 0, fmt.Errorf("invalid address") | ||
96 | } | ||
97 | |||
98 | saddr, err := parseAddress(toks[0]) | ||
99 | if err != nil { | ||
100 | return 0, 0, err | ||
101 | } | ||
102 | |||
103 | eaddr, err := parseAddress(toks[1]) | ||
104 | if err != nil { | ||
105 | return 0, 0, err | ||
106 | } | ||
107 | |||
108 | return saddr, eaddr, nil | ||
109 | } | ||
110 | |||
111 | // parsePermissions parses a token and returns any that are set. | ||
112 | func parsePermissions(s string) (*ProcMapPermissions, error) { | ||
113 | if len(s) < 4 { | ||
114 | return nil, fmt.Errorf("invalid permissions token") | ||
115 | } | ||
116 | |||
117 | perms := ProcMapPermissions{} | ||
118 | for _, ch := range s { | ||
119 | switch ch { | ||
120 | case 'r': | ||
121 | perms.Read = true | ||
122 | case 'w': | ||
123 | perms.Write = true | ||
124 | case 'x': | ||
125 | perms.Execute = true | ||
126 | case 'p': | ||
127 | perms.Private = true | ||
128 | case 's': | ||
129 | perms.Shared = true | ||
130 | } | ||
131 | } | ||
132 | |||
133 | return &perms, nil | ||
134 | } | ||
135 | |||
136 | // parseProcMap will attempt to parse a single line within a proc/[pid]/maps | ||
137 | // buffer. | ||
138 | func parseProcMap(text string) (*ProcMap, error) { | ||
139 | fields := strings.Fields(text) | ||
140 | if len(fields) < 5 { | ||
141 | return nil, fmt.Errorf("truncated procmap entry") | ||
142 | } | ||
143 | |||
144 | saddr, eaddr, err := parseAddresses(fields[0]) | ||
145 | if err != nil { | ||
146 | return nil, err | ||
147 | } | ||
148 | |||
149 | perms, err := parsePermissions(fields[1]) | ||
150 | if err != nil { | ||
151 | return nil, err | ||
152 | } | ||
153 | |||
154 | offset, err := strconv.ParseInt(fields[2], 16, 0) | ||
155 | if err != nil { | ||
156 | return nil, err | ||
157 | } | ||
158 | |||
159 | device, err := parseDevice(fields[3]) | ||
160 | if err != nil { | ||
161 | return nil, err | ||
162 | } | ||
163 | |||
164 | inode, err := strconv.ParseUint(fields[4], 10, 0) | ||
165 | if err != nil { | ||
166 | return nil, err | ||
167 | } | ||
168 | |||
169 | pathname := "" | ||
170 | |||
171 | if len(fields) >= 5 { | ||
172 | pathname = strings.Join(fields[5:], " ") | ||
173 | } | ||
174 | |||
175 | return &ProcMap{ | ||
176 | StartAddr: saddr, | ||
177 | EndAddr: eaddr, | ||
178 | Perms: perms, | ||
179 | Offset: offset, | ||
180 | Dev: device, | ||
181 | Inode: inode, | ||
182 | Pathname: pathname, | ||
183 | }, nil | ||
184 | } | ||
185 | |||
186 | // ProcMaps reads from /proc/[pid]/maps to get the memory-mappings of the | ||
187 | // process. | ||
188 | func (p Proc) ProcMaps() ([]*ProcMap, error) { | ||
189 | file, err := os.Open(p.path("maps")) | ||
190 | if err != nil { | ||
191 | return nil, err | ||
192 | } | ||
193 | defer file.Close() | ||
194 | |||
195 | maps := []*ProcMap{} | ||
196 | scan := bufio.NewScanner(file) | ||
197 | |||
198 | for scan.Scan() { | ||
199 | m, err := parseProcMap(scan.Text()) | ||
200 | if err != nil { | ||
201 | return nil, err | ||
202 | } | ||
203 | |||
204 | maps = append(maps, m) | ||
205 | } | ||
206 | |||
207 | return maps, nil | ||
208 | } | ||
diff --git a/vendor/github.com/prometheus/procfs/proc_status.go b/vendor/github.com/prometheus/procfs/proc_status.go index 17b4516..c58346d 100644 --- a/vendor/github.com/prometheus/procfs/proc_status.go +++ b/vendor/github.com/prometheus/procfs/proc_status.go | |||
@@ -33,37 +33,37 @@ type ProcStatus struct { | |||
33 | TGID int | 33 | TGID int |
34 | 34 | ||
35 | // Peak virtual memory size. | 35 | // Peak virtual memory size. |
36 | VmPeak uint64 | 36 | VmPeak uint64 // nolint:golint |
37 | // Virtual memory size. | 37 | // Virtual memory size. |
38 | VmSize uint64 | 38 | VmSize uint64 // nolint:golint |
39 | // Locked memory size. | 39 | // Locked memory size. |
40 | VmLck uint64 | 40 | VmLck uint64 // nolint:golint |
41 | // Pinned memory size. | 41 | // Pinned memory size. |
42 | VmPin uint64 | 42 | VmPin uint64 // nolint:golint |
43 | // Peak resident set size. | 43 | // Peak resident set size. |
44 | VmHWM uint64 | 44 | VmHWM uint64 // nolint:golint |
45 | // Resident set size (sum of RssAnnon RssFile and RssShmem). | 45 | // Resident set size (sum of RssAnnon RssFile and RssShmem). |
46 | VmRSS uint64 | 46 | VmRSS uint64 // nolint:golint |
47 | // Size of resident anonymous memory. | 47 | // Size of resident anonymous memory. |
48 | RssAnon uint64 | 48 | RssAnon uint64 // nolint:golint |
49 | // Size of resident file mappings. | 49 | // Size of resident file mappings. |
50 | RssFile uint64 | 50 | RssFile uint64 // nolint:golint |
51 | // Size of resident shared memory. | 51 | // Size of resident shared memory. |
52 | RssShmem uint64 | 52 | RssShmem uint64 // nolint:golint |
53 | // Size of data segments. | 53 | // Size of data segments. |
54 | VmData uint64 | 54 | VmData uint64 // nolint:golint |
55 | // Size of stack segments. | 55 | // Size of stack segments. |
56 | VmStk uint64 | 56 | VmStk uint64 // nolint:golint |
57 | // Size of text segments. | 57 | // Size of text segments. |
58 | VmExe uint64 | 58 | VmExe uint64 // nolint:golint |
59 | // Shared library code size. | 59 | // Shared library code size. |
60 | VmLib uint64 | 60 | VmLib uint64 // nolint:golint |
61 | // Page table entries size. | 61 | // Page table entries size. |
62 | VmPTE uint64 | 62 | VmPTE uint64 // nolint:golint |
63 | // Size of second-level page tables. | 63 | // Size of second-level page tables. |
64 | VmPMD uint64 | 64 | VmPMD uint64 // nolint:golint |
65 | // Swapped-out virtual memory size by anonymous private. | 65 | // Swapped-out virtual memory size by anonymous private. |
66 | VmSwap uint64 | 66 | VmSwap uint64 // nolint:golint |
67 | // Size of hugetlb memory portions | 67 | // Size of hugetlb memory portions |
68 | HugetlbPages uint64 | 68 | HugetlbPages uint64 |
69 | 69 | ||
diff --git a/vendor/github.com/prometheus/procfs/sysfs/class_infiniband.go b/vendor/github.com/prometheus/procfs/sysfs/class_infiniband.go index 0eab1eb..be900fa 100644 --- a/vendor/github.com/prometheus/procfs/sysfs/class_infiniband.go +++ b/vendor/github.com/prometheus/procfs/sysfs/class_infiniband.go | |||
@@ -251,7 +251,7 @@ func parseInfiniBandCounters(portPath string) (*InfiniBandCounters, error) { | |||
251 | name := filepath.Join(path, f.Name()) | 251 | name := filepath.Join(path, f.Name()) |
252 | value, err := util.SysReadFile(name) | 252 | value, err := util.SysReadFile(name) |
253 | if err != nil { | 253 | if err != nil { |
254 | if os.IsNotExist(err) || err.Error() == "operation not supported" || err.Error() == "invalid argument" { | 254 | if os.IsNotExist(err) || os.IsPermission(err) || err.Error() == "operation not supported" || err.Error() == "invalid argument" { |
255 | continue | 255 | continue |
256 | } | 256 | } |
257 | return nil, fmt.Errorf("failed to read file %q: %v", name, err) | 257 | return nil, fmt.Errorf("failed to read file %q: %v", name, err) |
@@ -334,7 +334,7 @@ func parseInfiniBandCounters(portPath string) (*InfiniBandCounters, error) { | |||
334 | name := filepath.Join(path, f.Name()) | 334 | name := filepath.Join(path, f.Name()) |
335 | value, err := util.SysReadFile(name) | 335 | value, err := util.SysReadFile(name) |
336 | if err != nil { | 336 | if err != nil { |
337 | if os.IsNotExist(err) || err.Error() == "operation not supported" || err.Error() == "invalid argument" { | 337 | if os.IsNotExist(err) || os.IsPermission(err) || err.Error() == "operation not supported" || err.Error() == "invalid argument" { |
338 | continue | 338 | continue |
339 | } | 339 | } |
340 | return nil, fmt.Errorf("failed to read file %q: %v", name, err) | 340 | return nil, fmt.Errorf("failed to read file %q: %v", name, err) |
diff --git a/vendor/github.com/prometheus/procfs/sysfs/net_class.go b/vendor/github.com/prometheus/procfs/sysfs/net_class.go index 9aa6b57..8f64987 100644 --- a/vendor/github.com/prometheus/procfs/sysfs/net_class.go +++ b/vendor/github.com/prometheus/procfs/sysfs/net_class.go | |||
@@ -119,7 +119,7 @@ func (nc NetClass) parseNetClassIface(devicePath string) (*NetClassIface, error) | |||
119 | name := filepath.Join(devicePath, f.Name()) | 119 | name := filepath.Join(devicePath, f.Name()) |
120 | value, err := util.SysReadFile(name) | 120 | value, err := util.SysReadFile(name) |
121 | if err != nil { | 121 | if err != nil { |
122 | if os.IsNotExist(err) || err.Error() == "operation not supported" || err.Error() == "invalid argument" { | 122 | if os.IsNotExist(err) || os.IsPermission(err) || err.Error() == "operation not supported" || err.Error() == "invalid argument" { |
123 | continue | 123 | continue |
124 | } | 124 | } |
125 | return nil, fmt.Errorf("failed to read file %q: %v", name, err) | 125 | return nil, fmt.Errorf("failed to read file %q: %v", name, err) |
diff --git a/vendor/modules.txt b/vendor/modules.txt index 9b77b1a..033b85a 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt | |||
@@ -59,7 +59,7 @@ github.com/prometheus/common/model | |||
59 | github.com/prometheus/common/promlog | 59 | github.com/prometheus/common/promlog |
60 | github.com/prometheus/common/promlog/flag | 60 | github.com/prometheus/common/promlog/flag |
61 | github.com/prometheus/common/version | 61 | github.com/prometheus/common/version |
62 | # github.com/prometheus/procfs v0.0.10 | 62 | # github.com/prometheus/procfs v0.0.11 |
63 | github.com/prometheus/procfs | 63 | github.com/prometheus/procfs |
64 | github.com/prometheus/procfs/bcache | 64 | github.com/prometheus/procfs/bcache |
65 | github.com/prometheus/procfs/btrfs | 65 | github.com/prometheus/procfs/btrfs |