aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--go.mod3
-rw-r--r--go.sum10
-rw-r--r--vendor/github.com/prometheus/procfs/CONTRIBUTING.md109
-rw-r--r--vendor/github.com/prometheus/procfs/README.md16
-rw-r--r--vendor/github.com/prometheus/procfs/cpuinfo.go5
-rw-r--r--vendor/github.com/prometheus/procfs/fixtures.ttar749
-rw-r--r--vendor/github.com/prometheus/procfs/go.mod6
-rw-r--r--vendor/github.com/prometheus/procfs/go.sum8
-rw-r--r--vendor/github.com/prometheus/procfs/internal/fs/fs.go2
-rw-r--r--vendor/github.com/prometheus/procfs/internal/util/readfile.go38
-rw-r--r--vendor/github.com/prometheus/procfs/internal/util/sysreadfile.go5
-rw-r--r--vendor/github.com/prometheus/procfs/ipvs.go12
-rw-r--r--vendor/github.com/prometheus/procfs/meminfo.go453
-rw-r--r--vendor/github.com/prometheus/procfs/mountinfo.go114
-rw-r--r--vendor/github.com/prometheus/procfs/net_dev.go1
-rw-r--r--vendor/github.com/prometheus/procfs/proc.go23
-rw-r--r--vendor/github.com/prometheus/procfs/proc_environ.go12
-rw-r--r--vendor/github.com/prometheus/procfs/proc_fdinfo.go17
-rw-r--r--vendor/github.com/prometheus/procfs/proc_io.go12
-rw-r--r--vendor/github.com/prometheus/procfs/proc_psi.go21
-rw-r--r--vendor/github.com/prometheus/procfs/proc_stat.go10
-rw-r--r--vendor/github.com/prometheus/procfs/proc_status.go12
-rw-r--r--vendor/github.com/prometheus/procfs/stat.go12
-rw-r--r--vendor/github.com/prometheus/procfs/sysfs/class_powercap.go112
-rw-r--r--vendor/modules.txt4
25 files changed, 1595 insertions, 171 deletions
diff --git a/go.mod b/go.mod
index c1a58fb..3fc7629 100644
--- a/go.mod
+++ b/go.mod
@@ -15,12 +15,11 @@ require (
15 github.com/prometheus/client_golang v1.0.0 15 github.com/prometheus/client_golang v1.0.0
16 github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90 16 github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90
17 github.com/prometheus/common v0.7.0 17 github.com/prometheus/common v0.7.0
18 github.com/prometheus/procfs v0.0.5 18 github.com/prometheus/procfs v0.0.7
19 github.com/siebenmann/go-kstat v0.0.0-20160321171754-d34789b79745 19 github.com/siebenmann/go-kstat v0.0.0-20160321171754-d34789b79745
20 github.com/soundcloud/go-runit v0.0.0-20150630195641-06ad41a06c4a 20 github.com/soundcloud/go-runit v0.0.0-20150630195641-06ad41a06c4a
21 go.uber.org/atomic v1.3.2 // indirect 21 go.uber.org/atomic v1.3.2 // indirect
22 go.uber.org/multierr v1.1.0 // indirect 22 go.uber.org/multierr v1.1.0 // indirect
23 golang.org/x/sync v0.0.0-20190423024810-112230192c58 // indirect
24 golang.org/x/sys v0.0.0-20190902133755-9109b7679e13 23 golang.org/x/sys v0.0.0-20190902133755-9109b7679e13
25 gopkg.in/alecthomas/kingpin.v2 v2.2.6 24 gopkg.in/alecthomas/kingpin.v2 v2.2.6
26 gopkg.in/yaml.v2 v2.2.2 25 gopkg.in/yaml.v2 v2.2.2
diff --git a/go.sum b/go.sum
index 9d615c6..c111807 100644
--- a/go.sum
+++ b/go.sum
@@ -35,8 +35,6 @@ github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5y
35github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs= 35github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs=
36github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= 36github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
37github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= 37github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
38github.com/google/go-cmp v0.3.0 h1:crn/baboCvb5fXaQ0IJ1SGTsTVrWpDsCWC8EGETZijY=
39github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
40github.com/google/go-cmp v0.3.1 h1:Xye71clBPdm5HgqGwUkwhbynsUJZhDbS20FvLhQ2izg= 38github.com/google/go-cmp v0.3.1 h1:Xye71clBPdm5HgqGwUkwhbynsUJZhDbS20FvLhQ2izg=
41github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= 39github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
42github.com/hodgesds/perf-utils v0.0.7 h1:V/5aRKeXn/membOpFdzAgd+fFvmtvTYD6moDuZ7K7SM= 40github.com/hodgesds/perf-utils v0.0.7 h1:V/5aRKeXn/membOpFdzAgd+fFvmtvTYD6moDuZ7K7SM=
@@ -87,8 +85,8 @@ github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt2
87github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= 85github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
88github.com/prometheus/procfs v0.0.2 h1:6LJUbpNm42llc4HRCuvApCSWB/WfhuNo9K98Q9sNGfs= 86github.com/prometheus/procfs v0.0.2 h1:6LJUbpNm42llc4HRCuvApCSWB/WfhuNo9K98Q9sNGfs=
89github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= 87github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
90github.com/prometheus/procfs v0.0.5 h1:3+auTFlqw+ZaQYJARz6ArODtkaIwtvBTx3N2NehQlL8= 88github.com/prometheus/procfs v0.0.7 h1:RS5GAlMbnkWkhs4+bPocMTmGjYkuCY5djjqEDdXOhcQ=
91github.com/prometheus/procfs v0.0.5/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ= 89github.com/prometheus/procfs v0.0.7/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A=
92github.com/siebenmann/go-kstat v0.0.0-20160321171754-d34789b79745 h1:IuH7WumZNax0D+rEqmy2TyhKCzrtMGqbZO0b8rO00JA= 90github.com/siebenmann/go-kstat v0.0.0-20160321171754-d34789b79745 h1:IuH7WumZNax0D+rEqmy2TyhKCzrtMGqbZO0b8rO00JA=
93github.com/siebenmann/go-kstat v0.0.0-20160321171754-d34789b79745/go.mod h1:G81aIFAMS9ECrwBYR9YxhlPjWgrItd+Kje78O6+uqm8= 91github.com/siebenmann/go-kstat v0.0.0-20160321171754-d34789b79745/go.mod h1:G81aIFAMS9ECrwBYR9YxhlPjWgrItd+Kje78O6+uqm8=
94github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= 92github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
@@ -117,8 +115,8 @@ golang.org/x/sync v0.0.0-20181108010431-42b317875d0f h1:Bl/8QSvNqXvPGPGXa2z5xUTm
117golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 115golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
118golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 h1:YUO/7uOKsKeq9UokNS62b8FYywz3ker1l1vDZRCRefw= 116golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 h1:YUO/7uOKsKeq9UokNS62b8FYywz3ker1l1vDZRCRefw=
119golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 117golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
120golang.org/x/sync v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU= 118golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e h1:vcxGaoTs7kV8m5Np9uUNQin4BrLOthgV7252N8V+FwY=
121golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 119golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
122golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 120golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
123golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 121golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
124golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 122golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
diff --git a/vendor/github.com/prometheus/procfs/CONTRIBUTING.md b/vendor/github.com/prometheus/procfs/CONTRIBUTING.md
index 40503ed..943de76 100644
--- a/vendor/github.com/prometheus/procfs/CONTRIBUTING.md
+++ b/vendor/github.com/prometheus/procfs/CONTRIBUTING.md
@@ -2,17 +2,120 @@
2 2
3Prometheus uses GitHub to manage reviews of pull requests. 3Prometheus uses GitHub to manage reviews of pull requests.
4 4
5* If you are a new contributor see: [Steps to Contribute](#steps-to-contribute)
6
5* If you have a trivial fix or improvement, go ahead and create a pull request, 7* If you have a trivial fix or improvement, go ahead and create a pull request,
6 addressing (with `@...`) the maintainer of this repository (see 8 addressing (with `@...`) a suitable maintainer of this repository (see
7 [MAINTAINERS.md](MAINTAINERS.md)) in the description of the pull request. 9 [MAINTAINERS.md](MAINTAINERS.md)) in the description of the pull request.
8 10
9* If you plan to do something more involved, first discuss your ideas 11* If you plan to do something more involved, first discuss your ideas
10 on our [mailing list](https://groups.google.com/forum/?fromgroups#!forum/prometheus-developers). 12 on our [mailing list](https://groups.google.com/forum/?fromgroups#!forum/prometheus-developers).
11 This will avoid unnecessary work and surely give you and us a good deal 13 This will avoid unnecessary work and surely give you and us a good deal
12 of inspiration. 14 of inspiration. Also please see our [non-goals issue](https://github.com/prometheus/docs/issues/149) on areas that the Prometheus community doesn't plan to work on.
13 15
14* Relevant coding style guidelines are the [Go Code Review 16* Relevant coding style guidelines are the [Go Code Review
15 Comments](https://code.google.com/p/go-wiki/wiki/CodeReviewComments) 17 Comments](https://code.google.com/p/go-wiki/wiki/CodeReviewComments)
16 and the _Formatting and style_ section of Peter Bourgon's [Go: Best 18 and the _Formatting and style_ section of Peter Bourgon's [Go: Best
17 Practices for Production 19 Practices for Production
18 Environments](http://peter.bourgon.org/go-in-production/#formatting-and-style). 20 Environments](https://peter.bourgon.org/go-in-production/#formatting-and-style).
21
22* Be sure to sign off on the [DCO](https://github.com/probot/dco#how-it-works)
23
24## Steps to Contribute
25
26Should you wish to work on an issue, please claim it first by commenting on the GitHub issue that you want to work on it. This is to prevent duplicated efforts from contributors on the same issue.
27
28Please check the [`help-wanted`](https://github.com/prometheus/procfs/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22) label to find issues that are good for getting started. If you have questions about one of the issues, with or without the tag, please comment on them and one of the maintainers will clarify it. For a quicker response, contact us over [IRC](https://prometheus.io/community).
29
30For quickly compiling and testing your changes do:
31```
32make test # Make sure all the tests pass before you commit and push :)
33```
34
35We use [`golangci-lint`](https://github.com/golangci/golangci-lint) for linting the code. If it reports an issue and you think that the warning needs to be disregarded or is a false-positive, you can add a special comment `//nolint:linter1[,linter2,...]` before the offending line. Use this sparingly though, fixing the code to comply with the linter's recommendation is in general the preferred course of action.
36
37## Pull Request Checklist
38
39* Branch from the master branch and, if needed, rebase to the current master branch before submitting your pull request. If it doesn't merge cleanly with master you may be asked to rebase your changes.
40
41* Commits should be as small as possible, while ensuring that each commit is correct independently (i.e., each commit should compile and pass tests).
42
43* If your patch is not getting reviewed or you need a specific person to review it, you can @-reply a reviewer asking for a review in the pull request or a comment, or you can ask for a review on IRC channel [#prometheus](https://webchat.freenode.net/?channels=#prometheus) on irc.freenode.net (for the easiest start, [join via Riot](https://riot.im/app/#/room/#prometheus:matrix.org)).
44
45* Add tests relevant to the fixed bug or new feature.
46
47## Dependency management
48
49The Prometheus project uses [Go modules](https://golang.org/cmd/go/#hdr-Modules__module_versions__and_more) to manage dependencies on external packages. This requires a working Go environment with version 1.12 or greater installed.
50
51All dependencies are vendored in the `vendor/` directory.
52
53To add or update a new dependency, use the `go get` command:
54
55```bash
56# Pick the latest tagged release.
57go get example.com/some/module/pkg
58
59# Pick a specific version.
60go get example.com/some/module/pkg@vX.Y.Z
61```
62
63Tidy up the `go.mod` and `go.sum` files and copy the new/updated dependency to the `vendor/` directory:
64
65
66```bash
67# The GO111MODULE variable can be omitted when the code isn't located in GOPATH.
68GO111MODULE=on go mod tidy
69
70GO111MODULE=on go mod vendor
71```
72
73You have to commit the changes to `go.mod`, `go.sum` and the `vendor/` directory before submitting the pull request.
74
75
76## API Implementation Guidelines
77
78### Naming and Documentation
79
80Public functions and structs should normally be named according to the file(s) being read and parsed. For example,
81the `fs.BuddyInfo()` function reads the file `/proc/buddyinfo`. In addition, the godoc for each public function
82should contain the path to the file(s) being read and a URL of the linux kernel documentation describing the file(s).
83
84### Reading vs. Parsing
85
86Most functionality in this library consists of reading files and then parsing the text into structured data. In most
87cases reading and parsing should be separated into different functions/methods with a public `fs.Thing()` method and
88a private `parseThing(r Reader)` function. This provides a logical separation and allows parsing to be tested
89directly without the need to read from the filesystem. Using a `Reader` argument is preferred over other data types
90such as `string` or `*File` because it provides the most flexibility regarding the data source. When a set of files
91in a directory needs to be parsed, then a `path` string parameter to the parse function can be used instead.
92
93### /proc and /sys filesystem I/O
94
95The `proc` and `sys` filesystems are pseudo file systems and work a bit differently from standard disk I/O.
96Many of the files are changing continuously and the data being read can in some cases change between subsequent
97reads in the same file. Also, most of the files are relatively small (less than a few KBs), and system calls
98to the `stat` function will often return the wrong size. Therefore, for most files it's recommended to read the
99full file in a single operation using an internal utility function called `util.ReadFileNoStat`.
100This function is similar to `ioutil.ReadFile`, but it avoids the system call to `stat` to get the current size of
101the file.
102
103Note that parsing the file's contents can still be performed one line at a time. This is done by first reading
104the full file, and then using a scanner on the `[]byte` or `string` containing the data.
105
106```
107 data, err := util.ReadFileNoStat("/proc/cpuinfo")
108 if err != nil {
109 return err
110 }
111 reader := bytes.NewReader(data)
112 scanner := bufio.NewScanner(reader)
113```
114
115The `/sys` filesystem contains many very small files which contain only a single numeric or text value. These files
116can be read using an internal function called `util.SysReadFile` which is similar to `ioutil.ReadFile` but does
117not bother to check the size of the file before reading.
118```
119 data, err := util.SysReadFile("/sys/class/power_supply/BAT0/capacity")
120```
121
diff --git a/vendor/github.com/prometheus/procfs/README.md b/vendor/github.com/prometheus/procfs/README.md
index 6f8850f..55d1e32 100644
--- a/vendor/github.com/prometheus/procfs/README.md
+++ b/vendor/github.com/prometheus/procfs/README.md
@@ -1,6 +1,6 @@
1# procfs 1# procfs
2 2
3This procfs package provides functions to retrieve system, kernel and process 3This package provides functions to retrieve system, kernel, and process
4metrics from the pseudo-filesystems /proc and /sys. 4metrics from the pseudo-filesystems /proc and /sys.
5 5
6*WARNING*: This package is a work in progress. Its API may still break in 6*WARNING*: This package is a work in progress. Its API may still break in
@@ -13,7 +13,8 @@ backwards-incompatible ways without warnings. Use it at your own risk.
13## Usage 13## Usage
14 14
15The procfs library is organized by packages based on whether the gathered data is coming from 15The procfs library is organized by packages based on whether the gathered data is coming from
16/proc, /sys, or both. Each package contains an `FS` type which represents the path to either /proc, /sys, or both. For example, current cpu statistics are gathered from 16/proc, /sys, or both. Each package contains an `FS` type which represents the path to either /proc,
17/sys, or both. For example, cpu statistics are gathered from
17`/proc/stat` and are available via the root procfs package. First, the proc filesystem mount 18`/proc/stat` and are available via the root procfs package. First, the proc filesystem mount
18point is initialized, and then the stat information is read. 19point is initialized, and then the stat information is read.
19 20
@@ -29,10 +30,17 @@ Some sub-packages such as `blockdevice`, require access to both the proc and sys
29 stats, err := fs.ProcDiskstats() 30 stats, err := fs.ProcDiskstats()
30``` 31```
31 32
33## Package Organization
34
35The packages in this project are organized according to (1) whether the data comes from the `/proc` or
36`/sys` filesystem and (2) the type of information being retrieved. For example, most process information
37can be gathered from the functions in the root `procfs` package. Information about block devices such as disk drives
38is available in the `blockdevices` sub-package.
39
32## Building and Testing 40## Building and Testing
33 41
34The procfs library is normally built as part of another application. However, when making 42The procfs library is intended to be built as part of another application, so there are no distributable binaries.
35changes to the library, the `make test` command can be used to run the API test suite. 43However, most of the API includes unit tests which can be run with `make test`.
36 44
37### Updating Test Fixtures 45### Updating Test Fixtures
38 46
diff --git a/vendor/github.com/prometheus/procfs/cpuinfo.go b/vendor/github.com/prometheus/procfs/cpuinfo.go
index 16491d6..2e02215 100644
--- a/vendor/github.com/prometheus/procfs/cpuinfo.go
+++ b/vendor/github.com/prometheus/procfs/cpuinfo.go
@@ -16,9 +16,10 @@ package procfs
16import ( 16import (
17 "bufio" 17 "bufio"
18 "bytes" 18 "bytes"
19 "io/ioutil"
20 "strconv" 19 "strconv"
21 "strings" 20 "strings"
21
22 "github.com/prometheus/procfs/internal/util"
22) 23)
23 24
24// CPUInfo contains general information about a system CPU found in /proc/cpuinfo 25// CPUInfo contains general information about a system CPU found in /proc/cpuinfo
@@ -54,7 +55,7 @@ type CPUInfo struct {
54// CPUInfo returns information about current system CPUs. 55// CPUInfo returns information about current system CPUs.
55// See https://www.kernel.org/doc/Documentation/filesystems/proc.txt 56// See https://www.kernel.org/doc/Documentation/filesystems/proc.txt
56func (fs FS) CPUInfo() ([]CPUInfo, error) { 57func (fs FS) CPUInfo() ([]CPUInfo, error) {
57 data, err := ioutil.ReadFile(fs.proc.Path("cpuinfo")) 58 data, err := util.ReadFileNoStat(fs.proc.Path("cpuinfo"))
58 if err != nil { 59 if err != nil {
59 return nil, err 60 return nil, err
60 } 61 }
diff --git a/vendor/github.com/prometheus/procfs/fixtures.ttar b/vendor/github.com/prometheus/procfs/fixtures.ttar
index 0b29055..38b71fe 100644
--- a/vendor/github.com/prometheus/procfs/fixtures.ttar
+++ b/vendor/github.com/prometheus/procfs/fixtures.ttar
@@ -1674,6 +1674,52 @@ md101 : active (read-only) raid0 sdb[2] sdd[1] sdc[0]
1674unused devices: <none> 1674unused devices: <none>
1675Mode: 644 1675Mode: 644
1676# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1676# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1677Path: fixtures/proc/meminfo
1678Lines: 42
1679MemTotal: 15666184 kB
1680MemFree: 440324 kB
1681Buffers: 1020128 kB
1682Cached: 12007640 kB
1683SwapCached: 0 kB
1684Active: 6761276 kB
1685Inactive: 6532708 kB
1686Active(anon): 267256 kB
1687Inactive(anon): 268 kB
1688Active(file): 6494020 kB
1689Inactive(file): 6532440 kB
1690Unevictable: 0 kB
1691Mlocked: 0 kB
1692SwapTotal: 0 kB
1693SwapFree: 0 kB
1694Dirty: 768 kB
1695Writeback: 0 kB
1696AnonPages: 266216 kB
1697Mapped: 44204 kB
1698Shmem: 1308 kB
1699Slab: 1807264 kB
1700SReclaimable: 1738124 kB
1701SUnreclaim: 69140 kB
1702KernelStack: 1616 kB
1703PageTables: 5288 kB
1704NFS_Unstable: 0 kB
1705Bounce: 0 kB
1706WritebackTmp: 0 kB
1707CommitLimit: 7833092 kB
1708Committed_AS: 530844 kB
1709VmallocTotal: 34359738367 kB
1710VmallocUsed: 36596 kB
1711VmallocChunk: 34359637840 kB
1712HardwareCorrupted: 0 kB
1713AnonHugePages: 12288 kB
1714HugePages_Total: 0
1715HugePages_Free: 0
1716HugePages_Rsvd: 0
1717HugePages_Surp: 0
1718Hugepagesize: 2048 kB
1719DirectMap4k: 91136 kB
1720DirectMap2M: 16039936 kB
1721Mode: 664
1722# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1677Directory: fixtures/proc/net 1723Directory: fixtures/proc/net
1678Mode: 755 1724Mode: 755
1679# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1725# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@@ -2776,6 +2822,134 @@ SymlinkTo: ../../devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00
2776Path: fixtures/sys/class/power_supply/BAT0 2822Path: fixtures/sys/class/power_supply/BAT0
2777SymlinkTo: ../../devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0 2823SymlinkTo: ../../devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT0
2778# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 2824# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
2825Directory: fixtures/sys/class/powercap
2826Mode: 755
2827# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
2828Directory: fixtures/sys/class/powercap/intel-rapl
2829Mode: 755
2830# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
2831Path: fixtures/sys/class/powercap/intel-rapl/enabled
2832Lines: 1
28331
2834Mode: 644
2835# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
2836Path: fixtures/sys/class/powercap/intel-rapl/uevent
2837Lines: 0
2838Mode: 644
2839# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
2840Directory: fixtures/sys/class/powercap/intel-rapl:0
2841Mode: 755
2842# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
2843Path: fixtures/sys/class/powercap/intel-rapl:0/constraint_0_max_power_uw
2844Lines: 1
284595000000
2846Mode: 444
2847# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
2848Path: fixtures/sys/class/powercap/intel-rapl:0/constraint_0_name
2849Lines: 1
2850long_term
2851Mode: 444
2852# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
2853Path: fixtures/sys/class/powercap/intel-rapl:0/constraint_0_power_limit_uw
2854Lines: 1
28554090000000
2856Mode: 644
2857# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
2858Path: fixtures/sys/class/powercap/intel-rapl:0/constraint_0_time_window_us
2859Lines: 1
2860999424
2861Mode: 644
2862# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
2863Path: fixtures/sys/class/powercap/intel-rapl:0/constraint_1_max_power_uw
2864Lines: 1
28650
2866Mode: 444
2867# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
2868Path: fixtures/sys/class/powercap/intel-rapl:0/constraint_1_name
2869Lines: 1
2870short_term
2871Mode: 444
2872# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
2873Path: fixtures/sys/class/powercap/intel-rapl:0/constraint_1_power_limit_uw
2874Lines: 1
28754090000000
2876Mode: 644
2877# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
2878Path: fixtures/sys/class/powercap/intel-rapl:0/constraint_1_time_window_us
2879Lines: 1
28802440
2881Mode: 644
2882# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
2883Path: fixtures/sys/class/powercap/intel-rapl:0/enabled
2884Lines: 1
28851
2886Mode: 644
2887# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
2888Path: fixtures/sys/class/powercap/intel-rapl:0/energy_uj
2889Lines: 1
2890240422366267
2891Mode: 444
2892# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
2893Path: fixtures/sys/class/powercap/intel-rapl:0/max_energy_range_uj
2894Lines: 1
2895262143328850
2896Mode: 444
2897# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
2898Path: fixtures/sys/class/powercap/intel-rapl:0/name
2899Lines: 1
2900package-0
2901Mode: 444
2902# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
2903Path: fixtures/sys/class/powercap/intel-rapl:0/uevent
2904Lines: 0
2905Mode: 644
2906# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
2907Directory: fixtures/sys/class/powercap/intel-rapl:0:0
2908Mode: 755
2909# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
2910Path: fixtures/sys/class/powercap/intel-rapl:0:0/constraint_0_max_power_uw
2911Lines: 0
2912Mode: 444
2913# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
2914Path: fixtures/sys/class/powercap/intel-rapl:0:0/constraint_0_name
2915Lines: 1
2916long_term
2917Mode: 444
2918# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
2919Path: fixtures/sys/class/powercap/intel-rapl:0:0/constraint_0_power_limit_uw
2920Lines: 1
29210
2922Mode: 644
2923# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
2924Path: fixtures/sys/class/powercap/intel-rapl:0:0/constraint_0_time_window_us
2925Lines: 1
2926976
2927Mode: 644
2928# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
2929Path: fixtures/sys/class/powercap/intel-rapl:0:0/enabled
2930Lines: 1
29310
2932Mode: 644
2933# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
2934Path: fixtures/sys/class/powercap/intel-rapl:0:0/energy_uj
2935Lines: 1
2936118821284256
2937Mode: 444
2938# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
2939Path: fixtures/sys/class/powercap/intel-rapl:0:0/max_energy_range_uj
2940Lines: 1
2941262143328850
2942Mode: 444
2943# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
2944Path: fixtures/sys/class/powercap/intel-rapl:0:0/name
2945Lines: 1
2946core
2947Mode: 444
2948# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
2949Path: fixtures/sys/class/powercap/intel-rapl:0:0/uevent
2950Lines: 0
2951Mode: 644
2952# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
2779Directory: fixtures/sys/class/thermal 2953Directory: fixtures/sys/class/thermal
2780Mode: 775 2954Mode: 775
2781# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 2955# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@@ -4278,6 +4452,581 @@ Lines: 1
42780 44520
4279Mode: 644 4453Mode: 644
4280# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 4454# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4455Directory: fixtures/sys/fs/btrfs
4456Mode: 755
4457# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4458Directory: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d
4459Mode: 755
4460# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4461Directory: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/allocation
4462Mode: 755
4463# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4464Directory: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/allocation/data
4465Mode: 755
4466# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4467Path: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/allocation/data/bytes_may_use
4468Lines: 1
44690
4470Mode: 444
4471# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4472Path: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/allocation/data/bytes_pinned
4473Lines: 1
44740
4475Mode: 444
4476# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4477Path: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/allocation/data/bytes_readonly
4478Lines: 1
44790
4480Mode: 444
4481# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4482Path: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/allocation/data/bytes_reserved
4483Lines: 1
44840
4485Mode: 444
4486# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4487Path: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/allocation/data/bytes_used
4488Lines: 1
4489808189952
4490Mode: 444
4491# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4492Path: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/allocation/data/disk_total
4493Lines: 1
44942147483648
4495Mode: 444
4496# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4497Path: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/allocation/data/disk_used
4498Lines: 1
4499808189952
4500Mode: 444
4501# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4502Path: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/allocation/data/flags
4503Lines: 1
45041
4505Mode: 444
4506# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4507Directory: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/allocation/data/raid0
4508Mode: 755
4509# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4510Path: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/allocation/data/raid0/total_bytes
4511Lines: 1
45122147483648
4513Mode: 444
4514# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4515Path: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/allocation/data/raid0/used_bytes
4516Lines: 1
4517808189952
4518Mode: 444
4519# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4520Path: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/allocation/data/total_bytes
4521Lines: 1
45222147483648
4523Mode: 444
4524# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4525Path: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/allocation/data/total_bytes_pinned
4526Lines: 1
45270
4528Mode: 444
4529# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4530Path: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/allocation/global_rsv_reserved
4531Lines: 1
453216777216
4533Mode: 444
4534# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4535Path: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/allocation/global_rsv_size
4536Lines: 1
453716777216
4538Mode: 444
4539# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4540Directory: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/allocation/metadata
4541Mode: 755
4542# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4543Path: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/allocation/metadata/bytes_may_use
4544Lines: 1
454516777216
4546Mode: 444
4547# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4548Path: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/allocation/metadata/bytes_pinned
4549Lines: 1
45500
4551Mode: 444
4552# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4553Path: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/allocation/metadata/bytes_readonly
4554Lines: 1
4555131072
4556Mode: 444
4557# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4558Path: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/allocation/metadata/bytes_reserved
4559Lines: 1
45600
4561Mode: 444
4562# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4563Path: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/allocation/metadata/bytes_used
4564Lines: 1
4565933888
4566Mode: 444
4567# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4568Path: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/allocation/metadata/disk_total
4569Lines: 1
45702147483648
4571Mode: 444
4572# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4573Path: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/allocation/metadata/disk_used
4574Lines: 1
45751867776
4576Mode: 444
4577# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4578Path: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/allocation/metadata/flags
4579Lines: 1
45804
4581Mode: 444
4582# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4583Directory: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/allocation/metadata/raid1
4584Mode: 755
4585# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4586Path: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/allocation/metadata/raid1/total_bytes
4587Lines: 1
45881073741824
4589Mode: 444
4590# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4591Path: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/allocation/metadata/raid1/used_bytes
4592Lines: 1
4593933888
4594Mode: 444
4595# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4596Path: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/allocation/metadata/total_bytes
4597Lines: 1
45981073741824
4599Mode: 444
4600# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4601Path: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/allocation/metadata/total_bytes_pinned
4602Lines: 1
46030
4604Mode: 444
4605# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4606Directory: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/allocation/system
4607Mode: 755
4608# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4609Path: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/allocation/system/bytes_may_use
4610Lines: 1
46110
4612Mode: 444
4613# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4614Path: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/allocation/system/bytes_pinned
4615Lines: 1
46160
4617Mode: 444
4618# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4619Path: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/allocation/system/bytes_readonly
4620Lines: 1
46210
4622Mode: 444
4623# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4624Path: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/allocation/system/bytes_reserved
4625Lines: 1
46260
4627Mode: 444
4628# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4629Path: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/allocation/system/bytes_used
4630Lines: 1
463116384
4632Mode: 444
4633# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4634Path: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/allocation/system/disk_total
4635Lines: 1
463616777216
4637Mode: 444
4638# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4639Path: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/allocation/system/disk_used
4640Lines: 1
464132768
4642Mode: 444
4643# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4644Path: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/allocation/system/flags
4645Lines: 1
46462
4647Mode: 444
4648# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4649Directory: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/allocation/system/raid1
4650Mode: 755
4651# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4652Path: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/allocation/system/raid1/total_bytes
4653Lines: 1
46548388608
4655Mode: 444
4656# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4657Path: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/allocation/system/raid1/used_bytes
4658Lines: 1
465916384
4660Mode: 444
4661# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4662Path: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/allocation/system/total_bytes
4663Lines: 1
46648388608
4665Mode: 444
4666# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4667Path: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/allocation/system/total_bytes_pinned
4668Lines: 1
46690
4670Mode: 444
4671# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4672Path: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/clone_alignment
4673Lines: 1
46744096
4675Mode: 444
4676# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4677Directory: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/devices
4678Mode: 755
4679# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4680Directory: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/devices/loop25
4681Mode: 755
4682# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4683Path: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/devices/loop25/size
4684Lines: 1
468520971520
4686Mode: 444
4687# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4688Directory: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/devices/loop26
4689Mode: 755
4690# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4691Path: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/devices/loop26/size
4692Lines: 1
469320971520
4694Mode: 444
4695# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4696Directory: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/features
4697Mode: 755
4698# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4699Path: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/features/big_metadata
4700Lines: 1
47011
4702Mode: 444
4703# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4704Path: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/features/extended_iref
4705Lines: 1
47061
4707Mode: 644
4708# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4709Path: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/features/mixed_backref
4710Lines: 1
47111
4712Mode: 444
4713# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4714Path: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/features/skinny_metadata
4715Lines: 1
47161
4717Mode: 444
4718# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4719Path: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/label
4720Lines: 1
4721fixture
4722Mode: 644
4723# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4724Path: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/metadata_uuid
4725Lines: 1
47260abb23a9-579b-43e6-ad30-227ef47fcb9d
4727Mode: 444
4728# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4729Path: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/nodesize
4730Lines: 1
473116384
4732Mode: 444
4733# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4734Path: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/quota_override
4735Lines: 1
47360
4737Mode: 644
4738# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4739Path: fixtures/sys/fs/btrfs/0abb23a9-579b-43e6-ad30-227ef47fcb9d/sectorsize
4740Lines: 1
47414096
4742Mode: 444
4743# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4744Directory: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b
4745Mode: 755
4746# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4747Directory: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/allocation
4748Mode: 755
4749# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4750Directory: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/allocation/data
4751Mode: 755
4752# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4753Path: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/allocation/data/bytes_may_use
4754Lines: 1
47550
4756Mode: 444
4757# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4758Path: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/allocation/data/bytes_pinned
4759Lines: 1
47600
4761Mode: 444
4762# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4763Path: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/allocation/data/bytes_readonly
4764Lines: 1
47650
4766Mode: 444
4767# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4768Path: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/allocation/data/bytes_reserved
4769Lines: 1
47700
4771Mode: 444
4772# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4773Path: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/allocation/data/bytes_used
4774Lines: 1
47750
4776Mode: 444
4777# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4778Path: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/allocation/data/disk_total
4779Lines: 1
4780644087808
4781Mode: 444
4782# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4783Path: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/allocation/data/disk_used
4784Lines: 1
47850
4786Mode: 444
4787# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4788Path: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/allocation/data/flags
4789Lines: 1
47901
4791Mode: 444
4792# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4793Directory: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/allocation/data/raid5
4794Mode: 755
4795# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4796Path: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/allocation/data/raid5/total_bytes
4797Lines: 1
4798644087808
4799Mode: 444
4800# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4801Path: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/allocation/data/raid5/used_bytes
4802Lines: 1
48030
4804Mode: 444
4805# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4806Path: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/allocation/data/total_bytes
4807Lines: 1
4808644087808
4809Mode: 444
4810# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4811Path: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/allocation/data/total_bytes_pinned
4812Lines: 1
48130
4814Mode: 444
4815# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4816Path: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/allocation/global_rsv_reserved
4817Lines: 1
481816777216
4819Mode: 444
4820# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4821Path: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/allocation/global_rsv_size
4822Lines: 1
482316777216
4824Mode: 444
4825# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4826Directory: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/allocation/metadata
4827Mode: 755
4828# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4829Path: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/allocation/metadata/bytes_may_use
4830Lines: 1
483116777216
4832Mode: 444
4833# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4834Path: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/allocation/metadata/bytes_pinned
4835Lines: 1
48360
4837Mode: 444
4838# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4839Path: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/allocation/metadata/bytes_readonly
4840Lines: 1
4841262144
4842Mode: 444
4843# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4844Path: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/allocation/metadata/bytes_reserved
4845Lines: 1
48460
4847Mode: 444
4848# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4849Path: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/allocation/metadata/bytes_used
4850Lines: 1
4851114688
4852Mode: 444
4853# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4854Path: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/allocation/metadata/disk_total
4855Lines: 1
4856429391872
4857Mode: 444
4858# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4859Path: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/allocation/metadata/disk_used
4860Lines: 1
4861114688
4862Mode: 444
4863# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4864Path: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/allocation/metadata/flags
4865Lines: 1
48664
4867Mode: 444
4868# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4869Directory: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/allocation/metadata/raid6
4870Mode: 755
4871# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4872Path: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/allocation/metadata/raid6/total_bytes
4873Lines: 1
4874429391872
4875Mode: 444
4876# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4877Path: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/allocation/metadata/raid6/used_bytes
4878Lines: 1
4879114688
4880Mode: 444
4881# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4882Path: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/allocation/metadata/total_bytes
4883Lines: 1
4884429391872
4885Mode: 444
4886# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4887Path: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/allocation/metadata/total_bytes_pinned
4888Lines: 1
48890
4890Mode: 444
4891# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4892Directory: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/allocation/system
4893Mode: 755
4894# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4895Path: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/allocation/system/bytes_may_use
4896Lines: 1
48970
4898Mode: 444
4899# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4900Path: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/allocation/system/bytes_pinned
4901Lines: 1
49020
4903Mode: 444
4904# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4905Path: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/allocation/system/bytes_readonly
4906Lines: 1
49070
4908Mode: 444
4909# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4910Path: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/allocation/system/bytes_reserved
4911Lines: 1
49120
4913Mode: 444
4914# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4915Path: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/allocation/system/bytes_used
4916Lines: 1
491716384
4918Mode: 444
4919# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4920Path: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/allocation/system/disk_total
4921Lines: 1
492216777216
4923Mode: 444
4924# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4925Path: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/allocation/system/disk_used
4926Lines: 1
492716384
4928Mode: 444
4929# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4930Path: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/allocation/system/flags
4931Lines: 1
49322
4933Mode: 444
4934# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4935Directory: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/allocation/system/raid6
4936Mode: 755
4937# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4938Path: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/allocation/system/raid6/total_bytes
4939Lines: 1
494016777216
4941Mode: 444
4942# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4943Path: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/allocation/system/raid6/used_bytes
4944Lines: 1
494516384
4946Mode: 444
4947# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4948Path: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/allocation/system/total_bytes
4949Lines: 1
495016777216
4951Mode: 444
4952# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4953Path: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/allocation/system/total_bytes_pinned
4954Lines: 1
49550
4956Mode: 444
4957# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4958Path: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/clone_alignment
4959Lines: 1
49604096
4961Mode: 444
4962# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4963Directory: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/devices
4964Mode: 755
4965# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4966Path: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/devices/loop22
4967SymlinkTo: ../../../../devices/virtual/block/loop22
4968# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4969Path: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/devices/loop23
4970SymlinkTo: ../../../../devices/virtual/block/loop23
4971# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4972Path: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/devices/loop24
4973SymlinkTo: ../../../../devices/virtual/block/loop24
4974# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4975Path: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/devices/loop25
4976SymlinkTo: ../../../../devices/virtual/block/loop25
4977# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4978Directory: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/features
4979Mode: 755
4980# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4981Path: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/features/big_metadata
4982Lines: 1
49831
4984Mode: 444
4985# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4986Path: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/features/extended_iref
4987Lines: 1
49881
4989Mode: 644
4990# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4991Path: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/features/mixed_backref
4992Lines: 1
49931
4994Mode: 444
4995# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4996Path: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/features/raid56
4997Lines: 1
49981
4999Mode: 444
5000# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
5001Path: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/features/skinny_metadata
5002Lines: 1
50031
5004Mode: 444
5005# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
5006Path: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/label
5007Lines: 0
5008Mode: 644
5009# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
5010Path: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/metadata_uuid
5011Lines: 1
50127f07c59f-6136-449c-ab87-e1cf2328731b
5013Mode: 444
5014# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
5015Path: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/nodesize
5016Lines: 1
501716384
5018Mode: 444
5019# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
5020Path: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/quota_override
5021Lines: 1
50220
5023Mode: 644
5024# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
5025Path: fixtures/sys/fs/btrfs/7f07c59f-6136-449c-ab87-e1cf2328731b/sectorsize
5026Lines: 1
50274096
5028Mode: 444
5029# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
4281Directory: fixtures/sys/fs/xfs 5030Directory: fixtures/sys/fs/xfs
4282Mode: 755 5031Mode: 755
4283# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5032# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
diff --git a/vendor/github.com/prometheus/procfs/go.mod b/vendor/github.com/prometheus/procfs/go.mod
index b2f8cca..0e04e5d 100644
--- a/vendor/github.com/prometheus/procfs/go.mod
+++ b/vendor/github.com/prometheus/procfs/go.mod
@@ -1,6 +1,8 @@
1module github.com/prometheus/procfs 1module github.com/prometheus/procfs
2 2
3go 1.12
4
3require ( 5require (
4 github.com/google/go-cmp v0.3.0 6 github.com/google/go-cmp v0.3.1
5 golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 7 golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e
6) 8)
diff --git a/vendor/github.com/prometheus/procfs/go.sum b/vendor/github.com/prometheus/procfs/go.sum
index db54133..33b824b 100644
--- a/vendor/github.com/prometheus/procfs/go.sum
+++ b/vendor/github.com/prometheus/procfs/go.sum
@@ -1,4 +1,4 @@
1github.com/google/go-cmp v0.3.0 h1:crn/baboCvb5fXaQ0IJ1SGTsTVrWpDsCWC8EGETZijY= 1github.com/google/go-cmp v0.3.1 h1:Xye71clBPdm5HgqGwUkwhbynsUJZhDbS20FvLhQ2izg=
2github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= 2github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
3golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 h1:YUO/7uOKsKeq9UokNS62b8FYywz3ker1l1vDZRCRefw= 3golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e h1:vcxGaoTs7kV8m5Np9uUNQin4BrLOthgV7252N8V+FwY=
4golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 4golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
diff --git a/vendor/github.com/prometheus/procfs/internal/fs/fs.go b/vendor/github.com/prometheus/procfs/internal/fs/fs.go
index 7ddfd6b..565e89e 100644
--- a/vendor/github.com/prometheus/procfs/internal/fs/fs.go
+++ b/vendor/github.com/prometheus/procfs/internal/fs/fs.go
@@ -26,7 +26,7 @@ const (
26 // DefaultSysMountPoint is the common mount point of the sys filesystem. 26 // DefaultSysMountPoint is the common mount point of the sys filesystem.
27 DefaultSysMountPoint = "/sys" 27 DefaultSysMountPoint = "/sys"
28 28
29 // DefaultConfigfsMountPoint is the commont mount point of the configfs 29 // DefaultConfigfsMountPoint is the common mount point of the configfs
30 DefaultConfigfsMountPoint = "/sys/kernel/config" 30 DefaultConfigfsMountPoint = "/sys/kernel/config"
31) 31)
32 32
diff --git a/vendor/github.com/prometheus/procfs/internal/util/readfile.go b/vendor/github.com/prometheus/procfs/internal/util/readfile.go
new file mode 100644
index 0000000..8051161
--- /dev/null
+++ b/vendor/github.com/prometheus/procfs/internal/util/readfile.go
@@ -0,0 +1,38 @@
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
14package util
15
16import (
17 "io"
18 "io/ioutil"
19 "os"
20)
21
22// ReadFileNoStat uses ioutil.ReadAll to read contents of entire file.
23// This is similar to ioutil.ReadFile but without the call to os.Stat, because
24// many files in /proc and /sys report incorrect file sizes (either 0 or 4096).
25// Reads a max file size of 512kB. For files larger than this, a scanner
26// should be used.
27func ReadFileNoStat(filename string) ([]byte, error) {
28 const maxBufferSize = 1024 * 512
29
30 f, err := os.Open(filename)
31 if err != nil {
32 return nil, err
33 }
34 defer f.Close()
35
36 reader := io.LimitReader(f, maxBufferSize)
37 return ioutil.ReadAll(reader)
38}
diff --git a/vendor/github.com/prometheus/procfs/internal/util/sysreadfile.go b/vendor/github.com/prometheus/procfs/internal/util/sysreadfile.go
index 68b37c4..c07de0b 100644
--- a/vendor/github.com/prometheus/procfs/internal/util/sysreadfile.go
+++ b/vendor/github.com/prometheus/procfs/internal/util/sysreadfile.go
@@ -23,6 +23,8 @@ import (
23 23
24// SysReadFile is a simplified ioutil.ReadFile that invokes syscall.Read directly. 24// SysReadFile is a simplified ioutil.ReadFile that invokes syscall.Read directly.
25// https://github.com/prometheus/node_exporter/pull/728/files 25// https://github.com/prometheus/node_exporter/pull/728/files
26//
27// Note that this function will not read files larger than 128 bytes.
26func SysReadFile(file string) (string, error) { 28func SysReadFile(file string) (string, error) {
27 f, err := os.Open(file) 29 f, err := os.Open(file)
28 if err != nil { 30 if err != nil {
@@ -35,7 +37,8 @@ func SysReadFile(file string) (string, error) {
35 // 37 //
36 // Since we either want to read data or bail immediately, do the simplest 38 // Since we either want to read data or bail immediately, do the simplest
37 // possible read using syscall directly. 39 // possible read using syscall directly.
38 b := make([]byte, 128) 40 const sysFileBufferSize = 128
41 b := make([]byte, sysFileBufferSize)
39 n, err := syscall.Read(int(f.Fd()), b) 42 n, err := syscall.Read(int(f.Fd()), b)
40 if err != nil { 43 if err != nil {
41 return "", err 44 return "", err
diff --git a/vendor/github.com/prometheus/procfs/ipvs.go b/vendor/github.com/prometheus/procfs/ipvs.go
index 2d6cb8d..89e4477 100644
--- a/vendor/github.com/prometheus/procfs/ipvs.go
+++ b/vendor/github.com/prometheus/procfs/ipvs.go
@@ -15,6 +15,7 @@ package procfs
15 15
16import ( 16import (
17 "bufio" 17 "bufio"
18 "bytes"
18 "encoding/hex" 19 "encoding/hex"
19 "errors" 20 "errors"
20 "fmt" 21 "fmt"
@@ -24,6 +25,8 @@ import (
24 "os" 25 "os"
25 "strconv" 26 "strconv"
26 "strings" 27 "strings"
28
29 "github.com/prometheus/procfs/internal/util"
27) 30)
28 31
29// IPVSStats holds IPVS statistics, as exposed by the kernel in `/proc/net/ip_vs_stats`. 32// IPVSStats holds IPVS statistics, as exposed by the kernel in `/proc/net/ip_vs_stats`.
@@ -64,17 +67,16 @@ type IPVSBackendStatus struct {
64 67
65// IPVSStats reads the IPVS statistics from the specified `proc` filesystem. 68// IPVSStats reads the IPVS statistics from the specified `proc` filesystem.
66func (fs FS) IPVSStats() (IPVSStats, error) { 69func (fs FS) IPVSStats() (IPVSStats, error) {
67 file, err := os.Open(fs.proc.Path("net/ip_vs_stats")) 70 data, err := util.ReadFileNoStat(fs.proc.Path("net/ip_vs_stats"))
68 if err != nil { 71 if err != nil {
69 return IPVSStats{}, err 72 return IPVSStats{}, err
70 } 73 }
71 defer file.Close()
72 74
73 return parseIPVSStats(file) 75 return parseIPVSStats(bytes.NewReader(data))
74} 76}
75 77
76// parseIPVSStats performs the actual parsing of `ip_vs_stats`. 78// parseIPVSStats performs the actual parsing of `ip_vs_stats`.
77func parseIPVSStats(file io.Reader) (IPVSStats, error) { 79func parseIPVSStats(r io.Reader) (IPVSStats, error) {
78 var ( 80 var (
79 statContent []byte 81 statContent []byte
80 statLines []string 82 statLines []string
@@ -82,7 +84,7 @@ func parseIPVSStats(file io.Reader) (IPVSStats, error) {
82 stats IPVSStats 84 stats IPVSStats
83 ) 85 )
84 86
85 statContent, err := ioutil.ReadAll(file) 87 statContent, err := ioutil.ReadAll(r)
86 if err != nil { 88 if err != nil {
87 return IPVSStats{}, err 89 return IPVSStats{}, err
88 } 90 }
diff --git a/vendor/github.com/prometheus/procfs/meminfo.go b/vendor/github.com/prometheus/procfs/meminfo.go
new file mode 100644
index 0000000..dd630c0
--- /dev/null
+++ b/vendor/github.com/prometheus/procfs/meminfo.go
@@ -0,0 +1,453 @@
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
14package procfs
15
16import (
17 "bufio"
18 "bytes"
19 "strconv"
20 "strings"
21
22 "github.com/prometheus/procfs/internal/util"
23)
24
25// Meminfo represents memory statistics.
26type Meminfo struct {
27 // Total usable ram (i.e. physical ram minus a few reserved
28 // bits and the kernel binary code)
29 MemTotal uint64
30 // The sum of LowFree+HighFree
31 MemFree uint64
32 // An estimate of how much memory is available for starting
33 // new applications, without swapping. Calculated from
34 // MemFree, SReclaimable, the size of the file LRU lists, and
35 // the low watermarks in each zone. The estimate takes into
36 // account that the system needs some page cache to function
37 // well, and that not all reclaimable slab will be
38 // reclaimable, due to items being in use. The impact of those
39 // factors will vary from system to system.
40 MemAvailable uint64
41 // Relatively temporary storage for raw disk blocks shouldn't
42 // get tremendously large (20MB or so)
43 Buffers uint64
44 Cached uint64
45 // Memory that once was swapped out, is swapped back in but
46 // still also is in the swapfile (if memory is needed it
47 // doesn't need to be swapped out AGAIN because it is already
48 // in the swapfile. This saves I/O)
49 SwapCached uint64
50 // Memory that has been used more recently and usually not
51 // reclaimed unless absolutely necessary.
52 Active uint64
53 // Memory which has been less recently used. It is more
54 // eligible to be reclaimed for other purposes
55 Inactive uint64
56 ActiveAnon uint64
57 InactiveAnon uint64
58 ActiveFile uint64
59 InactiveFile uint64
60 Unevictable uint64
61 Mlocked uint64
62 // total amount of swap space available
63 SwapTotal uint64
64 // Memory which has been evicted from RAM, and is temporarily
65 // on the disk
66 SwapFree uint64
67 // Memory which is waiting to get written back to the disk
68 Dirty uint64
69 // Memory which is actively being written back to the disk
70 Writeback uint64
71 // Non-file backed pages mapped into userspace page tables
72 AnonPages uint64
73 // files which have been mapped, such as libraries
74 Mapped uint64
75 Shmem uint64
76 // in-kernel data structures cache
77 Slab uint64
78 // Part of Slab, that might be reclaimed, such as caches
79 SReclaimable uint64
80 // Part of Slab, that cannot be reclaimed on memory pressure
81 SUnreclaim uint64
82 KernelStack uint64
83 // amount of memory dedicated to the lowest level of page
84 // tables.
85 PageTables uint64
86 // NFS pages sent to the server, but not yet committed to
87 // stable storage
88 NFSUnstable uint64
89 // Memory used for block device "bounce buffers"
90 Bounce uint64
91 // Memory used by FUSE for temporary writeback buffers
92 WritebackTmp uint64
93 // Based on the overcommit ratio ('vm.overcommit_ratio'),
94 // this is the total amount of memory currently available to
95 // be allocated on the system. This limit is only adhered to
96 // if strict overcommit accounting is enabled (mode 2 in
97 // 'vm.overcommit_memory').
98 // The CommitLimit is calculated with the following formula:
99 // CommitLimit = ([total RAM pages] - [total huge TLB pages]) *
100 // overcommit_ratio / 100 + [total swap pages]
101 // For example, on a system with 1G of physical RAM and 7G
102 // of swap with a `vm.overcommit_ratio` of 30 it would
103 // yield a CommitLimit of 7.3G.
104 // For more details, see the memory overcommit documentation
105 // in vm/overcommit-accounting.
106 CommitLimit uint64
107 // The amount of memory presently allocated on the system.
108 // The committed memory is a sum of all of the memory which
109 // has been allocated by processes, even if it has not been
110 // "used" by them as of yet. A process which malloc()'s 1G
111 // of memory, but only touches 300M of it will show up as
112 // using 1G. This 1G is memory which has been "committed" to
113 // by the VM and can be used at any time by the allocating
114 // application. With strict overcommit enabled on the system
115 // (mode 2 in 'vm.overcommit_memory'),allocations which would
116 // exceed the CommitLimit (detailed above) will not be permitted.
117 // This is useful if one needs to guarantee that processes will
118 // not fail due to lack of memory once that memory has been
119 // successfully allocated.
120 CommittedAS uint64
121 // total size of vmalloc memory area
122 VmallocTotal uint64
123 // amount of vmalloc area which is used
124 VmallocUsed uint64
125 // largest contiguous block of vmalloc area which is free
126 VmallocChunk uint64
127 HardwareCorrupted uint64
128 AnonHugePages uint64
129 ShmemHugePages uint64
130 ShmemPmdMapped uint64
131 CmaTotal uint64
132 CmaFree uint64
133 HugePagesTotal uint64
134 HugePagesFree uint64
135 HugePagesRsvd uint64
136 HugePagesSurp uint64
137 Hugepagesize uint64
138 DirectMap4k uint64
139 DirectMap2M uint64
140 DirectMap1G uint64
141}
142
143// Meminfo returns an information about current kernel/system memory statistics.
144// See https://www.kernel.org/doc/Documentation/filesystems/proc.txt
145func (fs FS) Meminfo() (Meminfo, error) {
146 data, err := util.ReadFileNoStat(fs.proc.Path("meminfo"))
147 if err != nil {
148 return Meminfo{}, err
149 }
150 return parseMemInfo(data)
151}
152
153func parseMemInfo(info []byte) (m Meminfo, err error) {
154 scanner := bufio.NewScanner(bytes.NewReader(info))
155
156 var line string
157 for scanner.Scan() {
158 line = scanner.Text()
159
160 field := strings.Fields(line)
161 switch field[0] {
162 case "MemTotal:":
163 v, err := strconv.ParseUint(field[1], 0, 64)
164 if err != nil {
165 return Meminfo{}, err
166 }
167 m.MemTotal = v
168 case "MemFree:":
169 v, err := strconv.ParseUint(field[1], 0, 64)
170 if err != nil {
171 return Meminfo{}, err
172 }
173 m.MemFree = v
174 case "MemAvailable:":
175 v, err := strconv.ParseUint(field[1], 0, 64)
176 if err != nil {
177 return Meminfo{}, err
178 }
179 m.MemAvailable = v
180 case "Buffers:":
181 v, err := strconv.ParseUint(field[1], 0, 64)
182 if err != nil {
183 return Meminfo{}, err
184 }
185 m.Buffers = v
186 case "Cached:":
187 v, err := strconv.ParseUint(field[1], 0, 64)
188 if err != nil {
189 return Meminfo{}, err
190 }
191 m.Cached = v
192 case "SwapCached:":
193 v, err := strconv.ParseUint(field[1], 0, 64)
194 if err != nil {
195 return Meminfo{}, err
196 }
197 m.SwapCached = v
198 case "Active:":
199 v, err := strconv.ParseUint(field[1], 0, 64)
200 if err != nil {
201 return Meminfo{}, err
202 }
203 m.Active = v
204 case "Inactive:":
205 v, err := strconv.ParseUint(field[1], 0, 64)
206 if err != nil {
207 return Meminfo{}, err
208 }
209 m.Inactive = v
210 case "Active(anon):":
211 v, err := strconv.ParseUint(field[1], 0, 64)
212 if err != nil {
213 return Meminfo{}, err
214 }
215 m.ActiveAnon = v
216 case "Inactive(anon):":
217 v, err := strconv.ParseUint(field[1], 0, 64)
218 if err != nil {
219 return Meminfo{}, err
220 }
221 m.InactiveAnon = v
222 case "Active(file):":
223 v, err := strconv.ParseUint(field[1], 0, 64)
224 if err != nil {
225 return Meminfo{}, err
226 }
227 m.ActiveFile = v
228 case "Inactive(file):":
229 v, err := strconv.ParseUint(field[1], 0, 64)
230 if err != nil {
231 return Meminfo{}, err
232 }
233 m.InactiveFile = v
234 case "Unevictable:":
235 v, err := strconv.ParseUint(field[1], 0, 64)
236 if err != nil {
237 return Meminfo{}, err
238 }
239 m.Unevictable = v
240 case "Mlocked:":
241 v, err := strconv.ParseUint(field[1], 0, 64)
242 if err != nil {
243 return Meminfo{}, err
244 }
245 m.Mlocked = v
246 case "SwapTotal:":
247 v, err := strconv.ParseUint(field[1], 0, 64)
248 if err != nil {
249 return Meminfo{}, err
250 }
251 m.SwapTotal = v
252 case "SwapFree:":
253 v, err := strconv.ParseUint(field[1], 0, 64)
254 if err != nil {
255 return Meminfo{}, err
256 }
257 m.SwapFree = v
258 case "Dirty:":
259 v, err := strconv.ParseUint(field[1], 0, 64)
260 if err != nil {
261 return Meminfo{}, err
262 }
263 m.Dirty = v
264 case "Writeback:":
265 v, err := strconv.ParseUint(field[1], 0, 64)
266 if err != nil {
267 return Meminfo{}, err
268 }
269 m.Writeback = v
270 case "AnonPages:":
271 v, err := strconv.ParseUint(field[1], 0, 64)
272 if err != nil {
273 return Meminfo{}, err
274 }
275 m.AnonPages = v
276 case "Mapped:":
277 v, err := strconv.ParseUint(field[1], 0, 64)
278 if err != nil {
279 return Meminfo{}, err
280 }
281 m.Mapped = v
282 case "Shmem:":
283 v, err := strconv.ParseUint(field[1], 0, 64)
284 if err != nil {
285 return Meminfo{}, err
286 }
287 m.Shmem = v
288 case "Slab:":
289 v, err := strconv.ParseUint(field[1], 0, 64)
290 if err != nil {
291 return Meminfo{}, err
292 }
293 m.Slab = v
294 case "SReclaimable:":
295 v, err := strconv.ParseUint(field[1], 0, 64)
296 if err != nil {
297 return Meminfo{}, err
298 }
299 m.SReclaimable = v
300 case "SUnreclaim:":
301 v, err := strconv.ParseUint(field[1], 0, 64)
302 if err != nil {
303 return Meminfo{}, err
304 }
305 m.SUnreclaim = v
306 case "KernelStack:":
307 v, err := strconv.ParseUint(field[1], 0, 64)
308 if err != nil {
309 return Meminfo{}, err
310 }
311 m.KernelStack = v
312 case "PageTables:":
313 v, err := strconv.ParseUint(field[1], 0, 64)
314 if err != nil {
315 return Meminfo{}, err
316 }
317 m.PageTables = v
318 case "NFS_Unstable:":
319 v, err := strconv.ParseUint(field[1], 0, 64)
320 if err != nil {
321 return Meminfo{}, err
322 }
323 m.NFSUnstable = v
324 case "Bounce:":
325 v, err := strconv.ParseUint(field[1], 0, 64)
326 if err != nil {
327 return Meminfo{}, err
328 }
329 m.Bounce = v
330 case "WritebackTmp:":
331 v, err := strconv.ParseUint(field[1], 0, 64)
332 if err != nil {
333 return Meminfo{}, err
334 }
335 m.WritebackTmp = v
336 case "CommitLimit:":
337 v, err := strconv.ParseUint(field[1], 0, 64)
338 if err != nil {
339 return Meminfo{}, err
340 }
341 m.CommitLimit = v
342 case "Committed_AS:":
343 v, err := strconv.ParseUint(field[1], 0, 64)
344 if err != nil {
345 return Meminfo{}, err
346 }
347 m.CommittedAS = v
348 case "VmallocTotal:":
349 v, err := strconv.ParseUint(field[1], 0, 64)
350 if err != nil {
351 return Meminfo{}, err
352 }
353 m.VmallocTotal = v
354 case "VmallocUsed:":
355 v, err := strconv.ParseUint(field[1], 0, 64)
356 if err != nil {
357 return Meminfo{}, err
358 }
359 m.VmallocUsed = v
360 case "VmallocChunk:":
361 v, err := strconv.ParseUint(field[1], 0, 64)
362 if err != nil {
363 return Meminfo{}, err
364 }
365 m.VmallocChunk = v
366 case "HardwareCorrupted:":
367 v, err := strconv.ParseUint(field[1], 0, 64)
368 if err != nil {
369 return Meminfo{}, err
370 }
371 m.HardwareCorrupted = v
372 case "AnonHugePages:":
373 v, err := strconv.ParseUint(field[1], 0, 64)
374 if err != nil {
375 return Meminfo{}, err
376 }
377 m.AnonHugePages = v
378 case "ShmemHugePages:":
379 v, err := strconv.ParseUint(field[1], 0, 64)
380 if err != nil {
381 return Meminfo{}, err
382 }
383 m.ShmemHugePages = v
384 case "ShmemPmdMapped:":
385 v, err := strconv.ParseUint(field[1], 0, 64)
386 if err != nil {
387 return Meminfo{}, err
388 }
389 m.ShmemPmdMapped = v
390 case "CmaTotal:":
391 v, err := strconv.ParseUint(field[1], 0, 64)
392 if err != nil {
393 return Meminfo{}, err
394 }
395 m.CmaTotal = v
396 case "CmaFree:":
397 v, err := strconv.ParseUint(field[1], 0, 64)
398 if err != nil {
399 return Meminfo{}, err
400 }
401 m.CmaFree = v
402 case "HugePages_Total:":
403 v, err := strconv.ParseUint(field[1], 0, 64)
404 if err != nil {
405 return Meminfo{}, err
406 }
407 m.HugePagesTotal = v
408 case "HugePages_Free:":
409 v, err := strconv.ParseUint(field[1], 0, 64)
410 if err != nil {
411 return Meminfo{}, err
412 }
413 m.HugePagesFree = v
414 case "HugePages_Rsvd:":
415 v, err := strconv.ParseUint(field[1], 0, 64)
416 if err != nil {
417 return Meminfo{}, err
418 }
419 m.HugePagesRsvd = v
420 case "HugePages_Surp:":
421 v, err := strconv.ParseUint(field[1], 0, 64)
422 if err != nil {
423 return Meminfo{}, err
424 }
425 m.HugePagesSurp = v
426 case "Hugepagesize:":
427 v, err := strconv.ParseUint(field[1], 0, 64)
428 if err != nil {
429 return Meminfo{}, err
430 }
431 m.Hugepagesize = v
432 case "DirectMap4k:":
433 v, err := strconv.ParseUint(field[1], 0, 64)
434 if err != nil {
435 return Meminfo{}, err
436 }
437 m.DirectMap4k = v
438 case "DirectMap2M:":
439 v, err := strconv.ParseUint(field[1], 0, 64)
440 if err != nil {
441 return Meminfo{}, err
442 }
443 m.DirectMap2M = v
444 case "DirectMap1G:":
445 v, err := strconv.ParseUint(field[1], 0, 64)
446 if err != nil {
447 return Meminfo{}, err
448 }
449 m.DirectMap1G = v
450 }
451 }
452 return m, nil
453}
diff --git a/vendor/github.com/prometheus/procfs/mountinfo.go b/vendor/github.com/prometheus/procfs/mountinfo.go
index 61fa618..bb01bb5 100644
--- a/vendor/github.com/prometheus/procfs/mountinfo.go
+++ b/vendor/github.com/prometheus/procfs/mountinfo.go
@@ -15,19 +15,13 @@ package procfs
15 15
16import ( 16import (
17 "bufio" 17 "bufio"
18 "bytes"
18 "fmt" 19 "fmt"
19 "io"
20 "os"
21 "strconv" 20 "strconv"
22 "strings" 21 "strings"
23)
24 22
25var validOptionalFields = map[string]bool{ 23 "github.com/prometheus/procfs/internal/util"
26 "shared": true, 24)
27 "master": true,
28 "propagate_from": true,
29 "unbindable": true,
30}
31 25
32// A MountInfo is a type that describes the details, options 26// A MountInfo is a type that describes the details, options
33// for each mount, parsed from /proc/self/mountinfo. 27// for each mount, parsed from /proc/self/mountinfo.
@@ -58,18 +52,10 @@ type MountInfo struct {
58 SuperOptions map[string]string 52 SuperOptions map[string]string
59} 53}
60 54
61// Returns part of the mountinfo line, if it exists, else an empty string.
62func getStringSliceElement(parts []string, idx int, defaultValue string) string {
63 if idx >= len(parts) {
64 return defaultValue
65 }
66 return parts[idx]
67}
68
69// Reads each line of the mountinfo file, and returns a list of formatted MountInfo structs. 55// Reads each line of the mountinfo file, and returns a list of formatted MountInfo structs.
70func parseMountInfo(r io.Reader) ([]*MountInfo, error) { 56func parseMountInfo(info []byte) ([]*MountInfo, error) {
71 mounts := []*MountInfo{} 57 mounts := []*MountInfo{}
72 scanner := bufio.NewScanner(r) 58 scanner := bufio.NewScanner(bytes.NewReader(info))
73 for scanner.Scan() { 59 for scanner.Scan() {
74 mountString := scanner.Text() 60 mountString := scanner.Text()
75 parsedMounts, err := parseMountInfoString(mountString) 61 parsedMounts, err := parseMountInfoString(mountString)
@@ -89,57 +75,75 @@ func parseMountInfo(r io.Reader) ([]*MountInfo, error) {
89func parseMountInfoString(mountString string) (*MountInfo, error) { 75func parseMountInfoString(mountString string) (*MountInfo, error) {
90 var err error 76 var err error
91 77
92 // OptionalFields can be zero, hence these checks to ensure we do not populate the wrong values in the wrong spots 78 mountInfo := strings.Split(mountString, " ")
93 separatorIndex := strings.Index(mountString, "-") 79 mountInfoLength := len(mountInfo)
94 if separatorIndex == -1 { 80 if mountInfoLength < 11 {
95 return nil, fmt.Errorf("no separator found in mountinfo string: %s", mountString) 81 return nil, fmt.Errorf("couldn't find enough fields in mount string: %s", mountString)
96 } 82 }
97 beforeFields := strings.Fields(mountString[:separatorIndex]) 83
98 afterFields := strings.Fields(mountString[separatorIndex+1:]) 84 if mountInfo[mountInfoLength-4] != "-" {
99 if (len(beforeFields) + len(afterFields)) < 7 { 85 return nil, fmt.Errorf("couldn't find separator in expected field: %s", mountInfo[mountInfoLength-4])
100 return nil, fmt.Errorf("too few fields")
101 } 86 }
102 87
103 mount := &MountInfo{ 88 mount := &MountInfo{
104 MajorMinorVer: getStringSliceElement(beforeFields, 2, ""), 89 MajorMinorVer: mountInfo[2],
105 Root: getStringSliceElement(beforeFields, 3, ""), 90 Root: mountInfo[3],
106 MountPoint: getStringSliceElement(beforeFields, 4, ""), 91 MountPoint: mountInfo[4],
107 Options: mountOptionsParser(getStringSliceElement(beforeFields, 5, "")), 92 Options: mountOptionsParser(mountInfo[5]),
108 OptionalFields: nil, 93 OptionalFields: nil,
109 FSType: getStringSliceElement(afterFields, 0, ""), 94 FSType: mountInfo[mountInfoLength-3],
110 Source: getStringSliceElement(afterFields, 1, ""), 95 Source: mountInfo[mountInfoLength-2],
111 SuperOptions: mountOptionsParser(getStringSliceElement(afterFields, 2, "")), 96 SuperOptions: mountOptionsParser(mountInfo[mountInfoLength-1]),
112 } 97 }
113 98
114 mount.MountId, err = strconv.Atoi(getStringSliceElement(beforeFields, 0, "")) 99 mount.MountId, err = strconv.Atoi(mountInfo[0])
115 if err != nil { 100 if err != nil {
116 return nil, fmt.Errorf("failed to parse mount ID") 101 return nil, fmt.Errorf("failed to parse mount ID")
117 } 102 }
118 mount.ParentId, err = strconv.Atoi(getStringSliceElement(beforeFields, 1, "")) 103 mount.ParentId, err = strconv.Atoi(mountInfo[1])
119 if err != nil { 104 if err != nil {
120 return nil, fmt.Errorf("failed to parse parent ID") 105 return nil, fmt.Errorf("failed to parse parent ID")
121 } 106 }
122 // Has optional fields, which is a space separated list of values. 107 // Has optional fields, which is a space separated list of values.
123 // Example: shared:2 master:7 108 // Example: shared:2 master:7
124 if len(beforeFields) > 6 { 109 if mountInfo[6] != "" {
125 mount.OptionalFields = make(map[string]string) 110 mount.OptionalFields, err = mountOptionsParseOptionalFields(mountInfo[6 : mountInfoLength-4])
126 optionalFields := beforeFields[6:] 111 if err != nil {
127 for _, field := range optionalFields { 112 return nil, err
128 optionSplit := strings.Split(field, ":")
129 target, value := optionSplit[0], ""
130 if len(optionSplit) == 2 {
131 value = optionSplit[1]
132 }
133 // Checks if the 'keys' in the optional fields in the mountinfo line are acceptable.
134 // Allowed 'keys' are shared, master, propagate_from, unbindable.
135 if _, ok := validOptionalFields[target]; ok {
136 mount.OptionalFields[target] = value
137 }
138 } 113 }
139 } 114 }
140 return mount, nil 115 return mount, nil
141} 116}
142 117
118// mountOptionsIsValidField checks a string against a valid list of optional fields keys.
119func mountOptionsIsValidField(s string) bool {
120 switch s {
121 case
122 "shared",
123 "master",
124 "propagate_from",
125 "unbindable":
126 return true
127 }
128 return false
129}
130
131// mountOptionsParseOptionalFields parses a list of optional fields strings into a double map of strings.
132func mountOptionsParseOptionalFields(o []string) (map[string]string, error) {
133 optionalFields := make(map[string]string)
134 for _, field := range o {
135 optionSplit := strings.SplitN(field, ":", 2)
136 value := ""
137 if len(optionSplit) == 2 {
138 value = optionSplit[1]
139 }
140 if mountOptionsIsValidField(optionSplit[0]) {
141 optionalFields[optionSplit[0]] = value
142 }
143 }
144 return optionalFields, nil
145}
146
143// Parses the mount options, superblock options. 147// Parses the mount options, superblock options.
144func mountOptionsParser(mountOptions string) map[string]string { 148func mountOptionsParser(mountOptions string) map[string]string {
145 opts := make(map[string]string) 149 opts := make(map[string]string)
@@ -159,20 +163,18 @@ func mountOptionsParser(mountOptions string) map[string]string {
159 163
160// Retrieves mountinfo information from `/proc/self/mountinfo`. 164// Retrieves mountinfo information from `/proc/self/mountinfo`.
161func GetMounts() ([]*MountInfo, error) { 165func GetMounts() ([]*MountInfo, error) {
162 f, err := os.Open("/proc/self/mountinfo") 166 data, err := util.ReadFileNoStat("/proc/self/mountinfo")
163 if err != nil { 167 if err != nil {
164 return nil, err 168 return nil, err
165 } 169 }
166 defer f.Close() 170 return parseMountInfo(data)
167 return parseMountInfo(f)
168} 171}
169 172
170// Retrieves mountinfo information from a processes' `/proc/<pid>/mountinfo`. 173// Retrieves mountinfo information from a processes' `/proc/<pid>/mountinfo`.
171func GetProcMounts(pid int) ([]*MountInfo, error) { 174func GetProcMounts(pid int) ([]*MountInfo, error) {
172 f, err := os.Open(fmt.Sprintf("/proc/%d/mountinfo", pid)) 175 data, err := util.ReadFileNoStat(fmt.Sprintf("/proc/%d/mountinfo", pid))
173 if err != nil { 176 if err != nil {
174 return nil, err 177 return nil, err
175 } 178 }
176 defer f.Close() 179 return parseMountInfo(data)
177 return parseMountInfo(f)
178} 180}
diff --git a/vendor/github.com/prometheus/procfs/net_dev.go b/vendor/github.com/prometheus/procfs/net_dev.go
index a0b7a01..47a710b 100644
--- a/vendor/github.com/prometheus/procfs/net_dev.go
+++ b/vendor/github.com/prometheus/procfs/net_dev.go
@@ -183,7 +183,6 @@ func (netDev NetDev) Total() NetDevLine {
183 names = append(names, ifc.Name) 183 names = append(names, ifc.Name)
184 total.RxBytes += ifc.RxBytes 184 total.RxBytes += ifc.RxBytes
185 total.RxPackets += ifc.RxPackets 185 total.RxPackets += ifc.RxPackets
186 total.RxPackets += ifc.RxPackets
187 total.RxErrors += ifc.RxErrors 186 total.RxErrors += ifc.RxErrors
188 total.RxDropped += ifc.RxDropped 187 total.RxDropped += ifc.RxDropped
189 total.RxFIFO += ifc.RxFIFO 188 total.RxFIFO += ifc.RxFIFO
diff --git a/vendor/github.com/prometheus/procfs/proc.go b/vendor/github.com/prometheus/procfs/proc.go
index b7c79cf..330e472 100644
--- a/vendor/github.com/prometheus/procfs/proc.go
+++ b/vendor/github.com/prometheus/procfs/proc.go
@@ -22,6 +22,7 @@ import (
22 "strings" 22 "strings"
23 23
24 "github.com/prometheus/procfs/internal/fs" 24 "github.com/prometheus/procfs/internal/fs"
25 "github.com/prometheus/procfs/internal/util"
25) 26)
26 27
27// Proc provides information about a running process. 28// Proc provides information about a running process.
@@ -121,13 +122,7 @@ func (fs FS) AllProcs() (Procs, error) {
121 122
122// CmdLine returns the command line of a process. 123// CmdLine returns the command line of a process.
123func (p Proc) CmdLine() ([]string, error) { 124func (p Proc) CmdLine() ([]string, error) {
124 f, err := os.Open(p.path("cmdline")) 125 data, err := util.ReadFileNoStat(p.path("cmdline"))
125 if err != nil {
126 return nil, err
127 }
128 defer f.Close()
129
130 data, err := ioutil.ReadAll(f)
131 if err != nil { 126 if err != nil {
132 return nil, err 127 return nil, err
133 } 128 }
@@ -141,13 +136,7 @@ func (p Proc) CmdLine() ([]string, error) {
141 136
142// Comm returns the command name of a process. 137// Comm returns the command name of a process.
143func (p Proc) Comm() (string, error) { 138func (p Proc) Comm() (string, error) {
144 f, err := os.Open(p.path("comm")) 139 data, err := util.ReadFileNoStat(p.path("comm"))
145 if err != nil {
146 return "", err
147 }
148 defer f.Close()
149
150 data, err := ioutil.ReadAll(f)
151 if err != nil { 140 if err != nil {
152 return "", err 141 return "", err
153 } 142 }
@@ -252,13 +241,11 @@ func (p Proc) MountStats() ([]*Mount, error) {
252// It supplies information missing in `/proc/self/mounts` and 241// It supplies information missing in `/proc/self/mounts` and
253// fixes various other problems with that file too. 242// fixes various other problems with that file too.
254func (p Proc) MountInfo() ([]*MountInfo, error) { 243func (p Proc) MountInfo() ([]*MountInfo, error) {
255 f, err := os.Open(p.path("mountinfo")) 244 data, err := util.ReadFileNoStat(p.path("mountinfo"))
256 if err != nil { 245 if err != nil {
257 return nil, err 246 return nil, err
258 } 247 }
259 defer f.Close() 248 return parseMountInfo(data)
260
261 return parseMountInfo(f)
262} 249}
263 250
264func (p Proc) fileDescriptors() ([]string, error) { 251func (p Proc) fileDescriptors() ([]string, error) {
diff --git a/vendor/github.com/prometheus/procfs/proc_environ.go b/vendor/github.com/prometheus/procfs/proc_environ.go
index 7172bb5..6134b35 100644
--- a/vendor/github.com/prometheus/procfs/proc_environ.go
+++ b/vendor/github.com/prometheus/procfs/proc_environ.go
@@ -14,22 +14,16 @@
14package procfs 14package procfs
15 15
16import ( 16import (
17 "io/ioutil"
18 "os"
19 "strings" 17 "strings"
18
19 "github.com/prometheus/procfs/internal/util"
20) 20)
21 21
22// Environ reads process environments from /proc/<pid>/environ 22// Environ reads process environments from /proc/<pid>/environ
23func (p Proc) Environ() ([]string, error) { 23func (p Proc) Environ() ([]string, error) {
24 environments := make([]string, 0) 24 environments := make([]string, 0)
25 25
26 f, err := os.Open(p.path("environ")) 26 data, err := util.ReadFileNoStat(p.path("environ"))
27 if err != nil {
28 return environments, err
29 }
30 defer f.Close()
31
32 data, err := ioutil.ReadAll(f)
33 if err != nil { 27 if err != nil {
34 return environments, err 28 return environments, err
35 } 29 }
diff --git a/vendor/github.com/prometheus/procfs/proc_fdinfo.go b/vendor/github.com/prometheus/procfs/proc_fdinfo.go
index 83b67d1..4e7597f 100644
--- a/vendor/github.com/prometheus/procfs/proc_fdinfo.go
+++ b/vendor/github.com/prometheus/procfs/proc_fdinfo.go
@@ -15,11 +15,10 @@ package procfs
15 15
16import ( 16import (
17 "bufio" 17 "bufio"
18 "fmt" 18 "bytes"
19 "io/ioutil"
20 "os"
21 "regexp" 19 "regexp"
22 "strings" 20
21 "github.com/prometheus/procfs/internal/util"
23) 22)
24 23
25// Regexp variables 24// Regexp variables
@@ -46,21 +45,15 @@ type ProcFDInfo struct {
46 45
47// FDInfo constructor. On kernels older than 3.8, InotifyInfos will always be empty. 46// FDInfo constructor. On kernels older than 3.8, InotifyInfos will always be empty.
48func (p Proc) FDInfo(fd string) (*ProcFDInfo, error) { 47func (p Proc) FDInfo(fd string) (*ProcFDInfo, error) {
49 f, err := os.Open(p.path("fdinfo", fd)) 48 data, err := util.ReadFileNoStat(p.path("fdinfo", fd))
50 if err != nil { 49 if err != nil {
51 return nil, err 50 return nil, err
52 } 51 }
53 defer f.Close()
54
55 fdinfo, err := ioutil.ReadAll(f)
56 if err != nil {
57 return nil, fmt.Errorf("could not read %s: %s", f.Name(), err)
58 }
59 52
60 var text, pos, flags, mntid string 53 var text, pos, flags, mntid string
61 var inotify []InotifyInfo 54 var inotify []InotifyInfo
62 55
63 scanner := bufio.NewScanner(strings.NewReader(string(fdinfo))) 56 scanner := bufio.NewScanner(bytes.NewReader(data))
64 for scanner.Scan() { 57 for scanner.Scan() {
65 text = scanner.Text() 58 text = scanner.Text()
66 if rPos.MatchString(text) { 59 if rPos.MatchString(text) {
diff --git a/vendor/github.com/prometheus/procfs/proc_io.go b/vendor/github.com/prometheus/procfs/proc_io.go
index 0ff89b1..776f349 100644
--- a/vendor/github.com/prometheus/procfs/proc_io.go
+++ b/vendor/github.com/prometheus/procfs/proc_io.go
@@ -15,8 +15,8 @@ package procfs
15 15
16import ( 16import (
17 "fmt" 17 "fmt"
18 "io/ioutil" 18
19 "os" 19 "github.com/prometheus/procfs/internal/util"
20) 20)
21 21
22// ProcIO models the content of /proc/<pid>/io. 22// ProcIO models the content of /proc/<pid>/io.
@@ -43,13 +43,7 @@ type ProcIO struct {
43func (p Proc) IO() (ProcIO, error) { 43func (p Proc) IO() (ProcIO, error) {
44 pio := ProcIO{} 44 pio := ProcIO{}
45 45
46 f, err := os.Open(p.path("io")) 46 data, err := util.ReadFileNoStat(p.path("io"))
47 if err != nil {
48 return pio, err
49 }
50 defer f.Close()
51
52 data, err := ioutil.ReadAll(f)
53 if err != nil { 47 if err != nil {
54 return pio, err 48 return pio, err
55 } 49 }
diff --git a/vendor/github.com/prometheus/procfs/proc_psi.go b/vendor/github.com/prometheus/procfs/proc_psi.go
index 46fe266..0d7bee5 100644
--- a/vendor/github.com/prometheus/procfs/proc_psi.go
+++ b/vendor/github.com/prometheus/procfs/proc_psi.go
@@ -24,11 +24,13 @@ package procfs
24// > full avg10=0.00 avg60=0.13 avg300=0.96 total=8183134 24// > full avg10=0.00 avg60=0.13 avg300=0.96 total=8183134
25 25
26import ( 26import (
27 "bufio"
28 "bytes"
27 "fmt" 29 "fmt"
28 "io" 30 "io"
29 "io/ioutil"
30 "os"
31 "strings" 31 "strings"
32
33 "github.com/prometheus/procfs/internal/util"
32) 34)
33 35
34const lineFormat = "avg10=%f avg60=%f avg300=%f total=%d" 36const lineFormat = "avg10=%f avg60=%f avg300=%f total=%d"
@@ -55,24 +57,21 @@ type PSIStats struct {
55// resource from /proc/pressure/<resource>. At time of writing this can be 57// resource from /proc/pressure/<resource>. At time of writing this can be
56// either "cpu", "memory" or "io". 58// either "cpu", "memory" or "io".
57func (fs FS) PSIStatsForResource(resource string) (PSIStats, error) { 59func (fs FS) PSIStatsForResource(resource string) (PSIStats, error) {
58 file, err := os.Open(fs.proc.Path(fmt.Sprintf("%s/%s", "pressure", resource))) 60 data, err := util.ReadFileNoStat(fs.proc.Path(fmt.Sprintf("%s/%s", "pressure", resource)))
59 if err != nil { 61 if err != nil {
60 return PSIStats{}, fmt.Errorf("psi_stats: unavailable for %s", resource) 62 return PSIStats{}, fmt.Errorf("psi_stats: unavailable for %s", resource)
61 } 63 }
62 64
63 defer file.Close() 65 return parsePSIStats(resource, bytes.NewReader(data))
64 return parsePSIStats(resource, file)
65} 66}
66 67
67// parsePSIStats parses the specified file for pressure stall information 68// parsePSIStats parses the specified file for pressure stall information
68func parsePSIStats(resource string, file io.Reader) (PSIStats, error) { 69func parsePSIStats(resource string, r io.Reader) (PSIStats, error) {
69 psiStats := PSIStats{} 70 psiStats := PSIStats{}
70 stats, err := ioutil.ReadAll(file)
71 if err != nil {
72 return psiStats, fmt.Errorf("psi_stats: unable to read data for %s", resource)
73 }
74 71
75 for _, l := range strings.Split(string(stats), "\n") { 72 scanner := bufio.NewScanner(r)
73 for scanner.Scan() {
74 l := scanner.Text()
76 prefix := strings.Split(l, " ")[0] 75 prefix := strings.Split(l, " ")[0]
77 switch prefix { 76 switch prefix {
78 case "some": 77 case "some":
diff --git a/vendor/github.com/prometheus/procfs/proc_stat.go b/vendor/github.com/prometheus/procfs/proc_stat.go
index dbde1fa..4517d2e 100644
--- a/vendor/github.com/prometheus/procfs/proc_stat.go
+++ b/vendor/github.com/prometheus/procfs/proc_stat.go
@@ -16,10 +16,10 @@ package procfs
16import ( 16import (
17 "bytes" 17 "bytes"
18 "fmt" 18 "fmt"
19 "io/ioutil"
20 "os" 19 "os"
21 20
22 "github.com/prometheus/procfs/internal/fs" 21 "github.com/prometheus/procfs/internal/fs"
22 "github.com/prometheus/procfs/internal/util"
23) 23)
24 24
25// Originally, this USER_HZ value was dynamically retrieved via a sysconf call 25// Originally, this USER_HZ value was dynamically retrieved via a sysconf call
@@ -113,13 +113,7 @@ func (p Proc) NewStat() (ProcStat, error) {
113 113
114// Stat returns the current status information of the process. 114// Stat returns the current status information of the process.
115func (p Proc) Stat() (ProcStat, error) { 115func (p Proc) Stat() (ProcStat, error) {
116 f, err := os.Open(p.path("stat")) 116 data, err := util.ReadFileNoStat(p.path("stat"))
117 if err != nil {
118 return ProcStat{}, err
119 }
120 defer f.Close()
121
122 data, err := ioutil.ReadAll(f)
123 if err != nil { 117 if err != nil {
124 return ProcStat{}, err 118 return ProcStat{}, err
125 } 119 }
diff --git a/vendor/github.com/prometheus/procfs/proc_status.go b/vendor/github.com/prometheus/procfs/proc_status.go
index ad290fa..e30c2b8 100644
--- a/vendor/github.com/prometheus/procfs/proc_status.go
+++ b/vendor/github.com/prometheus/procfs/proc_status.go
@@ -15,10 +15,10 @@ package procfs
15 15
16import ( 16import (
17 "bytes" 17 "bytes"
18 "io/ioutil"
19 "os"
20 "strconv" 18 "strconv"
21 "strings" 19 "strings"
20
21 "github.com/prometheus/procfs/internal/util"
22) 22)
23 23
24// ProcStatus provides status information about the process, 24// ProcStatus provides status information about the process,
@@ -75,13 +75,7 @@ type ProcStatus struct {
75 75
76// NewStatus returns the current status information of the process. 76// NewStatus returns the current status information of the process.
77func (p Proc) NewStatus() (ProcStatus, error) { 77func (p Proc) NewStatus() (ProcStatus, error) {
78 f, err := os.Open(p.path("status")) 78 data, err := util.ReadFileNoStat(p.path("status"))
79 if err != nil {
80 return ProcStatus{}, err
81 }
82 defer f.Close()
83
84 data, err := ioutil.ReadAll(f)
85 if err != nil { 79 if err != nil {
86 return ProcStatus{}, err 80 return ProcStatus{}, err
87 } 81 }
diff --git a/vendor/github.com/prometheus/procfs/stat.go b/vendor/github.com/prometheus/procfs/stat.go
index 6661ee0..b2a6fc9 100644
--- a/vendor/github.com/prometheus/procfs/stat.go
+++ b/vendor/github.com/prometheus/procfs/stat.go
@@ -15,13 +15,14 @@ package procfs
15 15
16import ( 16import (
17 "bufio" 17 "bufio"
18 "bytes"
18 "fmt" 19 "fmt"
19 "io" 20 "io"
20 "os"
21 "strconv" 21 "strconv"
22 "strings" 22 "strings"
23 23
24 "github.com/prometheus/procfs/internal/fs" 24 "github.com/prometheus/procfs/internal/fs"
25 "github.com/prometheus/procfs/internal/util"
25) 26)
26 27
27// CPUStat shows how much time the cpu spend in various stages. 28// CPUStat shows how much time the cpu spend in various stages.
@@ -164,16 +165,15 @@ func (fs FS) NewStat() (Stat, error) {
164// Stat returns information about current cpu/process statistics. 165// Stat returns information about current cpu/process statistics.
165// See https://www.kernel.org/doc/Documentation/filesystems/proc.txt 166// See https://www.kernel.org/doc/Documentation/filesystems/proc.txt
166func (fs FS) Stat() (Stat, error) { 167func (fs FS) Stat() (Stat, error) {
167 168 fileName := fs.proc.Path("stat")
168 f, err := os.Open(fs.proc.Path("stat")) 169 data, err := util.ReadFileNoStat(fileName)
169 if err != nil { 170 if err != nil {
170 return Stat{}, err 171 return Stat{}, err
171 } 172 }
172 defer f.Close()
173 173
174 stat := Stat{} 174 stat := Stat{}
175 175
176 scanner := bufio.NewScanner(f) 176 scanner := bufio.NewScanner(bytes.NewReader(data))
177 for scanner.Scan() { 177 for scanner.Scan() {
178 line := scanner.Text() 178 line := scanner.Text()
179 parts := strings.Fields(scanner.Text()) 179 parts := strings.Fields(scanner.Text())
@@ -237,7 +237,7 @@ func (fs FS) Stat() (Stat, error) {
237 } 237 }
238 238
239 if err := scanner.Err(); err != nil { 239 if err := scanner.Err(); err != nil {
240 return Stat{}, fmt.Errorf("couldn't parse %s: %s", f.Name(), err) 240 return Stat{}, fmt.Errorf("couldn't parse %s: %s", fileName, err)
241 } 241 }
242 242
243 return stat, nil 243 return stat, nil
diff --git a/vendor/github.com/prometheus/procfs/sysfs/class_powercap.go b/vendor/github.com/prometheus/procfs/sysfs/class_powercap.go
new file mode 100644
index 0000000..c8b0055
--- /dev/null
+++ b/vendor/github.com/prometheus/procfs/sysfs/class_powercap.go
@@ -0,0 +1,112 @@
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
16package sysfs
17
18import (
19 "errors"
20 "io/ioutil"
21 "path/filepath"
22 "strconv"
23 "strings"
24
25 "github.com/prometheus/procfs/internal/util"
26)
27
28// RaplZone stores the information for one RAPL power zone
29type RaplZone struct {
30 Name string // name of RAPL zone from file "name"
31 Index int // index (different value for duplicate names)
32 Path string // filesystem path of RaplZone
33 MaxMicrojoules uint64 // max RAPL microjoule value
34}
35
36// GetRaplZones returns a slice of RaplZones
37// When RAPL files are not present, returns nil with error
38// https://www.kernel.org/doc/Documentation/power/powercap/powercap.txt
39func GetRaplZones(fs FS) ([]RaplZone, error) {
40 raplDir := fs.sys.Path("class/powercap")
41
42 files, err := ioutil.ReadDir(raplDir)
43 if err != nil {
44 return nil, errors.New(
45 "no sysfs powercap / RAPL power metrics files found")
46 }
47
48 var zones []RaplZone
49
50 // count name usages to avoid duplicates (label them with an index)
51 countNameUsages := make(map[string]int)
52
53 // loop through directory files searching for file "name" from subdirs
54 for _, f := range files {
55 nameFile := filepath.Join(raplDir, f.Name(), "/name")
56 nameBytes, err := ioutil.ReadFile(nameFile)
57 if err == nil {
58 // add new rapl zone since name file was found
59 name := strings.TrimSpace(string(nameBytes))
60
61 // get a pair of index and final name
62 index, name := getIndexAndName(countNameUsages,
63 name)
64
65 maxMicrojouleFilename := filepath.Join(raplDir, f.Name(),
66 "/max_energy_range_uj")
67 maxMicrojoules, err := util.ReadUintFromFile(maxMicrojouleFilename)
68 if err != nil {
69 return nil, err
70 }
71
72 zone := RaplZone{
73 Name: name,
74 Index: index,
75 Path: filepath.Join(raplDir, f.Name()),
76 MaxMicrojoules: maxMicrojoules,
77 }
78
79 zones = append(zones, zone)
80
81 // Store into map how many times this name has been used. There can
82 // be e.g. multiple "dram" instances without any index postfix. The
83 // count is then used for indexing
84 countNameUsages[name] = index + 1
85 }
86 }
87
88 return zones, nil
89}
90
91// GetEnergyMicrojoules returns the current microjoule value from the zone energy counter
92// https://www.kernel.org/doc/Documentation/power/powercap/powercap.txt
93func (rz RaplZone) GetEnergyMicrojoules() (uint64, error) {
94 return util.ReadUintFromFile(filepath.Join(rz.Path, "/energy_uj"))
95}
96
97// getIndexAndName returns a pair of (index, name) for a given name and name
98// counting map. Some RAPL-names have an index at the end, some have duplicates
99// without an index at the end. When the index is embedded in the name, it is
100// provided back as an integer, and stripped from the returned name. Usage
101// count is used when the index value is absent from the name.
102func getIndexAndName(countNameUsages map[string]int, name string) (int, string) {
103 length := len(name)
104 if length >= 2 {
105 index, err := strconv.Atoi(name[length-1:])
106 if name[length-2:length-1] == "-" && err == nil {
107 return index, name[:length-2]
108 }
109 }
110 // return count as the index, since name didn't have an index at the end
111 return countNameUsages[name], name
112}
diff --git a/vendor/modules.txt b/vendor/modules.txt
index 48dd325..0e82aef 100644
--- a/vendor/modules.txt
+++ b/vendor/modules.txt
@@ -47,7 +47,7 @@ github.com/prometheus/common/internal/bitbucket.org/ww/goautoneg
47github.com/prometheus/common/log 47github.com/prometheus/common/log
48github.com/prometheus/common/model 48github.com/prometheus/common/model
49github.com/prometheus/common/version 49github.com/prometheus/common/version
50# github.com/prometheus/procfs v0.0.5 50# github.com/prometheus/procfs v0.0.7
51github.com/prometheus/procfs 51github.com/prometheus/procfs
52github.com/prometheus/procfs/bcache 52github.com/prometheus/procfs/bcache
53github.com/prometheus/procfs/internal/fs 53github.com/prometheus/procfs/internal/fs
@@ -70,7 +70,7 @@ golang.org/x/net/bpf
70golang.org/x/net/internal/iana 70golang.org/x/net/internal/iana
71golang.org/x/net/internal/socket 71golang.org/x/net/internal/socket
72golang.org/x/net/ipv4 72golang.org/x/net/ipv4
73# golang.org/x/sync v0.0.0-20190423024810-112230192c58 73# golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e
74golang.org/x/sync/errgroup 74golang.org/x/sync/errgroup
75# golang.org/x/sys v0.0.0-20190902133755-9109b7679e13 75# golang.org/x/sys v0.0.0-20190902133755-9109b7679e13
76golang.org/x/sys/unix 76golang.org/x/sys/unix