From 59a4b3a9e4136ff6e1c5241b10199b98493d1c53 Mon Sep 17 00:00:00 2001 From: PrometheusBot Date: Sun, 12 Sep 2021 12:47:11 +0200 Subject: [PATCH 001/176] Update common Prometheus files (#411) Signed-off-by: prombot --- .github/workflows/golangci-lint.yml | 29 +++++++++++++++++++++++++++++ Makefile.common | 10 ++++++++-- 2 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/golangci-lint.yml diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml new file mode 100644 index 000000000..431fef711 --- /dev/null +++ b/.github/workflows/golangci-lint.yml @@ -0,0 +1,29 @@ +name: golangci-lint +on: + push: + paths: + - "go.sum" + - "go.mod" + - "**.go" + - "scripts/errcheck_excludes.txt" + - ".github/workflows/golangci-lint.yml" + pull_request: + paths: + - "go.sum" + - "go.mod" + - "**.go" + - "scripts/errcheck_excludes.txt" + - ".github/workflows/golangci-lint.yml" + +jobs: + golangci: + name: lint + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Lint + uses: golangci/golangci-lint-action@v2 + with: + version: v1.42.0 diff --git a/Makefile.common b/Makefile.common index a1b1ca40f..99e8f9f1b 100644 --- a/Makefile.common +++ b/Makefile.common @@ -83,12 +83,18 @@ PROMU_URL := https://github.com/prometheus/promu/releases/download/v$(PROMU_ GOLANGCI_LINT := GOLANGCI_LINT_OPTS ?= -GOLANGCI_LINT_VERSION ?= v1.39.0 +GOLANGCI_LINT_VERSION ?= v1.42.0 # golangci-lint only supports linux, darwin and windows platforms on i386/amd64. # windows isn't included here because of the path separator being different. ifeq ($(GOHOSTOS),$(filter $(GOHOSTOS),linux darwin)) ifeq ($(GOHOSTARCH),$(filter $(GOHOSTARCH),amd64 i386)) - GOLANGCI_LINT := $(FIRST_GOPATH)/bin/golangci-lint + # If we're in CI and there is an Actions file, that means the linter + # is being run in Actions, so we don't need to run it here. + ifeq (,$(CIRCLE_JOB)) + GOLANGCI_LINT := $(FIRST_GOPATH)/bin/golangci-lint + else ifeq (,$(wildcard .github/workflows/golangci-lint.yml)) + GOLANGCI_LINT := $(FIRST_GOPATH)/bin/golangci-lint + endif endif endif From 31627db7c2c053433fb8e713f8f84525a25ba811 Mon Sep 17 00:00:00 2001 From: Serhii Zasenko Date: Mon, 20 Sep 2021 12:02:48 +0300 Subject: [PATCH 002/176] Fixed ARP table MAC address parsing, added Flags field (#414) * fixed arp table mac address parsing - Added ARPEntry.Flags field related to entry flags - Added ARPEntry.IsComplete() to check if entry is complete - Fixed mac address parsing and error handling - Test improved with incomplete entry information Closes #413. Signed-off-by: Serhii Zasenko * Arp flag const names cleanup Signed-off-by: Serhii Zasenko --- arp.go | 41 ++++++++++++++++++++++++++++++++++++----- arp_test.go | 28 ++++++++++++++++++++++++++-- fixtures.ttar | 3 ++- 3 files changed, 64 insertions(+), 8 deletions(-) diff --git a/arp.go b/arp.go index 4e47e6172..d4537821a 100644 --- a/arp.go +++ b/arp.go @@ -17,9 +17,26 @@ import ( "fmt" "io/ioutil" "net" + "strconv" "strings" ) +// Learned from include/uapi/linux/if_arp.h +const ( + // completed entry (ha valid) + ATFComplete = 0x02 + // permanent entry + ATFPermanent = 0x04 + // Publish entry + ATFPublish = 0x08 + // Has requested trailers + ATFUseTrailers = 0x10 + // Obsoleted: Want to use a netmask (only for proxy entries) + ATFNetmask = 0x20 + // Don't answer this addresses + ATFDontPublish = 0x40 +) + // ARPEntry contains a single row of the columnar data represented in // /proc/net/arp. type ARPEntry struct { @@ -29,6 +46,8 @@ type ARPEntry struct { HWAddr net.HardwareAddr // Name of the device Device string + // Flags + Flags byte } // GatherARPEntries retrieves all the ARP entries, parse the relevant columns, @@ -72,14 +91,26 @@ func parseARPEntries(data []byte) ([]ARPEntry, error) { } func parseARPEntry(columns []string) (ARPEntry, error) { + entry := ARPEntry{Device: columns[5]} ip := net.ParseIP(columns[0]) - mac := net.HardwareAddr(columns[3]) + entry.IPAddr = ip + + if mac, err := net.ParseMAC(columns[3]); err == nil { + entry.HWAddr = mac + } else { + return ARPEntry{}, err + } - entry := ARPEntry{ - IPAddr: ip, - HWAddr: mac, - Device: columns[5], + if flags, err := strconv.ParseUint(columns[2], 0, 8); err == nil { + entry.Flags = byte(flags) + } else { + return ARPEntry{}, err } return entry, nil } + +// IsComplete returns true if ARP entry is marked with complete flag +func (entry *ARPEntry) IsComplete() bool { + return entry.Flags&ATFComplete != 0 +} diff --git a/arp_test.go b/arp_test.go index 272567b71..0edaef51b 100644 --- a/arp_test.go +++ b/arp_test.go @@ -33,11 +33,35 @@ func TestARP(t *testing.T) { t.Errorf("want 192.168.224.1, got %s", got) } - if want, got := net.HardwareAddr("00:50:56:c0:00:08").String(), arpFile[0].HWAddr.String(); want != got { - t.Errorf("want 00:50:56:c0:00:08, got %s", got) + if want, got := "00:50:56:c0:00:08", arpFile[0].HWAddr.String(); want != got { + t.Errorf("want %s, got %s", want, got) } if want, got := "ens33", arpFile[0].Device; want != got { t.Errorf("want ens33, got %s", got) } + + if want, got := true, arpFile[0].IsComplete(); want != got { + t.Errorf("want %t, got %t", want, got) + } + + if want, got := "192.168.224.2", arpFile[1].IPAddr.String(); want != got { + t.Errorf("want 192.168.224.2, got %s", got) + } + + if want, got := make(net.HardwareAddr, 6).String(), arpFile[1].HWAddr.String(); want != got { + t.Errorf("expected empty MAC, got %s", got) + } + + if want, got := "ens33", arpFile[1].Device; want != got { + t.Errorf("want %s, got %s", want, got) + } + + if want, got := byte(0x0), arpFile[1].Flags; want != got { + t.Errorf("want %b, got %b", want, got) + } + + if want, got := false, arpFile[1].IsComplete(); want != got { + t.Errorf("want %t, got %t", want, got) + } } diff --git a/fixtures.ttar b/fixtures.ttar index 30df09144..83ab1551d 100644 --- a/fixtures.ttar +++ b/fixtures.ttar @@ -2084,9 +2084,10 @@ Directory: fixtures/proc/net Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: fixtures/proc/net/arp -Lines: 2 +Lines: 3 IP address HW type Flags HW address Mask Device 192.168.224.1 0x1 0x2 00:50:56:c0:00:08 * ens33 +192.168.224.2 0x1 0x0 00:00:00:00:00:00 * ens33 Mode: 664 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: fixtures/proc/net/dev From 1a7a2bd3279f8809ed8c293299b889fa30baae4b Mon Sep 17 00:00:00 2001 From: Benjamin Drung Date: Fri, 27 Aug 2021 09:35:31 +0200 Subject: [PATCH 003/176] Add support for DMI information The sysfs contains some useful information about the BIOS, board, chassis, product, and system from the Desktop Management Interface (DMI). The BIOS version should be exported by the Prometheus node exporter to support alerting about outdated BIOS versions. Add a `DMIClass` function to collect the information for the node exporter. Signed-off-by: Benjamin Drung --- fixtures.ttar | 116 +++++++++++++++++++++++++++++++++++ sysfs/class_dmi.go | 131 ++++++++++++++++++++++++++++++++++++++++ sysfs/class_dmi_test.go | 80 ++++++++++++++++++++++++ 3 files changed, 327 insertions(+) create mode 100644 sysfs/class_dmi.go create mode 100644 sysfs/class_dmi_test.go diff --git a/fixtures.ttar b/fixtures.ttar index 83ab1551d..e005ee94a 100644 --- a/fixtures.ttar +++ b/fixtures.ttar @@ -3478,6 +3478,122 @@ Mode: 664 Directory: fixtures/sys/class Mode: 775 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/class/dmi +Mode: 775 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/class/dmi/id +Mode: 775 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/class/dmi/id/bios_date +Lines: 1 +04/12/2021 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/class/dmi/id/bios_release +Lines: 1 +2.2 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/class/dmi/id/bios_vendor +Lines: 1 +Dell Inc. +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/class/dmi/id/bios_version +Lines: 1 +2.2.4 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/class/dmi/id/board_name +Lines: 1 +07PXPY +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/class/dmi/id/board_serial +Lines: 1 +.7N62AI2.GRTCL6944100GP. +Mode: 400 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/class/dmi/id/board_vendor +Lines: 1 +Dell Inc. +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/class/dmi/id/board_version +Lines: 1 +A01 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/class/dmi/id/chassis_asset_tag +Lines: 1 + +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/class/dmi/id/chassis_serial +Lines: 1 +7N62AI2 +Mode: 400 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/class/dmi/id/chassis_type +Lines: 1 +23 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/class/dmi/id/chassis_vendor +Lines: 1 +Dell Inc. +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/class/dmi/id/chassis_version +Lines: 1 + +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/class/dmi/id/modalias +Lines: 1 +dmi:bvnDellInc.:bvr2.2.4:bd04/12/2021:br2.2:svnDellInc.:pnPowerEdgeR6515:pvr:rvnDellInc.:rn07PXPY:rvrA01:cvnDellInc.:ct23:cvr: +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/class/dmi/id/product_family +Lines: 1 +PowerEdge +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/class/dmi/id/product_name +Lines: 1 +PowerEdge R6515 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/class/dmi/id/product_serial +Lines: 1 +7N62AI2 +Mode: 400 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/class/dmi/id/product_sku +Lines: 1 +SKU=NotProvided;ModelName=PowerEdge R6515 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/class/dmi/id/product_uuid +Lines: 1 +83340ca8-cb49-4474-8c29-d2088ca84dd9 +Mode: 400 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/class/dmi/id/product_version +Lines: 1 + +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/class/dmi/id/sys_vendor +Lines: 1 +Dell Inc. +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/class/dmi/id/uevent +Lines: 1 +MODALIAS=dmi:bvnDellInc.:bvr2.2.4:bd04/12/2021:br2.2:svnDellInc.:pnPowerEdgeR6515:pvr:rvnDellInc.:rn07PXPY:rvrA01:cvnDellInc.:ct23:cvr: +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: fixtures/sys/class/drm Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sysfs/class_dmi.go b/sysfs/class_dmi.go new file mode 100644 index 000000000..13878536f --- /dev/null +++ b/sysfs/class_dmi.go @@ -0,0 +1,131 @@ +// Copyright 2021 The Prometheus Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// +build linux + +package sysfs + +import ( + "fmt" + "io/ioutil" + "os" + "path/filepath" + + "github.com/prometheus/procfs/internal/util" +) + +const dmiClassPath = "class/dmi/id" + +// DMIClass contains info from files in /sys/class/dmi/id. +type DMIClass struct { + BiosDate *string // /sys/class/dmi/id/bios_date + BiosRelease *string // /sys/class/dmi/id/bios_release + BiosVendor *string // /sys/class/dmi/id/bios_vendor + BiosVersion *string // /sys/class/dmi/id/bios_version + BoardAssetTag *string // /sys/class/dmi/id/board_asset_tag + BoardName *string // /sys/class/dmi/id/board_name + BoardSerial *string // /sys/class/dmi/id/board_serial + BoardVendor *string // /sys/class/dmi/id/board_vendor + BoardVersion *string // /sys/class/dmi/id/board_version + ChassisAssetTag *string // /sys/class/dmi/id/chassis_asset_tag + ChassisSerial *string // /sys/class/dmi/id/chassis_serial + ChassisType *string // /sys/class/dmi/id/chassis_type + ChassisVendor *string // /sys/class/dmi/id/chassis_vendor + ChassisVersion *string // /sys/class/dmi/id/chassis_version + ProductFamily *string // /sys/class/dmi/id/product_family + ProductName *string // /sys/class/dmi/id/product_name + ProductSerial *string // /sys/class/dmi/id/product_serial + ProductSKU *string // /sys/class/dmi/id/product_sku + ProductUUID *string // /sys/class/dmi/id/product_uuid + ProductVersion *string // /sys/class/dmi/id/product_version + SystemVendor *string // /sys/class/dmi/id/sys_vendor +} + +// DMIClass returns Desktop Management Interface (DMI) information read from /sys/class/dmi. +func (fs FS) DMIClass() (*DMIClass, error) { + path := fs.sys.Path(dmiClassPath) + + files, err := ioutil.ReadDir(path) + if err != nil { + return nil, fmt.Errorf("failed to read directory %q: %w", path, err) + } + + var dmi DMIClass + for _, f := range files { + if !f.Mode().IsRegular() { + continue + } + + name := f.Name() + if name == "modalias" || name == "uevent" { + continue + } + + filename := filepath.Join(path, name) + value, err := util.SysReadFile(filename) + if err != nil { + if os.IsPermission(err) { + // Only root is allowed to read the serial and product_uuid files! + continue + } + return nil, fmt.Errorf("failed to read file %q: %w", filename, err) + } + + switch name { + case "bios_date": + dmi.BiosDate = &value + case "bios_release": + dmi.BiosRelease = &value + case "bios_vendor": + dmi.BiosVendor = &value + case "bios_version": + dmi.BiosVersion = &value + case "board_asset_tag": + dmi.BoardAssetTag = &value + case "board_name": + dmi.BoardName = &value + case "board_serial": + dmi.BoardSerial = &value + case "board_vendor": + dmi.BoardVendor = &value + case "board_version": + dmi.BoardVersion = &value + case "chassis_asset_tag": + dmi.ChassisAssetTag = &value + case "chassis_serial": + dmi.ChassisSerial = &value + case "chassis_type": + dmi.ChassisType = &value + case "chassis_vendor": + dmi.ChassisVendor = &value + case "chassis_version": + dmi.ChassisVersion = &value + case "product_family": + dmi.ProductFamily = &value + case "product_name": + dmi.ProductName = &value + case "product_serial": + dmi.ProductSerial = &value + case "product_sku": + dmi.ProductSKU = &value + case "product_uuid": + dmi.ProductUUID = &value + case "product_version": + dmi.ProductVersion = &value + case "sys_vendor": + dmi.SystemVendor = &value + } + } + + return &dmi, nil +} diff --git a/sysfs/class_dmi_test.go b/sysfs/class_dmi_test.go new file mode 100644 index 000000000..9e3d1187b --- /dev/null +++ b/sysfs/class_dmi_test.go @@ -0,0 +1,80 @@ +// Copyright 2021 The Prometheus Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// +build linux + +package sysfs + +import ( + "testing" + + "github.com/google/go-cmp/cmp" +) + +func TestDMIClass(t *testing.T) { + fs, err := NewFS(sysTestFixtures) + if err != nil { + t.Fatal(err) + } + + got, err := fs.DMIClass() + if err != nil { + t.Fatal(err) + } + + empty := "" + biosDate := "04/12/2021" + biosRelease := "2.2" + biosVendor := "Dell Inc." + biosVersion := "2.2.4" + boardName := "07PXPY" + boardSerial := ".7N62AI2.GRTCL6944100GP." + boardVendor := "Dell Inc." + boardVersion := "A01" + chassisSerial := "7N62AI2" + chassisType := "23" + chassisVendor := "Dell Inc." + productFamily := "PowerEdge" + productName := "PowerEdge R6515" + productSerial := "7N62AI2" + productSKU := "SKU=NotProvided;ModelName=PowerEdge R6515" + productUUID := "83340ca8-cb49-4474-8c29-d2088ca84dd9" + systemVendor := "Dell Inc." + + want := &DMIClass{ + BiosDate: &biosDate, + BiosRelease: &biosRelease, + BiosVendor: &biosVendor, + BiosVersion: &biosVersion, + BoardName: &boardName, + BoardSerial: &boardSerial, + BoardVendor: &boardVendor, + BoardVersion: &boardVersion, + ChassisAssetTag: &empty, + ChassisSerial: &chassisSerial, + ChassisType: &chassisType, + ChassisVendor: &chassisVendor, + ChassisVersion: &empty, + ProductFamily: &productFamily, + ProductName: &productName, + ProductSerial: &productSerial, + ProductSKU: &productSKU, + ProductUUID: &productUUID, + ProductVersion: &empty, + SystemVendor: &systemVendor, + } + + if diff := cmp.Diff(want, got); diff != "" { + t.Fatalf("unexpected DMI class (-want +got):\n%s", diff) + } +} From 4827ceaa1e28311950d45381572894886e09002d Mon Sep 17 00:00:00 2001 From: PrometheusBot Date: Sat, 23 Oct 2021 09:51:35 +0200 Subject: [PATCH 004/176] Update common Prometheus files (#416) Signed-off-by: prombot --- Makefile.common | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.common b/Makefile.common index 99e8f9f1b..ed7d1826e 100644 --- a/Makefile.common +++ b/Makefile.common @@ -160,7 +160,7 @@ endif update-go-deps: @echo ">> updating Go dependencies" @for m in $$($(GO) list -mod=readonly -m -f '{{ if and (not .Indirect) (not .Main)}}{{.Path}}{{end}}' all); do \ - $(GO) get $$m; \ + $(GO) get -d $$m; \ done GO111MODULE=$(GO111MODULE) $(GO) mod tidy ifneq (,$(wildcard vendor)) From a23e3bc9b76a9d2fe6f60af7c6114c8cd646ced3 Mon Sep 17 00:00:00 2001 From: PrometheusBot Date: Sat, 30 Oct 2021 18:12:23 +0200 Subject: [PATCH 005/176] Update common Prometheus files (#417) Signed-off-by: prombot --- .github/workflows/golangci-lint.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index 431fef711..f96c76a65 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -7,6 +7,7 @@ on: - "**.go" - "scripts/errcheck_excludes.txt" - ".github/workflows/golangci-lint.yml" + - ".golangci.yml" pull_request: paths: - "go.sum" @@ -14,6 +15,7 @@ on: - "**.go" - "scripts/errcheck_excludes.txt" - ".github/workflows/golangci-lint.yml" + - ".golangci.yml" jobs: golangci: From 4f613c67c6f5bca1f4cd25e3442c12e21e71c40a Mon Sep 17 00:00:00 2001 From: Sergei Semenchuk Date: Sat, 30 Oct 2021 19:13:42 +0300 Subject: [PATCH 006/176] netstat change uint size to 64 bits (#419) Signed-off-by: binjip978 --- netstat.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/netstat.go b/netstat.go index 94d892f11..12e2318bf 100644 --- a/netstat.go +++ b/netstat.go @@ -23,8 +23,8 @@ import ( // NetStat contains statistics for all the counters from one file type NetStat struct { - Filename string Stats map[string][]uint64 + Filename string } // NetStat retrieves stats from /proc/net/stat/ @@ -55,7 +55,7 @@ func (fs FS) NetStat() ([]NetStat, error) { // Other strings represent per-CPU counters for scanner.Scan() { for num, counter := range strings.Fields(scanner.Text()) { - value, err := strconv.ParseUint(counter, 16, 32) + value, err := strconv.ParseUint(counter, 16, 64) if err != nil { return nil, err } From 081c329e5d756df63cd3da6442c9afef3f0d349a Mon Sep 17 00:00:00 2001 From: bo-er <49479987+bo-er@users.noreply.github.com> Date: Thu, 25 Nov 2021 05:38:23 +0800 Subject: [PATCH 007/176] Fix bug when /proc/net/dev contains unexpected line (#421) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix bug when /proc/net/dev contains unexpected line Signed-off-by: 吴家榜 <14038@chinasws.com> * modifying netDev.parseLine due to odd interface name Signed-off-by: 吴家榜 <14038@chinasws.com> * adding testing case for net device that has colon in its name Signed-off-by: 吴家榜 <14038@chinasws.com> Co-authored-by: wujiabang Co-authored-by: 吴家榜 <14038@chinasws.com> --- net_dev.go | 8 ++++---- net_dev_test.go | 21 ++++++++++++--------- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/net_dev.go b/net_dev.go index 47a710bef..e66208aa0 100644 --- a/net_dev.go +++ b/net_dev.go @@ -87,17 +87,17 @@ func newNetDev(file string) (NetDev, error) { // parseLine parses a single line from the /proc/net/dev file. Header lines // must be filtered prior to calling this method. func (netDev NetDev) parseLine(rawLine string) (*NetDevLine, error) { - parts := strings.SplitN(rawLine, ":", 2) - if len(parts) != 2 { + idx := strings.LastIndex(rawLine, ":") + if idx == -1 { return nil, errors.New("invalid net/dev line, missing colon") } - fields := strings.Fields(strings.TrimSpace(parts[1])) + fields := strings.Fields(strings.TrimSpace(rawLine[idx+1:])) var err error line := &NetDevLine{} // Interface Name - line.Name = strings.TrimSpace(parts[0]) + line.Name = strings.TrimSpace(rawLine[:idx]) if line.Name == "" { return nil, errors.New("invalid net/dev line, empty interface name") } diff --git a/net_dev_test.go b/net_dev_test.go index c26c7b295..fb5390e10 100644 --- a/net_dev_test.go +++ b/net_dev_test.go @@ -14,21 +14,24 @@ package procfs import ( + "fmt" "testing" ) func TestNetDevParseLine(t *testing.T) { - const rawLine = ` eth0: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16` - - have, err := NetDev{}.parseLine(rawLine) - if err != nil { - t.Fatal(err) + tc := []string{"eth0", "eth0:1"} + for i := range tc { + rawLine := fmt.Sprintf(` %v: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16`, tc[i]) + have, err := NetDev{}.parseLine(rawLine) + if err != nil { + t.Fatal(err) + } + want := NetDevLine{tc[i], 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16} + if want != *have { + t.Errorf("want %v, have %v", want, have) + } } - want := NetDevLine{"eth0", 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16} - if want != *have { - t.Errorf("want %v, have %v", want, have) - } } func TestNetDev(t *testing.T) { From 116b5c4f80ab09a0a6a848a7606652821b90d065 Mon Sep 17 00:00:00 2001 From: Ben Kochie Date: Thu, 25 Nov 2021 12:13:00 +0100 Subject: [PATCH 008/176] Lint comments (#422) * Add `godot` linter to validate comments. * Clenup a bunch of comments. * Replace deprecated golint with revive. Signed-off-by: SuperQ --- .golangci.yml | 10 +++++++++- arp.go | 16 ++++++++-------- bcache/bcache.go | 2 +- bcache/get.go | 4 ++-- blockdevice/stats.go | 16 ++++++++-------- btrfs/get.go | 4 ++-- cpuinfo.go | 4 ++-- internal/fs/fs.go | 2 +- iscsi/get.go | 17 ++++++++--------- iscsi/iscsi.go | 30 ++++++++++++++---------------- loadavg.go | 2 +- net_conntrackstat.go | 12 ++++++------ net_ip_socket.go | 2 +- net_protocols.go | 4 ++-- net_softnet.go | 8 ++++---- netstat.go | 4 ++-- nfs/nfs.go | 10 ++++++---- nfs/parse_nfs.go | 2 +- nfs/parse_nfsd.go | 2 +- proc.go | 4 ++-- proc_cgroup.go | 6 +++--- proc_environ.go | 2 +- proc_fdinfo.go | 3 +-- proc_limits.go | 2 +- proc_maps.go | 10 +++++----- proc_psi.go | 14 ++++++++------ proc_psi_test.go | 2 +- proc_smaps.go | 22 +++++++++++----------- proc_stat.go | 2 +- proc_status.go | 32 ++++++++++++++++---------------- schedstat.go | 6 +++--- schedstat_test.go | 2 +- slab.go | 2 +- stat.go | 10 +++++----- sysfs/class_fibrechannel.go | 2 +- sysfs/class_infiniband.go | 4 ++-- sysfs/class_powercap.go | 14 +++++++------- sysfs/class_scsitape.go | 2 +- sysfs/clocksource.go | 4 ++-- sysfs/net_class.go | 2 +- sysfs/system_cpu.go | 16 ++++++++-------- sysfs/vulnerability.go | 2 +- vm.go | 2 +- xfs/parse.go | 14 +++++++------- 44 files changed, 170 insertions(+), 162 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 0aa09edac..a197699a1 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,4 +1,12 @@ --- linters: enable: - - golint + - godot + - revive + +linter-settings: + godot: + capital: true + exclude: + # Ignore "See: URL" + - 'See:' diff --git a/arp.go b/arp.go index d4537821a..1f2616a96 100644 --- a/arp.go +++ b/arp.go @@ -21,19 +21,19 @@ import ( "strings" ) -// Learned from include/uapi/linux/if_arp.h +// Learned from include/uapi/linux/if_arp.h. const ( - // completed entry (ha valid) + // completed entry (ha valid). ATFComplete = 0x02 - // permanent entry + // permanent entry. ATFPermanent = 0x04 - // Publish entry + // Publish entry. ATFPublish = 0x08 - // Has requested trailers + // Has requested trailers. ATFUseTrailers = 0x10 - // Obsoleted: Want to use a netmask (only for proxy entries) + // Obsoleted: Want to use a netmask (only for proxy entries). ATFNetmask = 0x20 - // Don't answer this addresses + // Don't answer this addresses. ATFDontPublish = 0x40 ) @@ -110,7 +110,7 @@ func parseARPEntry(columns []string) (ARPEntry, error) { return entry, nil } -// IsComplete returns true if ARP entry is marked with complete flag +// IsComplete returns true if ARP entry is marked with complete flag. func (entry *ARPEntry) IsComplete() bool { return entry.Flags&ATFComplete != 0 } diff --git a/bcache/bcache.go b/bcache/bcache.go index 1176a558a..5ba7e767c 100644 --- a/bcache/bcache.go +++ b/bcache/bcache.go @@ -29,7 +29,7 @@ type Stats struct { } // BcacheStats contains statistics tied to a bcache ID. -type BcacheStats struct { // nolint:golint +type BcacheStats struct { // nolint:revive AverageKeySize uint64 BtreeCacheSize uint64 CacheAvailablePercent uint64 diff --git a/bcache/get.go b/bcache/get.go index b1b9da7a8..26638e9ee 100644 --- a/bcache/get.go +++ b/bcache/get.go @@ -51,8 +51,8 @@ func NewFS(mountPoint string) (FS, error) { return FS{&fs}, nil } -// Stats is a wrapper around stats() -// It returns full available statistics +// Stats is a wrapper around stats(). +// It returns full available statistics. func (fs FS) Stats() ([]*Stats, error) { return fs.stats(true) } diff --git a/blockdevice/stats.go b/blockdevice/stats.go index 52139d3e8..56911fbec 100644 --- a/blockdevice/stats.go +++ b/blockdevice/stats.go @@ -25,17 +25,17 @@ import ( "github.com/prometheus/procfs/internal/fs" ) -// Info contains identifying information for a block device such as a disk drive +// Info contains identifying information for a block device such as a disk drive. type Info struct { MajorNumber uint32 MinorNumber uint32 DeviceName string } -// IOStats models the iostats data described in the kernel documentation -// https://www.kernel.org/doc/Documentation/iostats.txt, -// https://www.kernel.org/doc/Documentation/block/stat.txt, -// and https://www.kernel.org/doc/Documentation/ABI/testing/procfs-diskstats +// IOStats models the iostats data described in the kernel documentation. +// - https://www.kernel.org/doc/Documentation/iostats.txt, +// - https://www.kernel.org/doc/Documentation/block/stat.txt +// - https://www.kernel.org/doc/Documentation/ABI/testing/procfs-diskstats type IOStats struct { // ReadIOs is the number of reads completed successfully. ReadIOs uint64 @@ -76,7 +76,7 @@ type IOStats struct { TimeSpentFlushing uint64 } -// Diskstats combines the device Info and IOStats +// Diskstats combines the device Info and IOStats. type Diskstats struct { Info IOStats @@ -220,7 +220,7 @@ func NewFS(procMountPoint string, sysMountPoint string) (FS, error) { } // ProcDiskstats reads the diskstats file and returns -// an array of Diskstats (one per line/device) +// an array of Diskstats (one per line/device). func (fs FS) ProcDiskstats() ([]Diskstats, error) { file, err := os.Open(fs.proc.Path(procDiskstatsPath)) if err != nil { @@ -266,7 +266,7 @@ func (fs FS) ProcDiskstats() ([]Diskstats, error) { return diskstats, scanner.Err() } -// SysBlockDevices lists the device names from /sys/block/ +// SysBlockDevices lists the device names from /sys/block/. func (fs FS) SysBlockDevices() ([]string, error) { deviceDirs, err := ioutil.ReadDir(fs.sys.Path(sysBlockPath)) if err != nil { diff --git a/btrfs/get.go b/btrfs/get.go index fa70daa51..cb28959e1 100644 --- a/btrfs/get.go +++ b/btrfs/get.go @@ -80,7 +80,7 @@ func (fs FS) Stats() ([]*Stats, error) { return stats, nil } -// GetStats collects all Btrfs statistics from sysfs +// GetStats collects all Btrfs statistics from sysfs. func GetStats(uuidPath string) (*Stats, error) { r := &reader{path: uuidPath} s := r.readFilesystemStats() @@ -162,7 +162,7 @@ func (r *reader) readAllocationStats(d string) (a *AllocationStats) { return } -// readLayouts reads all Btrfs layout statistics for the current path +// readLayouts reads all Btrfs layout statistics for the current path. func (r *reader) readLayouts() map[string]*LayoutUsage { files, err := ioutil.ReadDir(r.path) if err != nil { diff --git a/cpuinfo.go b/cpuinfo.go index 5623b24a1..0c09336d8 100644 --- a/cpuinfo.go +++ b/cpuinfo.go @@ -27,7 +27,7 @@ import ( "github.com/prometheus/procfs/internal/util" ) -// CPUInfo contains general information about a system CPU found in /proc/cpuinfo +// CPUInfo contains general information about a system CPU found in /proc/cpuinfo. type CPUInfo struct { Processor uint VendorID string @@ -469,7 +469,7 @@ func parseCPUInfoDummy(_ []byte) ([]CPUInfo, error) { // nolint:unused,deadcode } // firstNonEmptyLine advances the scanner to the first non-empty line -// and returns the contents of that line +// and returns the contents of that line. func firstNonEmptyLine(scanner *bufio.Scanner) string { for scanner.Scan() { line := scanner.Text() diff --git a/internal/fs/fs.go b/internal/fs/fs.go index 0040753b1..3c18c7610 100644 --- a/internal/fs/fs.go +++ b/internal/fs/fs.go @@ -26,7 +26,7 @@ const ( // DefaultSysMountPoint is the common mount point of the sys filesystem. DefaultSysMountPoint = "/sys" - // DefaultConfigfsMountPoint is the common mount point of the configfs + // DefaultConfigfsMountPoint is the common mount point of the configfs. DefaultConfigfsMountPoint = "/sys/kernel/config" ) diff --git a/iscsi/get.go b/iscsi/get.go index 14d7062f6..347edd993 100644 --- a/iscsi/get.go +++ b/iscsi/get.go @@ -26,8 +26,8 @@ import ( "github.com/prometheus/procfs/internal/util" ) -// GetStats is the main iscsi status information func -// building the path and prepare info for enable iscsi +// GetStats is the main iscsi status information func for +// building the path and prepare info for enable iscsi. func GetStats(iqnPath string) (*Stats, error) { var istats Stats @@ -58,8 +58,7 @@ func GetStats(iqnPath string) (*Stats, error) { return &istats, nil } -// isPathEnable is a utility function -// check if the file "enable" contain enable message +// isPathEnable checks if the file "enable" contain enable message. func isPathEnable(path string) (bool, error) { enableReadout, err := ioutil.ReadFile(filepath.Join(path, "enable")) if err != nil { @@ -104,7 +103,7 @@ func getLunLinkTarget(lunPath string) (lunObject LUN, err error) { } // ReadWriteOPS read and return the stat of read and write in megabytes, -// and total commands that send to the target +// and total commands that send to the target. func ReadWriteOPS(iqnPath string, tpgt string, lun string) (readmb uint64, writemb uint64, iops uint64, err error) { @@ -133,7 +132,7 @@ func ReadWriteOPS(iqnPath string, tpgt string, lun string) (readmb uint64, } // GetFileioUdev is getting the actual info to build up -// the FILEIO data and match with the enable target +// the FILEIO data and match with the enable target. func (fs FS) GetFileioUdev(fileioNumber string, objectName string) (*FILEIO, error) { fileio := FILEIO{ Name: "fileio_" + fileioNumber, @@ -155,7 +154,7 @@ func (fs FS) GetFileioUdev(fileioNumber string, objectName string) (*FILEIO, err } // GetIblockUdev is getting the actual info to build up -// the IBLOCK data and match with the enable target +// the IBLOCK data and match with the enable target. func (fs FS) GetIblockUdev(iblockNumber string, objectName string) (*IBLOCK, error) { iblock := IBLOCK{ Name: "iblock_" + iblockNumber, @@ -177,7 +176,7 @@ func (fs FS) GetIblockUdev(iblockNumber string, objectName string) (*IBLOCK, err } // GetRBDMatch is getting the actual info to build up -// the RBD data and match with the enable target +// the RBD data and match with the enable target. func (fs FS) GetRBDMatch(rbdNumber string, poolImage string) (*RBD, error) { rbd := RBD{ Name: "rbd_" + rbdNumber, @@ -222,7 +221,7 @@ func (fs FS) GetRBDMatch(rbdNumber string, poolImage string) (*RBD, error) { return nil, nil } -// GetRDMCPPath is getting the actual info to build up RDMCP data +// GetRDMCPPath is getting the actual info to build up RDMCP data. func (fs FS) GetRDMCPPath(rdmcpNumber string, objectName string) (*RDMCP, error) { rdmcp := RDMCP{ Name: "rd_mcp_" + rdmcpNumber, diff --git a/iscsi/iscsi.go b/iscsi/iscsi.go index 7bef01409..4ab7e36c3 100644 --- a/iscsi/iscsi.go +++ b/iscsi/iscsi.go @@ -23,21 +23,19 @@ import ( // iscsi target started with /sys/kernel/config/target/iscsi/iqn* // configfs + target/iscsi/iqn* -// iqnGlob is representing all the possible IQN +// iqnGlob is representing all the possible IQN. const iqnGlob = "target/iscsi/iqn*" // targetCore static path /sys/kernel/config/target/core for node_exporter -// reading runtime status +// reading runtime status. const targetCore = "target/core" // devicePath static path /sys/devices/rbd/[0-9]* for rbd devices to -// read at runtime status +// read at runtime status. const devicePath = "devices/rbd" // FS represents the pseudo-filesystem configfs, which provides an interface to -// iscsi kernel data structures in -// sysfs as /sys -// configfs as /sys/kernel/config +// iscsi kernel data structures in sysfs as /sys and configfs as /sys/kernel/config. type FS struct { sysfs *fs.FS configfs *fs.FS @@ -46,7 +44,7 @@ type FS struct { // NewFS returns a new configfs mounted under the given mount point. It will // error and return empty FS if the mount point can't be read. For the ease of // use, an empty string parameter configfsMountPoint will call internal fs for -// the default sys path as /sys/kernel/config +// the default sys path as /sys/kernel/config. func NewFS(sysfsPath string, configfsMountPoint string) (FS, error) { if strings.TrimSpace(sysfsPath) == "" { sysfsPath = fs.DefaultSysMountPoint @@ -65,12 +63,12 @@ func NewFS(sysfsPath string, configfsMountPoint string) (FS, error) { return FS{&sysfs, &configfs}, nil } -// helper function to get configfs path +// Path is a helper function to get configfs path. func (fs FS) Path(p ...string) string { return fs.configfs.Path(p...) } -// ISCSIStats getting iscsi runtime information +// ISCSIStats getting iscsi runtime information. func (fs FS) ISCSIStats() ([]*Stats, error) { matches, err := filepath.Glob(fs.configfs.Path(iqnGlob)) if err != nil { @@ -90,7 +88,7 @@ func (fs FS) ISCSIStats() ([]*Stats, error) { return stats, nil } -// TPGT struct for sys target portal group tag info +// TPGT struct for sys target portal group tag info. type TPGT struct { Name string // name of the tpgt group TpgtPath string // file path of tpgt @@ -98,7 +96,7 @@ type TPGT struct { Luns []LUN // the Luns that tpgt has } -// LUN struct for sys logical unit number info +// LUN struct for sys logical unit number info. type LUN struct { Name string // name of the lun LunPath string // file path of the lun @@ -107,7 +105,7 @@ type LUN struct { TypeNumber string // place holder for number of the device } -// FILEIO struct for backstore info +// FILEIO struct for backstore info. type FILEIO struct { Name string // name of the fileio Fnumber string // number related to the backstore @@ -115,7 +113,7 @@ type FILEIO struct { Filename string // link to the actual file being export } -// IBLOCK struct for backstore info +// IBLOCK struct for backstore info. type IBLOCK struct { Name string // name of the iblock Bnumber string // number related to the backstore @@ -123,7 +121,7 @@ type IBLOCK struct { Iblock string // link to the actual block being export } -// RBD struct for backstore info +// RBD struct for backstore info. type RBD struct { Name string // name of the rbd Rnumber string // number related to the backstore @@ -131,13 +129,13 @@ type RBD struct { Image string // place holder for the rbd image } -// RDMCP struct for backstore info +// RDMCP struct for backstore info. type RDMCP struct { Name string // name of the rdm_cp ObjectName string // place holder for object name } -// Stats struct for all targets info +// Stats struct for all targets info. type Stats struct { Name string Tpgt []TPGT diff --git a/loadavg.go b/loadavg.go index 0cce190ec..0096cafbd 100644 --- a/loadavg.go +++ b/loadavg.go @@ -21,7 +21,7 @@ import ( "github.com/prometheus/procfs/internal/util" ) -// LoadAvg represents an entry in /proc/loadavg +// LoadAvg represents an entry in /proc/loadavg. type LoadAvg struct { Load1 float64 Load5 float64 diff --git a/net_conntrackstat.go b/net_conntrackstat.go index 9964a3600..8300daca0 100644 --- a/net_conntrackstat.go +++ b/net_conntrackstat.go @@ -25,7 +25,7 @@ import ( ) // A ConntrackStatEntry represents one line from net/stat/nf_conntrack -// and contains netfilter conntrack statistics at one CPU core +// and contains netfilter conntrack statistics at one CPU core. type ConntrackStatEntry struct { Entries uint64 Found uint64 @@ -38,12 +38,12 @@ type ConntrackStatEntry struct { SearchRestart uint64 } -// ConntrackStat retrieves netfilter's conntrack statistics, split by CPU cores +// ConntrackStat retrieves netfilter's conntrack statistics, split by CPU cores. func (fs FS) ConntrackStat() ([]ConntrackStatEntry, error) { return readConntrackStat(fs.proc.Path("net", "stat", "nf_conntrack")) } -// Parses a slice of ConntrackStatEntries from the given filepath +// Parses a slice of ConntrackStatEntries from the given filepath. func readConntrackStat(path string) ([]ConntrackStatEntry, error) { // This file is small and can be read with one syscall. b, err := util.ReadFileNoStat(path) @@ -61,7 +61,7 @@ func readConntrackStat(path string) ([]ConntrackStatEntry, error) { return stat, nil } -// Reads the contents of a conntrack statistics file and parses a slice of ConntrackStatEntries +// Reads the contents of a conntrack statistics file and parses a slice of ConntrackStatEntries. func parseConntrackStat(r io.Reader) ([]ConntrackStatEntry, error) { var entries []ConntrackStatEntry @@ -79,7 +79,7 @@ func parseConntrackStat(r io.Reader) ([]ConntrackStatEntry, error) { return entries, nil } -// Parses a ConntrackStatEntry from given array of fields +// Parses a ConntrackStatEntry from given array of fields. func parseConntrackStatEntry(fields []string) (*ConntrackStatEntry, error) { if len(fields) != 17 { return nil, fmt.Errorf("invalid conntrackstat entry, missing fields") @@ -143,7 +143,7 @@ func parseConntrackStatEntry(fields []string) (*ConntrackStatEntry, error) { return entry, nil } -// Parses a uint64 from given hex in string +// Parses a uint64 from given hex in string. func parseConntrackStatField(field string) (uint64, error) { val, err := strconv.ParseUint(field, 16, 64) if err != nil { diff --git a/net_ip_socket.go b/net_ip_socket.go index 8c9ee3de8..7fd57d7f4 100644 --- a/net_ip_socket.go +++ b/net_ip_socket.go @@ -34,7 +34,7 @@ const ( readLimit = 4294967296 // Byte -> 4 GiB ) -// this contains generic data structures for both udp and tcp sockets +// This contains generic data structures for both udp and tcp sockets. type ( // NetIPSocket represents the contents of /proc/net/{t,u}dp{,6} file without the header. NetIPSocket []*netIPSocketLine diff --git a/net_protocols.go b/net_protocols.go index 8c6de3791..374b6f73f 100644 --- a/net_protocols.go +++ b/net_protocols.go @@ -23,7 +23,7 @@ import ( "github.com/prometheus/procfs/internal/util" ) -// NetProtocolStats stores the contents from /proc/net/protocols +// NetProtocolStats stores the contents from /proc/net/protocols. type NetProtocolStats map[string]NetProtocolStatLine // NetProtocolStatLine contains a single line parsed from /proc/net/protocols. We @@ -41,7 +41,7 @@ type NetProtocolStatLine struct { Capabilities NetProtocolCapabilities } -// NetProtocolCapabilities contains a list of capabilities for each protocol +// NetProtocolCapabilities contains a list of capabilities for each protocol. type NetProtocolCapabilities struct { Close bool // 8 Connect bool // 9 diff --git a/net_softnet.go b/net_softnet.go index 46f12c61d..a94f86dc4 100644 --- a/net_softnet.go +++ b/net_softnet.go @@ -30,13 +30,13 @@ import ( // * Linux 4.17 https://elixir.bootlin.com/linux/v4.17/source/net/core/net-procfs.c#L162 // and https://elixir.bootlin.com/linux/v4.17/source/include/linux/netdevice.h#L2810. -// SoftnetStat contains a single row of data from /proc/net/softnet_stat +// SoftnetStat contains a single row of data from /proc/net/softnet_stat. type SoftnetStat struct { - // Number of processed packets + // Number of processed packets. Processed uint32 - // Number of dropped packets + // Number of dropped packets. Dropped uint32 - // Number of times processing packets ran out of quota + // Number of times processing packets ran out of quota. TimeSqueezed uint32 } diff --git a/netstat.go b/netstat.go index 12e2318bf..dcea9c5a6 100644 --- a/netstat.go +++ b/netstat.go @@ -21,13 +21,13 @@ import ( "strings" ) -// NetStat contains statistics for all the counters from one file +// NetStat contains statistics for all the counters from one file. type NetStat struct { Stats map[string][]uint64 Filename string } -// NetStat retrieves stats from /proc/net/stat/ +// NetStat retrieves stats from `/proc/net/stat/`. func (fs FS) NetStat() ([]NetStat, error) { statFiles, err := filepath.Glob(fs.proc.Path("net/stat/*")) if err != nil { diff --git a/nfs/nfs.go b/nfs/nfs.go index 96e69ca56..6bf1b80c6 100644 --- a/nfs/nfs.go +++ b/nfs/nfs.go @@ -199,10 +199,12 @@ type ServerV4Stats struct { } // V4Ops models the "proc4ops" line: NFSv4 operations -// Variable list, see: -// v4.0 https://tools.ietf.org/html/rfc3010 (38 operations) -// v4.1 https://tools.ietf.org/html/rfc5661 (58 operations) -// v4.2 https://tools.ietf.org/html/draft-ietf-nfsv4-minorversion2-41 (71 operations) +// Variable list. +// See: +// - v4.0 https://tools.ietf.org/html/rfc3010 (38 operations) +// - v4.1 https://tools.ietf.org/html/rfc5661 (58 operations) +// - v4.2 https://tools.ietf.org/html/draft-ietf-nfsv4-minorversion2-41 (71 operations) +//nolint:godot type V4Ops struct { //Values uint64 // Variable depending on v4.x sub-version. TODO: Will this always at least include the fields in this struct? Op0Unused uint64 diff --git a/nfs/parse_nfs.go b/nfs/parse_nfs.go index 5de06b960..02bd5a95e 100644 --- a/nfs/parse_nfs.go +++ b/nfs/parse_nfs.go @@ -22,7 +22,7 @@ import ( "github.com/prometheus/procfs/internal/util" ) -// ParseClientRPCStats returns stats read from /proc/net/rpc/nfs +// ParseClientRPCStats returns stats read from /proc/net/rpc/nfs. func ParseClientRPCStats(r io.Reader) (*ClientRPCStats, error) { stats := &ClientRPCStats{} diff --git a/nfs/parse_nfsd.go b/nfs/parse_nfsd.go index 55c18f370..857ae3b96 100644 --- a/nfs/parse_nfsd.go +++ b/nfs/parse_nfsd.go @@ -22,7 +22,7 @@ import ( "github.com/prometheus/procfs/internal/util" ) -// ParseServerRPCStats returns stats read from /proc/net/rpc/nfsd +// ParseServerRPCStats returns stats read from /proc/net/rpc/nfsd. func ParseServerRPCStats(r io.Reader) (*ServerRPCStats, error) { stats := &ServerRPCStats{} diff --git a/proc.go b/proc.go index 28f696803..5b3e1e4a9 100644 --- a/proc.go +++ b/proc.go @@ -82,7 +82,7 @@ func (fs FS) Self() (Proc, error) { // NewProc returns a process for the given pid. // -// Deprecated: use fs.Proc() instead +// Deprecated: Use fs.Proc() instead. func (fs FS) NewProc(pid int) (Proc, error) { return fs.Proc(pid) } @@ -185,7 +185,7 @@ func (p Proc) Cwd() (string, error) { return wd, err } -// RootDir returns the absolute path to the process's root directory (as set by chroot) +// RootDir returns the absolute path to the process's root directory (as set by chroot). func (p Proc) RootDir() (string, error) { rdir, err := os.Readlink(p.path("root")) if os.IsNotExist(err) { diff --git a/proc_cgroup.go b/proc_cgroup.go index be45b7987..cca03327c 100644 --- a/proc_cgroup.go +++ b/proc_cgroup.go @@ -45,7 +45,7 @@ type Cgroup struct { } // parseCgroupString parses each line of the /proc/[pid]/cgroup file -// Line format is hierarchyID:[controller1,controller2]:path +// Line format is hierarchyID:[controller1,controller2]:path. func parseCgroupString(cgroupStr string) (*Cgroup, error) { var err error @@ -69,7 +69,7 @@ func parseCgroupString(cgroupStr string) (*Cgroup, error) { return cgroup, nil } -// parseCgroups reads each line of the /proc/[pid]/cgroup file +// parseCgroups reads each line of the /proc/[pid]/cgroup file. func parseCgroups(data []byte) ([]Cgroup, error) { var cgroups []Cgroup scanner := bufio.NewScanner(bytes.NewReader(data)) @@ -88,7 +88,7 @@ func parseCgroups(data []byte) ([]Cgroup, error) { // Cgroups reads from /proc//cgroups and returns a []*Cgroup struct locating this PID in each process // control hierarchy running on this system. On every system (v1 and v2), all hierarchies contain all processes, -// so the len of the returned struct is equal to the number of active hierarchies on this system +// so the len of the returned struct is equal to the number of active hierarchies on this system. func (p Proc) Cgroups() ([]Cgroup, error) { data, err := util.ReadFileNoStat(p.path("cgroup")) if err != nil { diff --git a/proc_environ.go b/proc_environ.go index 6134b3580..57a89895d 100644 --- a/proc_environ.go +++ b/proc_environ.go @@ -19,7 +19,7 @@ import ( "github.com/prometheus/procfs/internal/util" ) -// Environ reads process environments from /proc//environ +// Environ reads process environments from `/proc//environ`. func (p Proc) Environ() ([]string, error) { environments := make([]string, 0) diff --git a/proc_fdinfo.go b/proc_fdinfo.go index cf63227f0..1bbdd4a8e 100644 --- a/proc_fdinfo.go +++ b/proc_fdinfo.go @@ -22,7 +22,6 @@ import ( "github.com/prometheus/procfs/internal/util" ) -// Regexp variables var ( rPos = regexp.MustCompile(`^pos:\s+(\d+)$`) rFlags = regexp.MustCompile(`^flags:\s+(\d+)$`) @@ -122,7 +121,7 @@ func (p ProcFDInfos) Len() int { return len(p) } func (p ProcFDInfos) Swap(i, j int) { p[i], p[j] = p[j], p[i] } func (p ProcFDInfos) Less(i, j int) bool { return p[i].FD < p[j].FD } -// InotifyWatchLen returns the total number of inotify watches +// InotifyWatchLen returns the total number of inotify watches. func (p ProcFDInfos) InotifyWatchLen() (int, error) { length := 0 for _, f := range p { diff --git a/proc_limits.go b/proc_limits.go index dd20f198a..7a1388185 100644 --- a/proc_limits.go +++ b/proc_limits.go @@ -79,7 +79,7 @@ var ( // NewLimits returns the current soft limits of the process. // -// Deprecated: use p.Limits() instead +// Deprecated: Use p.Limits() instead. func (p Proc) NewLimits() (ProcLimits, error) { return p.Limits() } diff --git a/proc_maps.go b/proc_maps.go index 8425e3082..ddc13b391 100644 --- a/proc_maps.go +++ b/proc_maps.go @@ -26,7 +26,7 @@ import ( "golang.org/x/sys/unix" ) -// ProcMapPermissions contains permission settings read from /proc/[pid]/maps +// ProcMapPermissions contains permission settings read from `/proc/[pid]/maps`. type ProcMapPermissions struct { // mapping has the [R]ead flag set Read bool @@ -40,8 +40,8 @@ type ProcMapPermissions struct { Private bool } -// ProcMap contains the process memory-mappings of the process, -// read from /proc/[pid]/maps +// ProcMap contains the process memory-mappings of the process +// read from `/proc/[pid]/maps`. type ProcMap struct { // The start address of current mapping. StartAddr uintptr @@ -80,7 +80,7 @@ func parseDevice(s string) (uint64, error) { return unix.Mkdev(uint32(major), uint32(minor)), nil } -// parseAddress just converts a hex-string to a uintptr +// parseAddress converts a hex-string to a uintptr. func parseAddress(s string) (uintptr, error) { a, err := strconv.ParseUint(s, 16, 0) if err != nil { @@ -90,7 +90,7 @@ func parseAddress(s string) (uintptr, error) { return uintptr(a), nil } -// parseAddresses parses the start-end address +// parseAddresses parses the start-end address. func parseAddresses(s string) (uintptr, uintptr, error) { toks := strings.Split(s, "-") if len(toks) < 2 { diff --git a/proc_psi.go b/proc_psi.go index dc6c14f0a..a68fe1529 100644 --- a/proc_psi.go +++ b/proc_psi.go @@ -35,9 +35,10 @@ import ( const lineFormat = "avg10=%f avg60=%f avg300=%f total=%d" -// PSILine is a single line of values as returned by /proc/pressure/* -// The Avg entries are averages over n seconds, as a percentage -// The Total line is in microseconds +// PSILine is a single line of values as returned by `/proc/pressure/*`. +// +// The Avg entries are averages over n seconds, as a percentage. +// The Total line is in microseconds. type PSILine struct { Avg10 float64 Avg60 float64 @@ -46,8 +47,9 @@ type PSILine struct { } // PSIStats represent pressure stall information from /proc/pressure/* -// Some indicates the share of time in which at least some tasks are stalled -// Full indicates the share of time in which all non-idle tasks are stalled simultaneously +// +// "Some" indicates the share of time in which at least some tasks are stalled. +// "Full" indicates the share of time in which all non-idle tasks are stalled simultaneously. type PSIStats struct { Some *PSILine Full *PSILine @@ -65,7 +67,7 @@ func (fs FS) PSIStatsForResource(resource string) (PSIStats, error) { return parsePSIStats(resource, bytes.NewReader(data)) } -// parsePSIStats parses the specified file for pressure stall information +// parsePSIStats parses the specified file for pressure stall information. func parsePSIStats(resource string, r io.Reader) (PSIStats, error) { psiStats := PSIStats{} diff --git a/proc_psi_test.go b/proc_psi_test.go index f7a1b6984..3903a18b1 100644 --- a/proc_psi_test.go +++ b/proc_psi_test.go @@ -107,7 +107,7 @@ func TestPSIStats(t *testing.T) { } } -// TestParsePSIStats tests the edge cases that we won't run into when running TestPSIStats +// TestParsePSIStats tests the edge cases that we won't run into when running TestPSIStats. func TestParsePSIStats(t *testing.T) { t.Run("unknown measurement type", func(t *testing.T) { raw := "nonesense haha test=fake" diff --git a/proc_smaps.go b/proc_smaps.go index a576a720a..664b9f184 100644 --- a/proc_smaps.go +++ b/proc_smaps.go @@ -28,30 +28,30 @@ import ( ) var ( - // match the header line before each mapped zone in /proc/pid/smaps + // match the header line before each mapped zone in `/proc/pid/smaps`. procSMapsHeaderLine = regexp.MustCompile(`^[a-f0-9].*$`) ) type ProcSMapsRollup struct { - // Amount of the mapping that is currently resident in RAM + // Amount of the mapping that is currently resident in RAM. Rss uint64 - // Process's proportional share of this mapping + // Process's proportional share of this mapping. Pss uint64 - // Size in bytes of clean shared pages + // Size in bytes of clean shared pages. SharedClean uint64 - // Size in bytes of dirty shared pages + // Size in bytes of dirty shared pages. SharedDirty uint64 - // Size in bytes of clean private pages + // Size in bytes of clean private pages. PrivateClean uint64 - // Size in bytes of dirty private pages + // Size in bytes of dirty private pages. PrivateDirty uint64 - // Amount of memory currently marked as referenced or accessed + // Amount of memory currently marked as referenced or accessed. Referenced uint64 - // Amount of memory that does not belong to any file + // Amount of memory that does not belong to any file. Anonymous uint64 - // Amount would-be-anonymous memory currently on swap + // Amount would-be-anonymous memory currently on swap. Swap uint64 - // Process's proportional memory on swap + // Process's proportional memory on swap. SwapPss uint64 } diff --git a/proc_stat.go b/proc_stat.go index ad03d85ef..06c556ef9 100644 --- a/proc_stat.go +++ b/proc_stat.go @@ -115,7 +115,7 @@ type ProcStat struct { // NewStat returns the current status information of the process. // -// Deprecated: use p.Stat() instead +// Deprecated: Use p.Stat() instead. func (p Proc) NewStat() (ProcStat, error) { return p.Stat() } diff --git a/proc_status.go b/proc_status.go index 6edd8333b..594022ded 100644 --- a/proc_status.go +++ b/proc_status.go @@ -33,37 +33,37 @@ type ProcStatus struct { TGID int // Peak virtual memory size. - VmPeak uint64 // nolint:golint + VmPeak uint64 // nolint:revive // Virtual memory size. - VmSize uint64 // nolint:golint + VmSize uint64 // nolint:revive // Locked memory size. - VmLck uint64 // nolint:golint + VmLck uint64 // nolint:revive // Pinned memory size. - VmPin uint64 // nolint:golint + VmPin uint64 // nolint:revive // Peak resident set size. - VmHWM uint64 // nolint:golint + VmHWM uint64 // nolint:revive // Resident set size (sum of RssAnnon RssFile and RssShmem). - VmRSS uint64 // nolint:golint + VmRSS uint64 // nolint:revive // Size of resident anonymous memory. - RssAnon uint64 // nolint:golint + RssAnon uint64 // nolint:revive // Size of resident file mappings. - RssFile uint64 // nolint:golint + RssFile uint64 // nolint:revive // Size of resident shared memory. - RssShmem uint64 // nolint:golint + RssShmem uint64 // nolint:revive // Size of data segments. - VmData uint64 // nolint:golint + VmData uint64 // nolint:revive // Size of stack segments. - VmStk uint64 // nolint:golint + VmStk uint64 // nolint:revive // Size of text segments. - VmExe uint64 // nolint:golint + VmExe uint64 // nolint:revive // Shared library code size. - VmLib uint64 // nolint:golint + VmLib uint64 // nolint:revive // Page table entries size. - VmPTE uint64 // nolint:golint + VmPTE uint64 // nolint:revive // Size of second-level page tables. - VmPMD uint64 // nolint:golint + VmPMD uint64 // nolint:revive // Swapped-out virtual memory size by anonymous private. - VmSwap uint64 // nolint:golint + VmSwap uint64 // nolint:revive // Size of hugetlb memory portions HugetlbPages uint64 diff --git a/schedstat.go b/schedstat.go index 28228164e..5f7f32dc8 100644 --- a/schedstat.go +++ b/schedstat.go @@ -40,7 +40,7 @@ type Schedstat struct { CPUs []*SchedstatCPU } -// SchedstatCPU contains the values from one "cpu" line +// SchedstatCPU contains the values from one "cpu" line. type SchedstatCPU struct { CPUNum string @@ -49,14 +49,14 @@ type SchedstatCPU struct { RunTimeslices uint64 } -// ProcSchedstat contains the values from /proc//schedstat +// ProcSchedstat contains the values from `/proc//schedstat`. type ProcSchedstat struct { RunningNanoseconds uint64 WaitingNanoseconds uint64 RunTimeslices uint64 } -// Schedstat reads data from /proc/schedstat +// Schedstat reads data from `/proc/schedstat`. func (fs FS) Schedstat() (*Schedstat, error) { file, err := os.Open(fs.proc.Path("schedstat")) if err != nil { diff --git a/schedstat_test.go b/schedstat_test.go index c6bee611b..80185dc9e 100644 --- a/schedstat_test.go +++ b/schedstat_test.go @@ -97,7 +97,7 @@ func TestProcSchedstatErrors(t *testing.T) { } } -// schedstat can have a 2nd line: it should be ignored +// schedstat can have a 2nd line: it should be ignored. func TestProcSchedstatMultipleLines(t *testing.T) { schedstat, err := parseProcSchedstat("123 456 789\n10 11\n") if err != nil { diff --git a/slab.go b/slab.go index 7896fd724..bc9aaf5c2 100644 --- a/slab.go +++ b/slab.go @@ -137,7 +137,7 @@ func parseSlabInfo21(r *bytes.Reader) (SlabInfo, error) { return s, nil } -// SlabInfo reads data from /proc/slabinfo +// SlabInfo reads data from `/proc/slabinfo`. func (fs FS) SlabInfo() (SlabInfo, error) { // TODO: Consider passing options to allow for parsing different // slabinfo versions. However, slabinfo 2.1 has been stable since diff --git a/stat.go b/stat.go index 6d8727541..33f97caa0 100644 --- a/stat.go +++ b/stat.go @@ -41,7 +41,7 @@ type CPUStat struct { // SoftIRQStat represent the softirq statistics as exported in the procfs stat file. // A nice introduction can be found at https://0xax.gitbooks.io/linux-insides/content/interrupts/interrupts-9.html -// It is possible to get per-cpu stats by reading /proc/softirqs +// It is possible to get per-cpu stats by reading `/proc/softirqs`. type SoftIRQStat struct { Hi uint64 Timer uint64 @@ -145,7 +145,7 @@ func parseSoftIRQStat(line string) (SoftIRQStat, uint64, error) { // NewStat returns information about current cpu/process statistics. // See https://www.kernel.org/doc/Documentation/filesystems/proc.txt // -// Deprecated: use fs.Stat() instead +// Deprecated: Use fs.Stat() instead. func NewStat() (Stat, error) { fs, err := NewFS(fs.DefaultProcMountPoint) if err != nil { @@ -155,15 +155,15 @@ func NewStat() (Stat, error) { } // NewStat returns information about current cpu/process statistics. -// See https://www.kernel.org/doc/Documentation/filesystems/proc.txt +// See: https://www.kernel.org/doc/Documentation/filesystems/proc.txt // -// Deprecated: use fs.Stat() instead +// Deprecated: Use fs.Stat() instead. func (fs FS) NewStat() (Stat, error) { return fs.Stat() } // Stat returns information about current cpu/process statistics. -// See https://www.kernel.org/doc/Documentation/filesystems/proc.txt +// See: https://www.kernel.org/doc/Documentation/filesystems/proc.txt func (fs FS) Stat() (Stat, error) { fileName := fs.proc.Path("stat") data, err := util.ReadFileNoStat(fileName) diff --git a/sysfs/class_fibrechannel.go b/sysfs/class_fibrechannel.go index 96584e74e..a0c49eb8d 100644 --- a/sysfs/class_fibrechannel.go +++ b/sysfs/class_fibrechannel.go @@ -83,7 +83,7 @@ func (fs FS) FibreChannelClass() (FibreChannelClass, error) { return fcc, nil } -// Parse a single FC host +// Parse a single FC host. func (fs FS) parseFibreChannelHost(name string) (*FibreChannelHost, error) { path := fs.sys.Path(fibrechannelClassPath, name) host := FibreChannelHost{Name: name} diff --git a/sysfs/class_infiniband.go b/sysfs/class_infiniband.go index 7adebe888..7b7a86ffa 100644 --- a/sysfs/class_infiniband.go +++ b/sysfs/class_infiniband.go @@ -164,7 +164,7 @@ func (fs FS) parseInfiniBandDevice(name string) (*InfiniBandDevice, error) { return &device, nil } -// Parse InfiniBand state. Expected format: ": " +// Parse InfiniBand state. Expected format: ": ". func parseState(s string) (uint, string, error) { parts := strings.Split(s, ":") if len(parts) != 2 { @@ -179,7 +179,7 @@ func parseState(s string) (uint, string, error) { return id, name, nil } -// Parse rate (example: "100 Gb/sec (4X EDR)") and return it as bytes/second +// Parse rate (example: "100 Gb/sec (4X EDR)") and return it as bytes/second. func parseRate(s string) (uint64, error) { parts := strings.SplitAfterN(s, " ", 2) if len(parts) != 2 { diff --git a/sysfs/class_powercap.go b/sysfs/class_powercap.go index 208e80907..f0321909f 100644 --- a/sysfs/class_powercap.go +++ b/sysfs/class_powercap.go @@ -25,7 +25,7 @@ import ( "github.com/prometheus/procfs/internal/util" ) -// RaplZone stores the information for one RAPL power zone +// RaplZone stores the information for one RAPL power zone. type RaplZone struct { Name string // name of RAPL zone from file "name" Index int // index (different value for duplicate names) @@ -33,9 +33,9 @@ type RaplZone struct { MaxMicrojoules uint64 // max RAPL microjoule value } -// GetRaplZones returns a slice of RaplZones -// When RAPL files are not present, returns nil with error -// https://www.kernel.org/doc/Documentation/power/powercap/powercap.txt +// GetRaplZones returns a slice of RaplZones. When RAPL files are not present, +// returns nil with error. +// - https://www.kernel.org/doc/Documentation/power/powercap/powercap.txt func GetRaplZones(fs FS) ([]RaplZone, error) { raplDir := fs.sys.Path("class/powercap") @@ -46,15 +46,15 @@ func GetRaplZones(fs FS) ([]RaplZone, error) { var zones []RaplZone - // count name usages to avoid duplicates (label them with an index) + // Count name usages to avoid duplicates (label them with an index). countNameUsages := make(map[string]int) - // loop through directory files searching for file "name" from subdirs + // Loop through directory files searching for file "name" from subdirs. for _, f := range files { nameFile := filepath.Join(raplDir, f.Name(), "/name") nameBytes, err := ioutil.ReadFile(nameFile) if err == nil { - // add new rapl zone since name file was found + // Add new rapl zone since name file was found. name := strings.TrimSpace(string(nameBytes)) // get a pair of index and final name diff --git a/sysfs/class_scsitape.go b/sysfs/class_scsitape.go index d227c10fa..371b4ae97 100644 --- a/sysfs/class_scsitape.go +++ b/sysfs/class_scsitape.go @@ -75,7 +75,7 @@ func (fs FS) SCSITapeClass() (SCSITapeClass, error) { return stc, nil } -// Parse a single scsi_tape +// Parse a single scsi_tape. func (fs FS) parseSCSITape(name string) (*SCSITape, error) { path := fs.sys.Path(scsiTapeClassPath, name) tape := SCSITape{Name: name} diff --git a/sysfs/clocksource.go b/sysfs/clocksource.go index b857f750d..ac507396d 100644 --- a/sysfs/clocksource.go +++ b/sysfs/clocksource.go @@ -22,7 +22,7 @@ import ( "github.com/prometheus/procfs/internal/util" ) -// ClockSource contains metrics related to the clock source +// ClockSource contains metrics related to the clock source. type ClockSource struct { Name string Available []string @@ -30,7 +30,7 @@ type ClockSource struct { } // ClockSources returns clocksource information including current and available clocksources -// read from '/sys/devices/system/clocksource' +// read from '/sys/devices/system/clocksource'. func (fs FS) ClockSources() ([]ClockSource, error) { clocksourcePaths, err := filepath.Glob(fs.sys.Path("devices/system/clocksource/clocksource[0-9]*")) diff --git a/sysfs/net_class.go b/sysfs/net_class.go index c1fed2bc0..6dff98e69 100644 --- a/sysfs/net_class.go +++ b/sysfs/net_class.go @@ -82,7 +82,7 @@ func (fs FS) NetClassDevices() ([]string, error) { return res, nil } -// NetClassByIface returns info for a single net interfaces (iface) +// NetClassByIface returns info for a single net interfaces (iface). func (fs FS) NetClassByIface(devicePath string) (*NetClassIface, error) { path := fs.sys.Path(netclassPath) diff --git a/sysfs/system_cpu.go b/sysfs/system_cpu.go index a4e616765..40fc94b43 100644 --- a/sysfs/system_cpu.go +++ b/sysfs/system_cpu.go @@ -25,15 +25,15 @@ import ( "github.com/prometheus/procfs/internal/util" ) -// CPU represents a path to a CPU located in /sys/devices/system/cpu/cpu[0-9]* +// CPU represents a path to a CPU located in `/sys/devices/system/cpu/cpu[0-9]*`. type CPU string -// Number returns the ID number of the given CPU +// Number returns the ID number of the given CPU. func (c CPU) Number() string { return strings.TrimPrefix(filepath.Base(string(c)), "cpu") } -// CPUTopology contains data located in /sys/devices/system/cpu/cpu[0-9]*/topology +// CPUTopology contains data located in `/sys/devices/system/cpu/cpu[0-9]*/topology`. type CPUTopology struct { CoreID string CoreSiblingsList string @@ -41,13 +41,13 @@ type CPUTopology struct { ThreadSiblingsList string } -// CPUThermalThrottle contains data from /sys/devices/system/cpu/cpu[0-9]*/thermal_throttle +// CPUThermalThrottle contains data from `/sys/devices/system/cpu/cpu[0-9]*/thermal_throttle`. type CPUThermalThrottle struct { CoreThrottleCount uint64 PackageThrottleCount uint64 } -// SystemCPUCpufreqStats contains stats from devices/system/cpu/cpu[0-9]*/cpufreq/... +// SystemCPUCpufreqStats contains stats from `/sys/devices/system/cpu/cpu[0-9]*/cpufreq/...`. type SystemCPUCpufreqStats struct { Name string CpuinfoCurrentFrequency *uint64 @@ -64,7 +64,7 @@ type SystemCPUCpufreqStats struct { SetSpeed string } -// CPUs returns a slice of all CPUs in /sys/devices/system/cpu +// CPUs returns a slice of all CPUs in `/sys/devices/system/cpu`. func (fs FS) CPUs() ([]CPU, error) { cpuPaths, err := filepath.Glob(fs.sys.Path("devices/system/cpu/cpu[0-9]*")) if err != nil { @@ -77,7 +77,7 @@ func (fs FS) CPUs() ([]CPU, error) { return cpus, nil } -// Topology gets the topology information for a single CPU from /sys/devices/system/cpu/cpuN/topology +// Topology gets the topology information for a single CPU from `/sys/devices/system/cpu/cpuN/topology`. func (c CPU) Topology() (*CPUTopology, error) { cpuTopologyPath := filepath.Join(string(c), "topology") if _, err := os.Stat(cpuTopologyPath); err != nil { @@ -112,7 +112,7 @@ func parseCPUTopology(cpuPath string) (*CPUTopology, error) { return &t, nil } -// ThermalThrottle gets the cpu throttle count information for a single CPU from /sys/devices/system/cpu/cpuN/thermal_throttle +// ThermalThrottle gets the cpu throttle count information for a single CPU from `/sys/devices/system/cpu/cpuN/thermal_throttle`. func (c CPU) ThermalThrottle() (*CPUThermalThrottle, error) { cpuPath := filepath.Join(string(c), "thermal_throttle") if _, err := os.Stat(cpuPath); err != nil { diff --git a/sysfs/vulnerability.go b/sysfs/vulnerability.go index 9e2d9cdbd..477135fa1 100644 --- a/sysfs/vulnerability.go +++ b/sysfs/vulnerability.go @@ -55,7 +55,7 @@ func (fs FS) CPUVulnerabilities() ([]Vulnerability, error) { return vulnerabilities, nil } -// Vulnerability represents a single vulnerability extracted from /sys/devices/system/cpu/vulnerabilities/ +// Vulnerability represents a single vulnerability extracted from /sys/devices/system/cpu/vulnerabilities/. type Vulnerability struct { CodeName string State string diff --git a/vm.go b/vm.go index cb1389141..f53f98ed6 100644 --- a/vm.go +++ b/vm.go @@ -29,7 +29,7 @@ import ( // https://www.kernel.org/doc/Documentation/sysctl/vm.txt // Each setting is exposed as a single file. // Each file contains one line with a single numerical value, except lowmem_reserve_ratio which holds an array -// and numa_zonelist_order (deprecated) which is a string +// and numa_zonelist_order (deprecated) which is a string. type VM struct { AdminReserveKbytes *int64 // /proc/sys/vm/admin_reserve_kbytes BlockDump *int64 // /proc/sys/vm/block_dump diff --git a/xfs/parse.go b/xfs/parse.go index 260501e69..bb5e8faa6 100644 --- a/xfs/parse.go +++ b/xfs/parse.go @@ -247,7 +247,7 @@ func logOperationStats(us []uint32) (LogOperationStats, error) { }, nil } -// push_ail +// pushAilStats handles push_ail stats. func pushAilStats(us []uint32) (PushAilStats, error) { if l := len(us); l != 10 { return PushAilStats{}, fmt.Errorf("incorrect number of values for XFS push ail stats: %d", l) @@ -267,7 +267,7 @@ func pushAilStats(us []uint32) (PushAilStats, error) { }, nil } -// xstrat +// xStratStats handles xstrat stats. func xStratStats(us []uint32) (XstratStats, error) { if l := len(us); l != 2 { return XstratStats{}, fmt.Errorf("incorrect number of values for XFS xstrat stats: %d", l) @@ -279,7 +279,7 @@ func xStratStats(us []uint32) (XstratStats, error) { }, nil } -// rw +// readWriteStats handles rw stats. func readWriteStats(us []uint32) (ReadWriteStats, error) { if l := len(us); l != 2 { return ReadWriteStats{}, fmt.Errorf("incorrect number of values for XFS read write stats: %d", l) @@ -417,7 +417,7 @@ func debugStats(us []uint32) (DebugStats, error) { }, nil } -// abtb2 +// btreeAllocBlocks2Stats handles abtb2 stats. func btreeAllocBlocks2Stats(us []uint32) (BtreeAllocBlocks2Stats, error) { if l := len(us); l != 15 { return BtreeAllocBlocks2Stats{}, fmt.Errorf("incorrect number of values for abtb2 stats: %d", 1) @@ -442,7 +442,7 @@ func btreeAllocBlocks2Stats(us []uint32) (BtreeAllocBlocks2Stats, error) { }, nil } -// abtc2 +// btreeAllocContig2Stats handles abtc2 stats. func btreeAllocContig2Stats(us []uint32) (BtreeAllocContig2Stats, error) { if l := len(us); l != 15 { return BtreeAllocContig2Stats{}, fmt.Errorf("incorrect number of values for abtc2 stats: %d", 1) @@ -467,7 +467,7 @@ func btreeAllocContig2Stats(us []uint32) (BtreeAllocContig2Stats, error) { }, nil } -// bmbt2 +// btreeBlockMap2Stats handles bmbt2 stats. func btreeBlockMap2Stats(us []uint32) (BtreeBlockMap2Stats, error) { if l := len(us); l != 15 { return BtreeBlockMap2Stats{}, fmt.Errorf("incorrect number of values for bmbt2 stats: %d", 1) @@ -492,7 +492,7 @@ func btreeBlockMap2Stats(us []uint32) (BtreeBlockMap2Stats, error) { }, nil } -// ibt2 +// btreeInode2Stats handles ibt2 stats. func btreeInode2Stats(us []uint32) (BtreeInode2Stats, error) { if l := len(us); l != 15 { return BtreeInode2Stats{}, fmt.Errorf("incorrect number of values for ibt2 stats: %d", 1) From 0f8a320e1e1f1dce4ed8e5940d6ab19dd7f0b5f0 Mon Sep 17 00:00:00 2001 From: Kobe Biello Date: Thu, 9 Dec 2021 18:55:46 +0800 Subject: [PATCH 009/176] Add CgroupSummary to parse /proc/cgroups (#424) * add CgroupSummary to parse /proc/cgroups Signed-off-by: bielu * update copyright Signed-off-by: bielu --- proc_cgroups.go | 98 ++++++++++++++++++++++++++++++++++++++++++++ proc_cgroups_test.go | 64 +++++++++++++++++++++++++++++ 2 files changed, 162 insertions(+) create mode 100644 proc_cgroups.go create mode 100644 proc_cgroups_test.go diff --git a/proc_cgroups.go b/proc_cgroups.go new file mode 100644 index 000000000..24d4dce9c --- /dev/null +++ b/proc_cgroups.go @@ -0,0 +1,98 @@ +// Copyright 2021 The Prometheus Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package procfs + +import ( + "bufio" + "bytes" + "fmt" + "strconv" + "strings" + + "github.com/prometheus/procfs/internal/util" +) + +// CgroupSummary models one line from /proc/cgroups. +// This file contains information about the controllers that are compiled into the kernel. +// +// Also see http://man7.org/linux/man-pages/man7/cgroups.7.html +type CgroupSummary struct { + // The name of the controller. controller is also known as subsystem. + SubsysName string + // The unique ID of the cgroup hierarchy on which this controller is mounted. + Hierarchy int + // The number of control groups in this hierarchy using this controller. + Cgroups int + // This field contains the value 1 if this controller is enabled, or 0 if it has been disabled + Enabled int +} + +// parseCgroupSummary parses each line of the /proc/cgroup file +// Line format is `subsys_name hierarchy num_cgroups enabled`. +func parseCgroupSummaryString(CgroupSummaryStr string) (*CgroupSummary, error) { + var err error + + fields := strings.Fields(CgroupSummaryStr) + // require at least 4 fields + if len(fields) < 4 { + return nil, fmt.Errorf("at least 4 fields required, found %d fields in cgroup info string: %s", len(fields), CgroupSummaryStr) + } + + CgroupSummary := &CgroupSummary{ + SubsysName: fields[0], + } + CgroupSummary.Hierarchy, err = strconv.Atoi(fields[1]) + if err != nil { + return nil, fmt.Errorf("failed to parse hierarchy ID") + } + CgroupSummary.Cgroups, err = strconv.Atoi(fields[2]) + if err != nil { + return nil, fmt.Errorf("failed to parse Cgroup Num") + } + CgroupSummary.Enabled, err = strconv.Atoi(fields[3]) + if err != nil { + return nil, fmt.Errorf("failed to parse Enabled") + } + return CgroupSummary, nil +} + +// parseCgroupSummary reads each line of the /proc/cgroup file. +func parseCgroupSummary(data []byte) ([]CgroupSummary, error) { + var CgroupSummarys []CgroupSummary + scanner := bufio.NewScanner(bytes.NewReader(data)) + for scanner.Scan() { + CgroupSummaryString := scanner.Text() + // ignore comment lines + if strings.HasPrefix(CgroupSummaryString, "#") { + continue + } + CgroupSummary, err := parseCgroupSummaryString(CgroupSummaryString) + if err != nil { + return nil, err + } + CgroupSummarys = append(CgroupSummarys, *CgroupSummary) + } + + err := scanner.Err() + return CgroupSummarys, err +} + +// CgroupSummarys returns information about current /proc/cgroups. +func (fs FS) CgroupSummarys() ([]CgroupSummary, error) { + data, err := util.ReadFileNoStat(fs.proc.Path("cgroups")) + if err != nil { + return nil, err + } + return parseCgroupSummary(data) +} diff --git a/proc_cgroups_test.go b/proc_cgroups_test.go new file mode 100644 index 000000000..b0a61d24b --- /dev/null +++ b/proc_cgroups_test.go @@ -0,0 +1,64 @@ +// Copyright 2021 The Prometheus Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package procfs + +import ( + "reflect" + "testing" +) + +func TestParseCgroupSummaryString(t *testing.T) { + tests := []struct { + name string + s string + shouldErr bool + CgroupSummary *CgroupSummary + }{ + { + name: "cpuset simple line", + s: "cpuset 7 148 1", + shouldErr: false, + CgroupSummary: &CgroupSummary{ + SubsysName: "cpuset", + Hierarchy: 7, + Cgroups: 148, + Enabled: 1, + }, + }, + { + name: "memory cgroup number mis format", + s: "memory 9 ## 1", + shouldErr: true, + CgroupSummary: nil, + }, + } + + for i, test := range tests { + t.Logf("[%02d] test %q", i, test.name) + + CgroupSummary, err := parseCgroupSummaryString(test.s) + + if test.shouldErr && err == nil { + t.Errorf("%s: expected an error, but none occurred", test.name) + } + if !test.shouldErr && err != nil { + t.Errorf("%s: unexpected error: %v", test.name, err) + } + + if want, have := test.CgroupSummary, CgroupSummary; !reflect.DeepEqual(want, have) { + t.Errorf("cgroup:\nwant:\n%+v\nhave:\n%+v", want, have) + } + } + +} From 5bd706760fa8eb473e8c148f620a97cb7379237f Mon Sep 17 00:00:00 2001 From: Matt Harden Date: Mon, 13 Dec 2021 01:39:23 -0800 Subject: [PATCH 010/176] Add a missing name to the *testing.T argument. (#425) When using t.Run, the subtest must take a named *testing.T argument. Otherwise, inner calls to t.Error etc. are invoked on the outer test object, which is pretty much always wrong. Signed-off-by: Matt Harden --- proc_psi_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proc_psi_test.go b/proc_psi_test.go index 3903a18b1..bd6fb09aa 100644 --- a/proc_psi_test.go +++ b/proc_psi_test.go @@ -19,7 +19,7 @@ import ( ) func TestPSIStats(t *testing.T) { - t.Run("fake", func(*testing.T) { + t.Run("fake", func(t *testing.T) { stats, err := getProcFixtures(t).PSIStatsForResource("fake") if err == nil { t.Fatal("fake resource does not have PSI statistics") From c6f5590c757b5cd2e9eb1c902b7f8e110a2fde0c Mon Sep 17 00:00:00 2001 From: David Ventura Date: Mon, 20 Dec 2021 11:45:11 +0100 Subject: [PATCH 011/176] Add isolated cpu parsing (#427) * Add isolated cpu parsing Signed-off-by: david * Address PR comments Signed-off-by: david * Fix start/end range message Signed-off-by: david * rename to parseIsolatedCPUs Signed-off-by: david * Do not wrap error Signed-off-by: david * also check error is nil Signed-off-by: david --- fixtures.ttar | 5 ++++ sysfs/system_cpu.go | 49 +++++++++++++++++++++++++++++++++++++ sysfs/system_cpu_test.go | 52 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 106 insertions(+) diff --git a/fixtures.ttar b/fixtures.ttar index e005ee94a..50294186f 100644 --- a/fixtures.ttar +++ b/fixtures.ttar @@ -6462,6 +6462,11 @@ Mode: 644 Directory: fixtures/sys/devices/system/cpu/cpufreq/policy1 Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/system/cpu/isolated +Lines: 1 +1,2-7,9 +Mode: 664 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: fixtures/sys/devices/system/node Mode: 775 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sysfs/system_cpu.go b/sysfs/system_cpu.go index 40fc94b43..7c46c2eaf 100644 --- a/sysfs/system_cpu.go +++ b/sysfs/system_cpu.go @@ -16,8 +16,11 @@ package sysfs import ( + "fmt" + "io/ioutil" "os" "path/filepath" + "strconv" "strings" "golang.org/x/sync/errgroup" @@ -237,3 +240,49 @@ func parseCpufreqCpuinfo(cpuPath string) (*SystemCPUCpufreqStats, error) { SetSpeed: stringOut[4], }, nil } + +func (fs FS) IsolatedCPUs() ([]uint16, error) { + isolcpus, err := ioutil.ReadFile(fs.sys.Path("devices/system/cpu/isolated")) + if err != nil { + return nil, err + } + + return parseIsolatedCPUs(isolcpus) +} + +func parseIsolatedCPUs(data []byte) ([]uint16, error) { + + var isolcpusInt = []uint16{} + + for _, cpu := range strings.Split(strings.TrimRight(string(data), "\n"), ",") { + if cpu == "" { + continue + } + if strings.Contains(cpu, "-") { + ranges := strings.Split(cpu, "-") + if len(ranges) != 2 { + return nil, fmt.Errorf("invalid cpu range: %s", cpu) + } + startRange, err := strconv.Atoi(ranges[0]) + if err != nil { + return nil, fmt.Errorf("invalid cpu start range: %w", err) + } + endRange, err := strconv.Atoi(ranges[1]) + if err != nil { + return nil, fmt.Errorf("invalid cpu end range: %w", err) + } + + for i := startRange; i <= endRange; i++ { + isolcpusInt = append(isolcpusInt, uint16(i)) + } + continue + } + + cpuN, err := strconv.Atoi(cpu) + if err != nil { + return nil, err + } + isolcpusInt = append(isolcpusInt, uint16(cpuN)) + } + return isolcpusInt, nil +} diff --git a/sysfs/system_cpu_test.go b/sysfs/system_cpu_test.go index 522b58b56..0ae9f0fd9 100644 --- a/sysfs/system_cpu_test.go +++ b/sysfs/system_cpu_test.go @@ -16,6 +16,7 @@ package sysfs import ( + "errors" "reflect" "testing" ) @@ -140,3 +141,54 @@ func TestSystemCpufreq(t *testing.T) { t.Errorf("Result not correct: want %v, have %v", systemCpufreq, c) } } + +func TestIsolatedParsingCPU(t *testing.T) { + var testParams = []struct { + in []byte + res []uint16 + err error + }{ + {[]byte(""), []uint16{}, nil}, + {[]byte("1\n"), []uint16{1}, nil}, + {[]byte("1"), []uint16{1}, nil}, + {[]byte("1,2"), []uint16{1, 2}, nil}, + {[]byte("1-2"), []uint16{1, 2}, nil}, + {[]byte("1-3"), []uint16{1, 2, 3}, nil}, + {[]byte("1,2-4"), []uint16{1, 2, 3, 4}, nil}, + {[]byte("1,3-4"), []uint16{1, 3, 4}, nil}, + {[]byte("1,3-4,7,20-21"), []uint16{1, 3, 4, 7, 20, 21}, nil}, + + {[]byte("1,"), []uint16{1}, nil}, + {[]byte("1,2-"), nil, errors.New(`invalid cpu end range: strconv.Atoi: parsing "": invalid syntax`)}, + {[]byte("1,-3"), nil, errors.New(`invalid cpu start range: strconv.Atoi: parsing "": invalid syntax`)}, + } + for _, params := range testParams { + t.Run("blabla", func(t *testing.T) { + res, err := parseIsolatedCPUs(params.in) + if !reflect.DeepEqual(res, params.res) { + t.Fatalf("should have %v result: got %v", params.res, res) + } + if err != nil && params.err != nil && err.Error() != params.err.Error() { + t.Fatalf("should have '%v' error: got '%v'", params.err, err) + } + if (err == nil || params.err == nil) && err != params.err { + t.Fatalf("should have %v error: got %v", params.err, err) + } + + }) + } +} +func TestIsolatedCPUs(t *testing.T) { + fs, err := NewFS(sysTestFixtures) + if err != nil { + t.Fatal(err) + } + isolated, err := fs.IsolatedCPUs() + expected := []uint16{1, 2, 3, 4, 5, 6, 7, 9} + if !reflect.DeepEqual(isolated, expected) { + t.Errorf("Result not correct: want %v, have %v", expected, isolated) + } + if err != nil { + t.Errorf("Error not correct: want %v, have %v", nil, err) + } +} From fbe360a68cc652b7d44167e8ec79e2ee70261569 Mon Sep 17 00:00:00 2001 From: ventifus <44683696+ventifus@users.noreply.github.com> Date: Mon, 10 Jan 2022 05:26:34 -0800 Subject: [PATCH 012/176] Add device-mapper-specific block device properties (#412) * Expose device-mapper information as DeviceMapperInfo Signed-off-by: W. Andrew Denton * Enumerate block device slaves as UnderlyingDeviceInfo Signed-off-by: W. Andrew Denton * Add missing fixtures. Signed-off-by: W. Andrew Denton * blockdevice/stats: uppercase initialisms. Signed-off-by: W. Andrew Denton * Expose device-mapper information as DeviceMapperInfo Signed-off-by: W. Andrew Denton * Expose device-mapper information as DeviceMapperInfo Signed-off-by: W. Andrew Denton * Update fixtures. Signed-off-by: W. Andrew Denton * Capitalize comments. Signed-off-by: W. Andrew Denton Co-authored-by: W. Andrew Denton --- blockdevice/stats.go | 74 ++++++++++++++++++++++++++++++++++++--- blockdevice/stats_test.go | 67 +++++++++++++++++++++++++++++++++++ fixtures.ttar | 65 ++++++++++++++++++++++++++++++++++ 3 files changed, 202 insertions(+), 4 deletions(-) diff --git a/blockdevice/stats.go b/blockdevice/stats.go index 56911fbec..9b8182fab 100644 --- a/blockdevice/stats.go +++ b/blockdevice/stats.go @@ -16,13 +16,13 @@ package blockdevice import ( "bufio" "fmt" - "github.com/prometheus/procfs/internal/util" "io" "io/ioutil" "os" "strings" "github.com/prometheus/procfs/internal/fs" + "github.com/prometheus/procfs/internal/util" ) // Info contains identifying information for a block device such as a disk drive. @@ -178,12 +178,37 @@ type BlockQueueStats struct { WriteZeroesMaxBytes uint64 } +// DeviceMapperInfo models the devicemapper files that are located in the sysfs tree for each block device +// and described in the kernel documentation: +// https://www.kernel.org/doc/Documentation/ABI/testing/sysfs-block-dm +type DeviceMapperInfo struct { + // Name is the string containing mapped device name. + Name string + // RqBasedSeqIOMergeDeadline determines how long (in microseconds) a request that is a reasonable merge + // candidate can be queued on the request queue. + RqBasedSeqIOMergeDeadline uint64 + // Suspended indicates if the device is suspended (1 is on, 0 is off). + Suspended uint64 + // UseBlkMQ indicates if the device is using the request-based blk-mq I/O path mode (1 is on, 0 is off). + UseBlkMQ uint64 + // UUID is the DM-UUID string or empty string if DM-UUID is not set. + UUID string +} + +// UnderlyingDevices models the list of devices that this device is built from. +type UnderlyingDeviceInfo struct { + // DeviceNames is the list of devices names + DeviceNames []string +} + const ( procDiskstatsPath = "diskstats" procDiskstatsFormat = "%d %d %s %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d" sysBlockPath = "block" sysBlockStatFormat = "%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d" sysBlockQueue = "queue" + sysBlockDM = "dm" + sysUnderlyingDev = "slaves" ) // FS represents the pseudo-filesystems proc and sys, which provides an @@ -317,7 +342,7 @@ func (fs FS) SysBlockDeviceStat(device string) (IOStats, int, error) { // SysBlockDeviceQueueStats returns stats for /sys/block/xxx/queue where xxx is a device name. func (fs FS) SysBlockDeviceQueueStats(device string) (BlockQueueStats, error) { stat := BlockQueueStats{} - // files with uint64 fields + // Files with uint64 fields for file, p := range map[string]*uint64{ "add_random": &stat.AddRandom, "dax": &stat.DAX, @@ -355,7 +380,7 @@ func (fs FS) SysBlockDeviceQueueStats(device string) (BlockQueueStats, error) { } *p = val } - // files with int64 fields + // Files with int64 fields for file, p := range map[string]*int64{ "io_poll_delay": &stat.IOPollDelay, "wbt_lat_usec": &stat.WBTLatUSec, @@ -366,7 +391,7 @@ func (fs FS) SysBlockDeviceQueueStats(device string) (BlockQueueStats, error) { } *p = val } - // files with string fields + // Files with string fields for file, p := range map[string]*string{ "write_cache": &stat.WriteCache, "zoned": &stat.Zoned, @@ -398,3 +423,44 @@ func (fs FS) SysBlockDeviceQueueStats(device string) (BlockQueueStats, error) { } return stat, nil } + +func (fs FS) SysBlockDeviceMapperInfo(device string) (DeviceMapperInfo, error) { + info := DeviceMapperInfo{} + // Files with uint64 fields + for file, p := range map[string]*uint64{ + "rq_based_seq_io_merge_deadline": &info.RqBasedSeqIOMergeDeadline, + "suspended": &info.Suspended, + "use_blk_mq": &info.UseBlkMQ, + } { + val, err := util.ReadUintFromFile(fs.sys.Path(sysBlockPath, device, sysBlockDM, file)) + if err != nil { + return DeviceMapperInfo{}, err + } + *p = val + } + // Files with string fields + for file, p := range map[string]*string{ + "name": &info.Name, + "uuid": &info.UUID, + } { + val, err := util.SysReadFile(fs.sys.Path(sysBlockPath, device, sysBlockDM, file)) + if err != nil { + return DeviceMapperInfo{}, err + } + *p = val + } + return info, nil +} + +func (fs FS) SysBlockDeviceUnderlyingDevices(device string) (UnderlyingDeviceInfo, error) { + underlyingDir, err := os.Open(fs.sys.Path(sysBlockPath, device, sysUnderlyingDev)) + if err != nil { + return UnderlyingDeviceInfo{}, err + } + underlying, err := underlyingDir.Readdirnames(0) + if err != nil { + return UnderlyingDeviceInfo{}, err + } + return UnderlyingDeviceInfo{DeviceNames: underlying}, nil + +} diff --git a/blockdevice/stats_test.go b/blockdevice/stats_test.go index c0a5768a4..a701bcd2a 100644 --- a/blockdevice/stats_test.go +++ b/blockdevice/stats_test.go @@ -14,6 +14,7 @@ package blockdevice import ( + "os" "reflect" "testing" ) @@ -152,3 +153,69 @@ func TestBlockDevice(t *testing.T) { t.Errorf("Incorrect BlockQueueStat, expected: \n%+v, got: \n%+v", blockQueueStatExpected, blockQueueStat) } } + +func TestBlockDmInfo(t *testing.T) { + blockdevice, err := NewFS("../fixtures/proc", "../fixtures/sys") + if err != nil { + t.Fatalf("failed to access blockdevice fs: %v", err) + } + devices, err := blockdevice.SysBlockDevices() + if err != nil { + t.Fatal(err) + } + dm0Info, err := blockdevice.SysBlockDeviceMapperInfo(devices[0]) + if err != nil { + t.Fatal(err) + } + + dm0InfoExpected := DeviceMapperInfo{ + Name: "vg0--lv_root", + RqBasedSeqIOMergeDeadline: 0, + Suspended: 0, + UseBlkMQ: 0, + UUID: "LVM-3zSHSR5Nbf4j7g6auAAefWY2CMaX01theZYEvQyecVsm2WtX3iY5q51qq5dWWOq7", + } + if !reflect.DeepEqual(dm0Info, dm0InfoExpected) { + t.Errorf("Incorrect BlockQueueStat, expected: \n%+v, got: \n%+v", dm0InfoExpected, dm0Info) + } + + dm1Info, err := blockdevice.SysBlockDeviceMapperInfo(devices[1]) + if err != nil { + if _, ok := err.(*os.PathError); ok { + // Fail the test if there's an error other than PathError. + if !os.IsNotExist(err) { + t.Fatal(err) + } + } else { + t.Fatal(err) + } + } else { + t.Fatal("SysBlockDeviceMapperInfo on sda was supposed to fail.") + } + dm1InfoExpected := DeviceMapperInfo{} + if !reflect.DeepEqual(dm1Info, dm1InfoExpected) { + t.Errorf("Incorrect BlockQueueStat, expected: \n%+v, got: \n%+v", dm0InfoExpected, dm0Info) + } +} + +func TestSysBlockDeviceUnderlyingDevices(t *testing.T) { + blockdevice, err := NewFS("../fixtures/proc", "../fixtures/sys") + if err != nil { + t.Fatalf("failed to access blockdevice fs: %v", err) + } + devices, err := blockdevice.SysBlockDevices() + if err != nil { + t.Fatal(err) + } + + underlying0, err := blockdevice.SysBlockDeviceUnderlyingDevices(devices[0]) + if err != nil { + t.Fatal(err) + } + underlying0Expected := UnderlyingDeviceInfo{ + DeviceNames: []string{"sda"}, + } + if !reflect.DeepEqual(underlying0, underlying0Expected) { + t.Errorf("Incorrect BlockQueueStat, expected: \n%+v, got: \n%+v", underlying0Expected, underlying0) + } +} diff --git a/fixtures.ttar b/fixtures.ttar index 50294186f..0c4f6a33d 100644 --- a/fixtures.ttar +++ b/fixtures.ttar @@ -3231,6 +3231,41 @@ Mode: 775 Directory: fixtures/sys/block/dm-0 Mode: 775 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/block/dm-0/dm +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/block/dm-0/dm/name +Lines: 1 +vg0--lv_rootEOF +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/block/dm-0/dm/rq_based_seq_io_merge_deadline +Lines: 1 +0EOF +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/block/dm-0/dm/suspended +Lines: 1 +0EOF +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/block/dm-0/dm/use_blk_mq +Lines: 1 +0EOF +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/block/dm-0/dm/uuid +Lines: 1 +LVM-3zSHSR5Nbf4j7g6auAAefWY2CMaX01theZYEvQyecVsm2WtX3iY5q51qq5dWWOq7EOF +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/block/dm-0/slaves +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/block/dm-0/slaves/sda +Lines: 0 +Mode: 664 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: fixtures/sys/block/dm-0/stat Lines: 1 6447303 0 710266738 1529043 953216 0 31201176 4557464 0 796160 6088971 @@ -3478,6 +3513,27 @@ Mode: 664 Directory: fixtures/sys/class Mode: 775 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/class/block +Mode: 775 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/class/block/dm-0 +SymlinkTo: ../../devices/virtual/block/dm-0 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/class/block/dm-1 +SymlinkTo: ../../devices/virtual/block/dm-1 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/class/block/dm-2 +SymlinkTo: ../../devices/virtual/block/dm-2 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/class/block/dm-3 +SymlinkTo: ../../devices/virtual/block/dm-3 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/class/block/dm-4 +SymlinkTo: ../../devices/virtual/block/dm-4 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/class/block/dm-5 +SymlinkTo: ../../devices/virtual/block/dm-5 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: fixtures/sys/class/dmi Mode: 775 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -6496,6 +6552,15 @@ nr_zone_active_file 11 nr_zone_unevictable 12 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/virtual +Mode: 775 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/virtual/block +Mode: 775 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/virtual/block/dm-0 +Mode: 775 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: fixtures/sys/fs Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - From 71acf3db7ff8987909073e01d72239d53990d950 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert-Andr=C3=A9=20Mauchin?= Date: Fri, 14 Jan 2022 01:13:27 +0100 Subject: [PATCH 013/176] Convert %w verb in t.Errorf function to %v MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Go 1.18 introduced a change where only fmt.Errorf function accepts the %w verb. Other Errorf function like t.Errorf do not accept it anymore. See https://github.com/golang/go/issues/47641 Fix: #430 Signed-off-by: Robert-André Mauchin --- mountstats_test.go | 4 ++-- swaps_test.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mountstats_test.go b/mountstats_test.go index 09e26b98f..9fccf84ac 100644 --- a/mountstats_test.go +++ b/mountstats_test.go @@ -393,7 +393,7 @@ func TestMountStats(t *testing.T) { t.Error("expected an error, but none occurred") } if !tt.invalid && err != nil { - t.Errorf("unexpected error: %w", err) + t.Errorf("unexpected error: %v", err) } if want, have := tt.mounts, mounts; !reflect.DeepEqual(want, have) { @@ -434,7 +434,7 @@ func TestMountStatsExtendedOperationStats(t *testing.T) { r := strings.NewReader(extendedOpsExampleMountstats) _, err := parseMountStats(r) if err != nil { - t.Errorf("failed to parse mount stats with extended per-op statistics: %w", err) + t.Errorf("failed to parse mount stats with extended per-op statistics: %v", err) } } diff --git a/swaps_test.go b/swaps_test.go index 1190da72b..70db6aba6 100644 --- a/swaps_test.go +++ b/swaps_test.go @@ -102,7 +102,7 @@ func TestParseSwapString(t *testing.T) { t.Error("unexpected success") } if !tt.invalid && err != nil { - t.Errorf("unexpected error: %w", err) + t.Errorf("unexpected error: %v", err) } if !reflect.DeepEqual(tt.swap, swap) { From 5f46783c017ef6a934fc8cfa6d1a2206db21401b Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Wed, 26 Jan 2022 12:55:27 +0100 Subject: [PATCH 014/176] Add missing godoc comments for xfrm stats (#433) Add missing godoc comments matching the kernel documentation, see https://www.kernel.org/doc/html/latest/networking/xfrm_proc.html Also rename the `xfrm*.go` files to have a `net_` prefix, as the respective file is found in the `net/` sub-directory and this matches filenames for other network-related stats. Signed-off-by: Tobias Klauser --- xfrm.go => net_xfrm.go | 9 ++++++--- xfrm_test.go => net_xfrm_test.go | 0 2 files changed, 6 insertions(+), 3 deletions(-) rename xfrm.go => net_xfrm.go (96%) rename xfrm_test.go => net_xfrm_test.go (100%) diff --git a/xfrm.go b/net_xfrm.go similarity index 96% rename from xfrm.go rename to net_xfrm.go index eed07c7d7..f9d9d243d 100644 --- a/xfrm.go +++ b/net_xfrm.go @@ -79,10 +79,13 @@ type XfrmStat struct { // Policy is dead XfrmOutPolDead int // Policy Error - XfrmOutPolError int - XfrmFwdHdrError int + XfrmOutPolError int + // Forward routing of a packet is not allowed + XfrmFwdHdrError int + // State is invalid, perhaps expired XfrmOutStateInvalid int - XfrmAcquireError int + // State hasn’t been fully acquired before use + XfrmAcquireError int } // NewXfrmStat reads the xfrm_stat statistics. diff --git a/xfrm_test.go b/net_xfrm_test.go similarity index 100% rename from xfrm_test.go rename to net_xfrm_test.go From 3d753b093742e29451eaa7c6d90cd25736fc5c59 Mon Sep 17 00:00:00 2001 From: Nikos Kakavas Date: Sun, 13 Feb 2022 21:30:36 +0200 Subject: [PATCH 015/176] Introduce parsing for `/proc//net/snmp`, `/proc//net/snmp6` and `/proc//net/netstat`. Signed-off-by: Nikos Kakavas --- fixtures.ttar | 119 +++++++++++++++++++++++ go.mod | 1 + go.sum | 2 + proc_netstat.go | 223 +++++++++++++++++++++++++++++++++++++++++++ proc_netstat_test.go | 36 +++++++ proc_snmp.go | 188 ++++++++++++++++++++++++++++++++++++ proc_snmp6.go | 200 ++++++++++++++++++++++++++++++++++++++ proc_snmp6_test.go | 35 +++++++ proc_snmp_test.go | 52 ++++++++++ 9 files changed, 856 insertions(+) create mode 100644 proc_netstat.go create mode 100644 proc_netstat_test.go create mode 100644 proc_snmp.go create mode 100644 proc_snmp6.go create mode 100644 proc_snmp6_test.go create mode 100644 proc_snmp_test.go diff --git a/fixtures.ttar b/fixtures.ttar index 0c4f6a33d..0fe1e08c8 100644 --- a/fixtures.ttar +++ b/fixtures.ttar @@ -156,6 +156,125 @@ Inter-| Receive | Transmit eth0: 438 5 0 0 0 0 0 0 648 8 0 0 0 0 0 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/proc/26231/net/snmp +Lines: 12 +Ip: Forwarding DefaultTTL InReceives InHdrErrors InAddrErrors ForwDatagrams InUnknownProtos InDiscards InDelivers OutRequests OutDiscards OutNoRoutes ReasmTimeout ReasmReqds ReasmOKs ReasmFails FragOKs FragFails FragCreates +Ip: 2 64 594223 0 1 0 0 0 593186 547253 20 231 0 0 0 0 0 0 0 +Icmp: InMsgs InErrors InCsumErrors InDestUnreachs InTimeExcds InParmProbs InSrcQuenchs InRedirects InEchos InEchoReps InTimestamps InTimestampReps InAddrMasks InAddrMaskReps OutMsgs OutErrors OutDestUnreachs OutTimeExcds OutParmProbs OutSrcQuenchs OutRedirects OutEchos OutEchoReps OutTimestamps OutTimestampReps OutAddrMasks OutAddrMaskReps +Icmp: 45 1 0 45 0 0 0 0 0 0 0 0 0 0 50 0 50 0 0 0 0 0 0 0 0 0 0 +IcmpMsg: InType3 OutType3 +IcmpMsg: 45 50 +Tcp: RtoAlgorithm RtoMin RtoMax MaxConn ActiveOpens PassiveOpens AttemptFails EstabResets CurrEstab InSegs OutSegs RetransSegs InErrs OutRsts InCsumErrors +Tcp: 1 200 120000 -1 1103 9 8 51 15 653161 594855 348 98 1038 0 +Udp: InDatagrams NoPorts InErrors OutDatagrams RcvbufErrors SndbufErrors InCsumErrors IgnoredMulti +Udp: 10179 50 0 9846 0 0 0 58 +UdpLite: InDatagrams NoPorts InErrors OutDatagrams RcvbufErrors SndbufErrors InCsumErrors IgnoredMulti +UdpLite: 0 0 0 0 0 0 0 0 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/proc/26231/net/netstat +Lines: 4 +TcpExt: SyncookiesSent SyncookiesRecv SyncookiesFailed EmbryonicRsts PruneCalled RcvPruned OfoPruned OutOfWindowIcmps LockDroppedIcmps ArpFilter TW TWRecycled TWKilled PAWSActive PAWSEstab DelayedACKs DelayedACKLocked DelayedACKLost ListenOverflows ListenDrops TCPHPHits TCPPureAcks TCPHPAcks TCPRenoRecovery TCPSackRecovery TCPSACKReneging TCPSACKReorder TCPRenoReorder TCPTSReorder TCPFullUndo TCPPartialUndo TCPDSACKUndo TCPLossUndo TCPLostRetransmit TCPRenoFailures TCPSackFailures TCPLossFailures TCPFastRetrans TCPSlowStartRetrans TCPTimeouts TCPLossProbes TCPLossProbeRecovery TCPRenoRecoveryFail TCPSackRecoveryFail TCPRcvCollapsed TCPDSACKOldSent TCPDSACKOfoSent TCPDSACKRecv TCPDSACKOfoRecv TCPAbortOnData TCPAbortOnClose TCPAbortOnMemory TCPAbortOnTimeout TCPAbortOnLinger TCPAbortFailed TCPMemoryPressures TCPMemoryPressuresChrono TCPSACKDiscard TCPDSACKIgnoredOld TCPDSACKIgnoredNoUndo TCPSpuriousRTOs TCPMD5NotFound TCPMD5Unexpected TCPMD5Failure TCPSackShifted TCPSackMerged TCPSackShiftFallback TCPBacklogDrop PFMemallocDrop TCPMinTTLDrop TCPDeferAcceptDrop IPReversePathFilter TCPTimeWaitOverflow TCPReqQFullDoCookies TCPReqQFullDrop TCPRetransFail TCPRcvCoalesce TCPOFOQueue TCPOFODrop TCPOFOMerge TCPChallengeACK TCPSYNChallenge TCPFastOpenActive TCPFastOpenActiveFail TCPFastOpenPassive TCPFastOpenPassiveFail TCPFastOpenListenOverflow TCPFastOpenCookieReqd TCPFastOpenBlackhole TCPSpuriousRtxHostQueues BusyPollRxPackets TCPAutoCorking TCPFromZeroWindowAdv TCPToZeroWindowAdv TCPWantZeroWindowAdv TCPSynRetrans TCPOrigDataSent TCPHystartTrainDetect TCPHystartTrainCwnd TCPHystartDelayDetect TCPHystartDelayCwnd TCPACKSkippedSynRecv TCPACKSkippedPAWS TCPACKSkippedSeq TCPACKSkippedFinWait2 TCPACKSkippedTimeWait TCPACKSkippedChallenge TCPWinProbe TCPKeepAlive TCPMTUPFail TCPMTUPSuccess TCPWqueueTooBig +TcpExt: 0 0 0 1 0 0 0 0 0 0 83 0 0 0 3640 287 1 7460 0 0 134193 1335 829 0 4 0 1 0 0 0 0 1 19 0 0 0 0 3 0 32 100 4 0 0 0 7460 2421 49 1 62 6 0 23 0 7 0 0 0 0 19 2 0 0 0 0 0 6 0 0 0 0 3 0 0 0 0 92425 65515 0 2421 4 4 0 0 0 0 0 0 0 0 0 10 0 0 0 16 2221 0 0 2 45 0 0 3 0 0 0 0 456 0 0 0 +IpExt: InNoRoutes InTruncatedPkts InMcastPkts OutMcastPkts InBcastPkts OutBcastPkts InOctets OutOctets InMcastOctets OutMcastOctets InBcastOctets OutBcastOctets InCsumErrors InNoECTPkts InECT1Pkts InECT0Pkts InCEPkts ReasmOverlaps +IpExt: 0 0 208 214 118 111 190585481 7512674 26093 25903 14546 13628 0 134215 0 0 0 0 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/proc/26231/net/snmp6 +Lines: 92 +Ip6InReceives 92166 +Ip6InHdrErrors 0 +Ip6InTooBigErrors 0 +Ip6InNoRoutes 0 +Ip6InAddrErrors 0 +Ip6InUnknownProtos 0 +Ip6InTruncatedPkts 0 +Ip6InDiscards 0 +Ip6InDelivers 92053 +Ip6OutForwDatagrams 0 +Ip6OutRequests 57502 +Ip6OutDiscards 0 +Ip6OutNoRoutes 169 +Ip6ReasmTimeout 0 +Ip6ReasmReqds 0 +Ip6ReasmOKs 0 +Ip6ReasmFails 0 +Ip6FragOKs 0 +Ip6FragFails 0 +Ip6FragCreates 0 +Ip6InMcastPkts 381 +Ip6OutMcastPkts 148 +Ip6InOctets 113479132 +Ip6OutOctets 9842685 +Ip6InMcastOctets 65971 +Ip6OutMcastOctets 19394 +Ip6InBcastOctets 0 +Ip6OutBcastOctets 0 +Ip6InNoECTPkts 92166 +Ip6InECT1Pkts 0 +Ip6InECT0Pkts 0 +Ip6InCEPkts 0 +Icmp6InMsgs 142 +Icmp6InErrors 0 +Icmp6OutMsgs 58 +Icmp6OutErrors 0 +Icmp6InCsumErrors 0 +Icmp6InDestUnreachs 2 +Icmp6InPktTooBigs 0 +Icmp6InTimeExcds 0 +Icmp6InParmProblems 0 +Icmp6InEchos 0 +Icmp6InEchoReplies 0 +Icmp6InGroupMembQueries 0 +Icmp6InGroupMembResponses 0 +Icmp6InGroupMembReductions 0 +Icmp6InRouterSolicits 0 +Icmp6InRouterAdvertisements 111 +Icmp6InNeighborSolicits 26 +Icmp6InNeighborAdvertisements 1 +Icmp6InRedirects 0 +Icmp6InMLDv2Reports 2 +Icmp6OutDestUnreachs 0 +Icmp6OutPktTooBigs 0 +Icmp6OutTimeExcds 0 +Icmp6OutParmProblems 0 +Icmp6OutEchos 0 +Icmp6OutEchoReplies 0 +Icmp6OutGroupMembQueries 0 +Icmp6OutGroupMembResponses 0 +Icmp6OutGroupMembReductions 0 +Icmp6OutRouterSolicits 2 +Icmp6OutRouterAdvertisements 0 +Icmp6OutNeighborSolicits 5 +Icmp6OutNeighborAdvertisements 26 +Icmp6OutRedirects 0 +Icmp6OutMLDv2Reports 25 +Icmp6InType1 2 +Icmp6InType134 111 +Icmp6InType135 26 +Icmp6InType136 1 +Icmp6InType143 2 +Icmp6OutType133 2 +Icmp6OutType135 5 +Icmp6OutType136 26 +Icmp6OutType143 25 +Udp6InDatagrams 2016 +Udp6NoPorts 0 +Udp6InErrors 0 +Udp6OutDatagrams 1546 +Udp6RcvbufErrors 0 +Udp6SndbufErrors 0 +Udp6InCsumErrors 0 +Udp6IgnoredMulti 12 +UdpLite6InDatagrams 0 +UdpLite6NoPorts 0 +UdpLite6InErrors 0 +UdpLite6OutDatagrams 0 +UdpLite6RcvbufErrors 0 +UdpLite6SndbufErrors 0 +UdpLite6InCsumErrors 0 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: fixtures/proc/26231/ns Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/go.mod b/go.mod index ba6681f52..ff171bb43 100644 --- a/go.mod +++ b/go.mod @@ -4,6 +4,7 @@ go 1.13 require ( github.com/google/go-cmp v0.5.4 + github.com/mitchellh/mapstructure v1.4.3 golang.org/x/sync v0.0.0-20201207232520-09787c993a3a golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c ) diff --git a/go.sum b/go.sum index 7ceaf56b7..ea3f41b44 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,7 @@ github.com/google/go-cmp v0.5.4 h1:L8R9j+yAqZuZjsqh/z+F1NCffTKKLShY6zXTItVIZ8M= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/mitchellh/mapstructure v1.4.3 h1:OVowDSCllw/YjdLkam3/sm7wEtOy59d8ndGgCcyj8cs= +github.com/mitchellh/mapstructure v1.4.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a h1:DcqTD9SDLc+1P/r1EmRBwnVsrOwW+kk2vWf9n+1sGhs= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c h1:VwygUrnw9jn88c4u8GD3rZQbqrP/tgas88tPUbBxQrk= diff --git a/proc_netstat.go b/proc_netstat.go new file mode 100644 index 000000000..418f1f514 --- /dev/null +++ b/proc_netstat.go @@ -0,0 +1,223 @@ +// Copyright 2022 The Prometheus Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package procfs + +import ( + "bufio" + "bytes" + "fmt" + "io" + "strconv" + "strings" + + "github.com/mitchellh/mapstructure" + "github.com/prometheus/procfs/internal/util" +) + +// ProcNetstat models the content of /proc//net/netstat. +type ProcNetstat struct { + // The process ID. + PID int + TcpExt + IpExt +} + +type TcpExt struct { + SyncookiesSent float64 + SyncookiesRecv float64 + SyncookiesFailed float64 + EmbryonicRsts float64 + PruneCalled float64 + RcvPruned float64 + OfoPruned float64 + OutOfWindowIcmps float64 + LockDroppedIcmps float64 + ArpFilter float64 + TW float64 + TWRecycled float64 + TWKilled float64 + PAWSActive float64 + PAWSEstab float64 + DelayedACKs float64 + DelayedACKLocked float64 + DelayedACKLost float64 + ListenOverflows float64 + ListenDrops float64 + TCPHPHits float64 + TCPPureAcks float64 + TCPHPAcks float64 + TCPRenoRecovery float64 + TCPSackRecovery float64 + TCPSACKReneging float64 + TCPSACKReorder float64 + TCPRenoReorder float64 + TCPTSReorder float64 + TCPFullUndo float64 + TCPPartialUndo float64 + TCPDSACKUndo float64 + TCPLossUndo float64 + TCPLostRetransmit float64 + TCPRenoFailures float64 + TCPSackFailures float64 + TCPLossFailures float64 + TCPFastRetrans float64 + TCPSlowStartRetrans float64 + TCPTimeouts float64 + TCPLossProbes float64 + TCPLossProbeRecovery float64 + TCPRenoRecoveryFail float64 + TCPSackRecoveryFail float64 + TCPRcvCollapsed float64 + TCPDSACKOldSent float64 + TCPDSACKOfoSent float64 + TCPDSACKRecv float64 + TCPDSACKOfoRecv float64 + TCPAbortOnData float64 + TCPAbortOnClose float64 + TCPAbortOnMemory float64 + TCPAbortOnTimeout float64 + TCPAbortOnLinger float64 + TCPAbortFailed float64 + TCPMemoryPressures float64 + TCPMemoryPressuresChrono float64 + TCPSACKDiscard float64 + TCPDSACKIgnoredOld float64 + TCPDSACKIgnoredNoUndo float64 + TCPSpuriousRTOs float64 + TCPMD5NotFound float64 + TCPMD5Unexpected float64 + TCPMD5Failure float64 + TCPSackShifted float64 + TCPSackMerged float64 + TCPSackShiftFallback float64 + TCPBacklogDrop float64 + PFMemallocDrop float64 + TCPMinTTLDrop float64 + TCPDeferAcceptDrop float64 + IPReversePathFilter float64 + TCPTimeWaitOverflow float64 + TCPReqQFullDoCookies float64 + TCPReqQFullDrop float64 + TCPRetransFail float64 + TCPRcvCoalesce float64 + TCPOFOQueue float64 + TCPOFODrop float64 + TCPOFOMerge float64 + TCPChallengeACK float64 + TCPSYNChallenge float64 + TCPFastOpenActive float64 + TCPFastOpenActiveFail float64 + TCPFastOpenPassive float64 + TCPFastOpenPassiveFail float64 + TCPFastOpenListenOverflow float64 + TCPFastOpenCookieReqd float64 + TCPFastOpenBlackhole float64 + TCPSpuriousRtxHostQueues float64 + BusyPollRxPackets float64 + TCPAutoCorking float64 + TCPFromZeroWindowAdv float64 + TCPToZeroWindowAdv float64 + TCPWantZeroWindowAdv float64 + TCPSynRetrans float64 + TCPOrigDataSent float64 + TCPHystartTrainDetect float64 + TCPHystartTrainCwnd float64 + TCPHystartDelayDetect float64 + TCPHystartDelayCwnd float64 + TCPACKSkippedSynRecv float64 + TCPACKSkippedPAWS float64 + TCPACKSkippedSeq float64 + TCPACKSkippedFinWait2 float64 + TCPACKSkippedTimeWait float64 + TCPACKSkippedChallenge float64 + TCPWinProbe float64 + TCPKeepAlive float64 + TCPMTUPFail float64 + TCPMTUPSuccess float64 + TCPWqueueTooBig float64 +} + +type IpExt struct { + InNoRoutes float64 + InTruncatedPkts float64 + InMcastPkts float64 + OutMcastPkts float64 + InBcastPkts float64 + OutBcastPkts float64 + InOctets float64 + OutOctets float64 + InMcastOctets float64 + OutMcastOctets float64 + InBcastOctets float64 + OutBcastOctets float64 + InCsumErrors float64 + InNoECTPkts float64 + InECT1Pkts float64 + InECT0Pkts float64 + InCEPkts float64 + ReasmOverlaps float64 +} + +func (p Proc) Netstat() (ProcNetstat, error) { + filename := p.path("net/netstat") + procNetstat := ProcNetstat{PID: p.PID} + + data, err := util.ReadFileNoStat(filename) + if err != nil { + return procNetstat, err + } + + netStats, err := parseNetstat(bytes.NewReader(data), filename) + if err != nil { + return procNetstat, err + } + + mapStructureErr := mapstructure.Decode(netStats, &procNetstat) + if mapStructureErr != nil { + return procNetstat, mapStructureErr + } + + return procNetstat, nil +} + +// parseNetstat parses the metrics from proc//net/netstat file +// and returns a map contains those metrics (e.g. {"TcpExt": {"SyncookiesSent": 0}}). +func parseNetstat(r io.Reader, fileName string) (map[string]map[string]float64, error) { + var ( + netStats = map[string]map[string]float64{} + scanner = bufio.NewScanner(r) + ) + + for scanner.Scan() { + nameParts := strings.Split(scanner.Text(), " ") + scanner.Scan() + valueParts := strings.Split(scanner.Text(), " ") + // Remove trailing :. + protocol := nameParts[0][:len(nameParts[0])-1] + netStats[protocol] = map[string]float64{} + if len(nameParts) != len(valueParts) { + return nil, fmt.Errorf("mismatch field count mismatch in %s: %s", + fileName, protocol) + } + for i := 1; i < len(nameParts); i++ { + var err error + netStats[protocol][nameParts[i]], err = strconv.ParseFloat(valueParts[i], 64) + if err != nil { + return nil, err + } + } + } + + return netStats, scanner.Err() +} diff --git a/proc_netstat_test.go b/proc_netstat_test.go new file mode 100644 index 000000000..34fb8d7f1 --- /dev/null +++ b/proc_netstat_test.go @@ -0,0 +1,36 @@ +package procfs + +import "testing" + +func TestProcNetstat(t *testing.T) { + p, err := getProcFixtures(t).Proc(26231) + if err != nil { + t.Fatal(err) + } + + procNetstat, err := p.Netstat() + if err != nil { + t.Fatal(err) + } + + for _, test := range []struct { + name string + want float64 + have float64 + }{ + {name: "pid", want: 26231, have: float64(procNetstat.PID)}, + {name: "TcpExt:SyncookiesSent", want: 0, have: procNetstat.TcpExt.SyncookiesSent}, + {name: "TcpExt:EmbryonicRsts", want: 1, have: procNetstat.TcpExt.EmbryonicRsts}, + {name: "TcpExt:TW", want: 83, have: procNetstat.TcpExt.TW}, + {name: "TcpExt:PAWSEstab", want: 3640, have: procNetstat.TcpExt.PAWSEstab}, + + {name: "IpExt:InNoRoutes", want: 0, have: procNetstat.IpExt.InNoRoutes}, + {name: "TcpExt:InMcastPkts", want: 208, have: procNetstat.IpExt.InMcastPkts}, + {name: "TcpExt:OutMcastPkts", want: 214, have: procNetstat.IpExt.OutMcastPkts}, + } { + if test.want != test.have { + t.Errorf("want %s %f, have %f", test.name, test.want, test.have) + } + } + +} diff --git a/proc_snmp.go b/proc_snmp.go new file mode 100644 index 000000000..ef78321d2 --- /dev/null +++ b/proc_snmp.go @@ -0,0 +1,188 @@ +// Copyright 2022 The Prometheus Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package procfs + +import ( + "bufio" + "bytes" + "fmt" + "io" + "strconv" + "strings" + + "github.com/mitchellh/mapstructure" + "github.com/prometheus/procfs/internal/util" +) + +// ProcSnmp models the content of /proc//net/snmp. +type ProcSnmp struct { + // The process ID. + PID int + Ip + Icmp + IcmpMsg + Tcp + Udp + UdpLite +} + +type Ip struct { + Forwarding float64 + DefaultTTL float64 + InReceives float64 + InHdrErrors float64 + InAddrErrors float64 + ForwDatagrams float64 + InUnknownProtos float64 + InDiscards float64 + InDelivers float64 + OutRequests float64 + OutDiscards float64 + OutNoRoutes float64 + ReasmTimeout float64 + ReasmReqds float64 + ReasmOKs float64 + ReasmFails float64 + FragOKs float64 + FragFails float64 + FragCreates float64 +} + +type Icmp struct { + InMsgs float64 + InErrors float64 + InCsumErrors float64 + InDestUnreachs float64 + InTimeExcds float64 + InParmProbs float64 + InSrcQuenchs float64 + InRedirects float64 + InEchos float64 + InEchoReps float64 + InTimestamps float64 + InTimestampReps float64 + InAddrMasks float64 + InAddrMaskReps float64 + OutMsgs float64 + OutErrors float64 + OutDestUnreachs float64 + OutTimeExcds float64 + OutParmProbs float64 + OutSrcQuenchs float64 + OutRedirects float64 + OutEchos float64 + OutEchoReps float64 + OutTimestamps float64 + OutTimestampReps float64 + OutAddrMasks float64 + OutAddrMaskReps float64 +} + +type IcmpMsg struct { + InType3 float64 + OutType3 float64 +} + +type Tcp struct { + RtoAlgorithm float64 + RtoMin float64 + RtoMax float64 + MaxConn float64 + ActiveOpens float64 + PassiveOpens float64 + AttemptFails float64 + EstabResets float64 + CurrEstab float64 + InSegs float64 + OutSegs float64 + RetransSegs float64 + InErrs float64 + OutRsts float64 + InCsumErrors float64 +} + +type Udp struct { + InDatagrams float64 + NoPorts float64 + InErrors float64 + OutDatagrams float64 + RcvbufErrors float64 + SndbufErrors float64 + InCsumErrors float64 + IgnoredMulti float64 +} + +type UdpLite struct { + InDatagrams float64 + NoPorts float64 + InErrors float64 + OutDatagrams float64 + RcvbufErrors float64 + SndbufErrors float64 + InCsumErrors float64 + IgnoredMulti float64 +} + +func (p Proc) Snmp() (ProcSnmp, error) { + filename := p.path("net/snmp") + procSnmp := ProcSnmp{PID: p.PID} + + data, err := util.ReadFileNoStat(filename) + if err != nil { + return procSnmp, err + } + + netStats, err := parseSnmp(bytes.NewReader(data), filename) + if err != nil { + return procSnmp, err + } + + mapStructureErr := mapstructure.Decode(netStats, &procSnmp) + if mapStructureErr != nil { + return procSnmp, mapStructureErr + } + + return procSnmp, nil +} + +// parseSnmp parses the metrics from proc//net/snmp file +// and returns a map contains those metrics (e.g. {"Ip": {"Forwarding": 2}}). +func parseSnmp(r io.Reader, fileName string) (map[string]map[string]float64, error) { + var ( + netStats = map[string]map[string]float64{} + scanner = bufio.NewScanner(r) + ) + + for scanner.Scan() { + nameParts := strings.Split(scanner.Text(), " ") + scanner.Scan() + valueParts := strings.Split(scanner.Text(), " ") + // Remove trailing :. + protocol := nameParts[0][:len(nameParts[0])-1] + netStats[protocol] = map[string]float64{} + if len(nameParts) != len(valueParts) { + return nil, fmt.Errorf("mismatch field count mismatch in %s: %s", + fileName, protocol) + } + for i := 1; i < len(nameParts); i++ { + var err error + netStats[protocol][nameParts[i]], err = strconv.ParseFloat(valueParts[i], 64) + if err != nil { + return nil, err + } + } + } + + return netStats, scanner.Err() +} diff --git a/proc_snmp6.go b/proc_snmp6.go new file mode 100644 index 000000000..54d3a3d90 --- /dev/null +++ b/proc_snmp6.go @@ -0,0 +1,200 @@ +// Copyright 2022 The Prometheus Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package procfs + +import ( + "bufio" + "bytes" + "errors" + "io" + "os" + "strconv" + "strings" + + "github.com/mitchellh/mapstructure" + "github.com/prometheus/procfs/internal/util" +) + +// ProcSnmp6 models the content of /proc//net/snmp6. +type ProcSnmp6 struct { + // The process ID. + PID int + Ip6 + Icmp6 + Udp6 + Udp6Lite +} + +type Ip6 struct { + InReceives float64 + InHdrErrors float64 + InTooBigErrors float64 + InNoRoutes float64 + InAddrErrors float64 + InUnknownProtos float64 + InTruncatedPkts float64 + InDiscards float64 + InDelivers float64 + OutForwDatagrams float64 + OutRequests float64 + OutDiscards float64 + OutNoRoutes float64 + ReasmTimeout float64 + ReasmReqds float64 + ReasmOKs float64 + ReasmFails float64 + FragOKs float64 + FragFails float64 + FragCreates float64 + InMcastPkts float64 + OutMcastPkts float64 + InOctets float64 + OutOctets float64 + InMcastOctets float64 + OutMcastOctets float64 + InBcastOctets float64 + OutBcastOctets float64 + InNoECTPkts float64 + InECT1Pkts float64 + InECT0Pkts float64 + InCEPkts float64 +} + +type Icmp6 struct { + InMsgs float64 + InErrors float64 + OutMsgs float64 + OutErrors float64 + InCsumErrors float64 + InDestUnreachs float64 + InPktTooBigs float64 + InTimeExcds float64 + InParmProblems float64 + InEchos float64 + InEchoReplies float64 + InGroupMembQueries float64 + InGroupMembResponses float64 + InGroupMembReductions float64 + InRouterSolicits float64 + InRouterAdvertisements float64 + InNeighborSolicits float64 + InNeighborAdvertisements float64 + InRedirects float64 + InMLDv2Reports float64 + OutDestUnreachs float64 + OutPktTooBigs float64 + OutTimeExcds float64 + OutParmProblems float64 + OutEchos float64 + OutEchoReplies float64 + OutGroupMembQueries float64 + OutGroupMembResponses float64 + OutGroupMembReductions float64 + OutRouterSolicits float64 + OutRouterAdvertisements float64 + OutNeighborSolicits float64 + OutNeighborAdvertisements float64 + OutRedirects float64 + OutMLDv2Reports float64 + InType1 float64 + InType134 float64 + InType135 float64 + InType136 float64 + InType143 float64 + OutType133 float64 + OutType135 float64 + OutType136 float64 + OutType143 float64 +} + +type Udp6 struct { + InDatagrams float64 + NoPorts float64 + InErrors float64 + OutDatagrams float64 + RcvbufErrors float64 + SndbufErrors float64 + InCsumErrors float64 + IgnoredMulti float64 +} + +type Udp6Lite struct { + InDatagrams float64 + NoPorts float64 + InErrors float64 + OutDatagrams float64 + RcvbufErrors float64 + SndbufErrors float64 + InCsumErrors float64 +} + +func (p Proc) Snmp6() (ProcSnmp6, error) { + filename := p.path("net/snmp6") + procSnmp6 := ProcSnmp6{PID: p.PID} + + data, err := util.ReadFileNoStat(filename) + if err != nil { + // On systems with IPv6 disabled, this file won't exist. + // Do nothing. + if errors.Is(err, os.ErrNotExist) { + return procSnmp6, nil + } + + return procSnmp6, err + } + + netStats, err := parseSNMP6Stats(bytes.NewReader(data)) + if err != nil { + return procSnmp6, err + } + + mapStructureErr := mapstructure.Decode(netStats, &procSnmp6) + if mapStructureErr != nil { + return procSnmp6, mapStructureErr + } + + return procSnmp6, nil + +} + +// parseSnmp6 parses the metrics from proc//net/snmp6 file +// and returns a map contains those metrics. +func parseSNMP6Stats(r io.Reader) (map[string]map[string]float64, error) { + var ( + netStats = map[string]map[string]float64{} + scanner = bufio.NewScanner(r) + ) + + for scanner.Scan() { + stat := strings.Fields(scanner.Text()) + if len(stat) < 2 { + continue + } + // Expect to have "6" in metric name, skip line otherwise + if sixIndex := strings.Index(stat[0], "6"); sixIndex != -1 { + protocol := stat[0][:sixIndex+1] + name := stat[0][sixIndex+1:] + if _, present := netStats[protocol]; !present { + netStats[protocol] = map[string]float64{} + } + var err error + netStats[protocol][name], err = strconv.ParseFloat(stat[1], 64) + if err != nil { + return nil, err + } + } + } + + return netStats, scanner.Err() +} diff --git a/proc_snmp6_test.go b/proc_snmp6_test.go new file mode 100644 index 000000000..11d4b53b3 --- /dev/null +++ b/proc_snmp6_test.go @@ -0,0 +1,35 @@ +package procfs + +import "testing" + +func TestProcSnmp6(t *testing.T) { + p, err := getProcFixtures(t).Proc(26231) + if err != nil { + t.Fatal(err) + } + + procSnmp6, err := p.Snmp6() + if err != nil { + t.Fatal(err) + } + + for _, test := range []struct { + name string + want float64 + have float64 + }{ + {name: "pid", want: 26231, have: float64(procSnmp6.PID)}, + {name: "Ip6InReceives", want: 92166, have: procSnmp6.Ip6.InReceives}, + {name: "Ip6InDelivers", want: 92053, have: procSnmp6.Ip6.InDelivers}, + {name: "Ip6OutNoRoutes", want: 169, have: procSnmp6.Ip6.OutNoRoutes}, + {name: "Ip6InOctets", want: 113479132, have: procSnmp6.Ip6.InOctets}, + {name: "Icmp6InMsgs", want: 142, have: procSnmp6.Icmp6.InMsgs}, + {name: "Udp6InDatagrams", want: 2016, have: procSnmp6.Udp6.InDatagrams}, + {name: "UdpLite6InDatagrams", want: 0, have: procSnmp6.Udp6Lite.InDatagrams}, + } { + if test.want != test.have { + t.Errorf("want %s %f, have %f", test.name, test.want, test.have) + } + } + +} diff --git a/proc_snmp_test.go b/proc_snmp_test.go new file mode 100644 index 000000000..73c8a69f4 --- /dev/null +++ b/proc_snmp_test.go @@ -0,0 +1,52 @@ +// Copyright 2022 The Prometheus Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package procfs + +import "testing" + +func TestProcSnmp(t *testing.T) { + p, err := getProcFixtures(t).Proc(26231) + if err != nil { + t.Fatal(err) + } + + procSnmp, err := p.Snmp() + if err != nil { + t.Fatal(err) + } + + for _, test := range []struct { + name string + want float64 + have float64 + }{ + {name: "pid", want: 26231, have: float64(procSnmp.PID)}, + {name: "IP:Forwarding", want: 2, have: procSnmp.Ip.Forwarding}, + {name: "IP:DefaultTTL", want: 64, have: procSnmp.Ip.DefaultTTL}, + {name: "Icmp:InMsgs", want: 45, have: procSnmp.Icmp.InMsgs}, + {name: "IcmpMsg:InType3", want: 45, have: procSnmp.IcmpMsg.InType3}, + {name: "IcmpMsg:OutType3", want: 50, have: procSnmp.IcmpMsg.OutType3}, + {name: "TCP:RtoAlgorithm", want: 1, have: procSnmp.Tcp.RtoAlgorithm}, + {name: "TCP:RtoMin", want: 200, have: procSnmp.Tcp.RtoMin}, + {name: "Udp:InDatagrams", want: 10179, have: procSnmp.Udp.InDatagrams}, + {name: "Udp:NoPorts", want: 50, have: procSnmp.Udp.NoPorts}, + {name: "UdpLite:InDatagrams", want: 0, have: procSnmp.UdpLite.NoPorts}, + {name: "UdpLite:NoPorts", want: 0, have: procSnmp.UdpLite.NoPorts}, + } { + if test.want != test.have { + t.Errorf("want %s %f, have %f", test.name, test.want, test.have) + } + } + +} From 5c125864e551e3395834239212fb1bed51c836cf Mon Sep 17 00:00:00 2001 From: Nikos Kakavas Date: Wed, 9 Mar 2022 17:23:28 +0200 Subject: [PATCH 016/176] remove mapstructure Signed-off-by: Nikos Kakavas --- go.mod | 1 - go.sum | 2 - proc_netstat.go | 269 ++++++++++++++++++++++++++++++++++++++----- proc_netstat_test.go | 9 +- proc_snmp.go | 215 ++++++++++++++++++++++++++++++---- proc_snmp6.go | 241 +++++++++++++++++++++++++++++++++----- proc_snmp6_test.go | 2 +- 7 files changed, 650 insertions(+), 89 deletions(-) diff --git a/go.mod b/go.mod index ff171bb43..ba6681f52 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,6 @@ go 1.13 require ( github.com/google/go-cmp v0.5.4 - github.com/mitchellh/mapstructure v1.4.3 golang.org/x/sync v0.0.0-20201207232520-09787c993a3a golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c ) diff --git a/go.sum b/go.sum index ea3f41b44..7ceaf56b7 100644 --- a/go.sum +++ b/go.sum @@ -1,7 +1,5 @@ github.com/google/go-cmp v0.5.4 h1:L8R9j+yAqZuZjsqh/z+F1NCffTKKLShY6zXTItVIZ8M= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/mitchellh/mapstructure v1.4.3 h1:OVowDSCllw/YjdLkam3/sm7wEtOy59d8ndGgCcyj8cs= -github.com/mitchellh/mapstructure v1.4.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a h1:DcqTD9SDLc+1P/r1EmRBwnVsrOwW+kk2vWf9n+1sGhs= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c h1:VwygUrnw9jn88c4u8GD3rZQbqrP/tgas88tPUbBxQrk= diff --git a/proc_netstat.go b/proc_netstat.go index 418f1f514..d7d270578 100644 --- a/proc_netstat.go +++ b/proc_netstat.go @@ -21,7 +21,6 @@ import ( "strconv" "strings" - "github.com/mitchellh/mapstructure" "github.com/prometheus/procfs/internal/util" ) @@ -171,32 +170,21 @@ type IpExt struct { func (p Proc) Netstat() (ProcNetstat, error) { filename := p.path("net/netstat") - procNetstat := ProcNetstat{PID: p.PID} - data, err := util.ReadFileNoStat(filename) if err != nil { - return procNetstat, err - } - - netStats, err := parseNetstat(bytes.NewReader(data), filename) - if err != nil { - return procNetstat, err - } - - mapStructureErr := mapstructure.Decode(netStats, &procNetstat) - if mapStructureErr != nil { - return procNetstat, mapStructureErr + return ProcNetstat{PID: p.PID}, err } - - return procNetstat, nil + procNetstat, err := parseNetstat(bytes.NewReader(data), filename) + procNetstat.PID = p.PID + return procNetstat, err } // parseNetstat parses the metrics from proc//net/netstat file -// and returns a map contains those metrics (e.g. {"TcpExt": {"SyncookiesSent": 0}}). -func parseNetstat(r io.Reader, fileName string) (map[string]map[string]float64, error) { +// and returns a ProcNetstat structure. +func parseNetstat(r io.Reader, fileName string) (ProcNetstat, error) { var ( - netStats = map[string]map[string]float64{} scanner = bufio.NewScanner(r) + procNetstat = ProcNetstat{} ) for scanner.Scan() { @@ -205,19 +193,248 @@ func parseNetstat(r io.Reader, fileName string) (map[string]map[string]float64, valueParts := strings.Split(scanner.Text(), " ") // Remove trailing :. protocol := nameParts[0][:len(nameParts[0])-1] - netStats[protocol] = map[string]float64{} if len(nameParts) != len(valueParts) { - return nil, fmt.Errorf("mismatch field count mismatch in %s: %s", + return procNetstat, fmt.Errorf("mismatch field count mismatch in %s: %s", fileName, protocol) } for i := 1; i < len(nameParts); i++ { - var err error - netStats[protocol][nameParts[i]], err = strconv.ParseFloat(valueParts[i], 64) + value, err := strconv.ParseFloat(valueParts[i], 64) if err != nil { - return nil, err + return procNetstat, err + } + key := nameParts[i] + + switch protocol { + case "TcpExt": + switch key { + case "SyncookiesSent": + procNetstat.TcpExt.SyncookiesSent = value + case "SyncookiesRecv": + procNetstat.TcpExt.SyncookiesRecv = value + case "SyncookiesFailed": + procNetstat.TcpExt.SyncookiesFailed = value + case "EmbryonicRsts": + procNetstat.TcpExt.EmbryonicRsts = value + case "PruneCalled": + procNetstat.TcpExt.PruneCalled = value + case "RcvPruned": + procNetstat.TcpExt.RcvPruned = value + case "OfoPruned": + procNetstat.TcpExt.OfoPruned = value + case "OutOfWindowIcmps": + procNetstat.TcpExt.OutOfWindowIcmps = value + case "LockDroppedIcmps": + procNetstat.TcpExt.LockDroppedIcmps = value + case "ArpFilter": + procNetstat.TcpExt.ArpFilter = value + case "TW": + procNetstat.TcpExt.TW = value + case "TWRecycled": + procNetstat.TcpExt.TWRecycled = value + case "TWKilled": + procNetstat.TcpExt.TWKilled = value + case "PAWSActive": + procNetstat.TcpExt.PAWSActive = value + case "PAWSEstab": + procNetstat.TcpExt.PAWSEstab = value + case "DelayedACKs": + procNetstat.TcpExt.DelayedACKs = value + case "DelayedACKLocked": + procNetstat.TcpExt.DelayedACKLocked = value + case "DelayedACKLost": + procNetstat.TcpExt.DelayedACKLost = value + case "ListenOverflows": + procNetstat.TcpExt.ListenOverflows = value + case "ListenDrops": + procNetstat.TcpExt.ListenDrops = value + case "TCPHPHits": + procNetstat.TcpExt.TCPHPHits = value + case "TCPPureAcks": + procNetstat.TcpExt.TCPPureAcks = value + case "TCPHPAcks": + procNetstat.TcpExt.TCPHPAcks = value + case "TCPRenoRecovery": + procNetstat.TcpExt.TCPRenoRecovery = value + case "TCPSackRecovery": + procNetstat.TcpExt.TCPSackRecovery = value + case "TCPSACKReneging": + procNetstat.TcpExt.TCPSACKReneging = value + case "TCPSACKReorder": + procNetstat.TcpExt.TCPSACKReorder = value + case "TCPRenoReorder": + procNetstat.TcpExt.TCPRenoReorder = value + case "TCPTSReorder": + procNetstat.TcpExt.TCPTSReorder = value + case "TCPFullUndo": + procNetstat.TcpExt.TCPFullUndo = value + case "TCPPartialUndo": + procNetstat.TcpExt.TCPPartialUndo = value + case "TCPDSACKUndo": + procNetstat.TcpExt.TCPDSACKUndo = value + case "TCPLossUndo": + procNetstat.TcpExt.TCPLossUndo = value + case "TCPLostRetransmit": + procNetstat.TcpExt.TCPLostRetransmit = value + case "TCPRenoFailures": + procNetstat.TcpExt.TCPRenoFailures = value + case "TCPSackFailures": + procNetstat.TcpExt.TCPSackFailures = value + case "TCPLossFailures": + procNetstat.TcpExt.TCPLossFailures = value + case "TCPFastRetrans": + procNetstat.TcpExt.TCPFastRetrans = value + case "TCPSlowStartRetrans": + procNetstat.TcpExt.TCPSlowStartRetrans = value + case "TCPTimeouts": + procNetstat.TcpExt.TCPTimeouts = value + case "TCPLossProbes": + procNetstat.TcpExt.TCPLossProbes = value + case "TCPLossProbeRecovery": + procNetstat.TcpExt.TCPLossProbeRecovery = value + case "TCPRenoRecoveryFail": + procNetstat.TcpExt.TCPRenoRecoveryFail = value + case "TCPSackRecoveryFail": + procNetstat.TcpExt.TCPSackRecoveryFail = value + case "TCPRcvCollapsed": + procNetstat.TcpExt.TCPRcvCollapsed = value + case "TCPDSACKOldSent": + procNetstat.TcpExt.TCPDSACKOldSent = value + case "TCPDSACKOfoSent": + procNetstat.TcpExt.TCPDSACKOfoSent = value + case "TCPDSACKRecv": + procNetstat.TcpExt.TCPDSACKRecv = value + case "TCPDSACKOfoRecv": + procNetstat.TcpExt.TCPDSACKOfoRecv = value + case "TCPAbortOnData": + procNetstat.TcpExt.TCPAbortOnData = value + case "TCPAbortOnClose": + procNetstat.TcpExt.TCPAbortOnClose = value + case "TCPDeferAcceptDrop": + procNetstat.TcpExt.TCPDeferAcceptDrop = value + case "IPReversePathFilter": + procNetstat.TcpExt.IPReversePathFilter = value + case "TCPTimeWaitOverflow": + procNetstat.TcpExt.TCPTimeWaitOverflow = value + case "TCPReqQFullDoCookies": + procNetstat.TcpExt.TCPReqQFullDoCookies = value + case "TCPReqQFullDrop": + procNetstat.TcpExt.TCPReqQFullDrop = value + case "TCPRetransFail": + procNetstat.TcpExt.TCPRetransFail = value + case "TCPRcvCoalesce": + procNetstat.TcpExt.TCPRcvCoalesce = value + case "TCPOFOQueue": + procNetstat.TcpExt.TCPOFOQueue = value + case "TCPOFODrop": + procNetstat.TcpExt.TCPOFODrop = value + case "TCPOFOMerge": + procNetstat.TcpExt.TCPOFOMerge = value + case "TCPChallengeACK": + procNetstat.TcpExt.TCPChallengeACK = value + case "TCPSYNChallenge": + procNetstat.TcpExt.TCPSYNChallenge = value + case "TCPFastOpenActive": + procNetstat.TcpExt.TCPFastOpenActive = value + case "TCPFastOpenActiveFail": + procNetstat.TcpExt.TCPFastOpenActiveFail = value + case "TCPFastOpenPassive": + procNetstat.TcpExt.TCPFastOpenPassive = value + case "TCPFastOpenPassiveFail": + procNetstat.TcpExt.TCPFastOpenPassiveFail = value + case "TCPFastOpenListenOverflow": + procNetstat.TcpExt.TCPFastOpenListenOverflow = value + case "TCPFastOpenCookieReqd": + procNetstat.TcpExt.TCPFastOpenCookieReqd = value + case "TCPFastOpenBlackhole": + procNetstat.TcpExt.TCPFastOpenBlackhole = value + case "TCPSpuriousRtxHostQueues": + procNetstat.TcpExt.TCPSpuriousRtxHostQueues = value + case "BusyPollRxPackets": + procNetstat.TcpExt.BusyPollRxPackets = value + case "TCPAutoCorking": + procNetstat.TcpExt.TCPAutoCorking = value + case "TCPFromZeroWindowAdv": + procNetstat.TcpExt.TCPFromZeroWindowAdv = value + case "TCPToZeroWindowAdv": + procNetstat.TcpExt.TCPToZeroWindowAdv = value + case "TCPWantZeroWindowAdv": + procNetstat.TcpExt.TCPWantZeroWindowAdv = value + case "TCPSynRetrans": + procNetstat.TcpExt.TCPSynRetrans = value + case "TCPOrigDataSent": + procNetstat.TcpExt.TCPOrigDataSent = value + case "TCPHystartTrainDetect": + procNetstat.TcpExt.TCPHystartTrainDetect = value + case "TCPHystartTrainCwnd": + procNetstat.TcpExt.TCPHystartTrainCwnd = value + case "TCPHystartDelayDetect": + procNetstat.TcpExt.TCPHystartDelayDetect = value + case "TCPHystartDelayCwnd": + procNetstat.TcpExt.TCPHystartDelayCwnd = value + case "TCPACKSkippedSynRecv": + procNetstat.TcpExt.TCPACKSkippedSynRecv = value + case "TCPACKSkippedPAWS": + procNetstat.TcpExt.TCPACKSkippedPAWS = value + case "TCPACKSkippedSeq": + procNetstat.TcpExt.TCPACKSkippedSeq = value + case "TCPACKSkippedFinWait2": + procNetstat.TcpExt.TCPACKSkippedFinWait2 = value + case "TCPACKSkippedTimeWait": + procNetstat.TcpExt.TCPACKSkippedTimeWait = value + case "TCPACKSkippedChallenge": + procNetstat.TcpExt.TCPACKSkippedChallenge = value + case "TCPWinProbe": + procNetstat.TcpExt.TCPWinProbe = value + case "TCPKeepAlive": + procNetstat.TcpExt.TCPKeepAlive = value + case "TCPMTUPFail": + procNetstat.TcpExt.TCPMTUPFail = value + case "TCPMTUPSuccess": + procNetstat.TcpExt.TCPMTUPSuccess = value + case "TCPWqueueTooBig": + procNetstat.TcpExt.TCPWqueueTooBig = value + } + case "IpExt": + switch key { + case "InNoRoutes": + procNetstat.IpExt.InNoRoutes = value + case "InTruncatedPkts": + procNetstat.IpExt.InTruncatedPkts = value + case "InMcastPkts": + procNetstat.IpExt.InMcastPkts = value + case "OutMcastPkts": + procNetstat.IpExt.OutMcastPkts = value + case "InBcastPkts": + procNetstat.IpExt.InBcastPkts = value + case "OutBcastPkts": + procNetstat.IpExt.OutBcastPkts = value + case "InOctets": + procNetstat.IpExt.InOctets = value + case "OutOctets": + procNetstat.IpExt.OutOctets = value + case "InMcastOctets": + procNetstat.IpExt.InMcastOctets = value + case "OutMcastOctets": + procNetstat.IpExt.OutMcastOctets = value + case "InBcastOctets": + procNetstat.IpExt.InBcastOctets = value + case "OutBcastOctets": + procNetstat.IpExt.OutBcastOctets = value + case "InCsumErrors": + procNetstat.IpExt.InCsumErrors = value + case "InNoECTPkts": + procNetstat.IpExt.InNoECTPkts = value + case "InECT1Pkts": + procNetstat.IpExt.InECT1Pkts = value + case "InECT0Pkts": + procNetstat.IpExt.InECT0Pkts = value + case "InCEPkts": + procNetstat.IpExt.InCEPkts = value + case "ReasmOverlaps": + procNetstat.IpExt.ReasmOverlaps = value + } } } } - - return netStats, scanner.Err() + return procNetstat, scanner.Err() } diff --git a/proc_netstat_test.go b/proc_netstat_test.go index 34fb8d7f1..3a0ed31ca 100644 --- a/proc_netstat_test.go +++ b/proc_netstat_test.go @@ -1,6 +1,8 @@ package procfs -import "testing" +import ( + "testing" +) func TestProcNetstat(t *testing.T) { p, err := getProcFixtures(t).Proc(26231) @@ -25,12 +27,11 @@ func TestProcNetstat(t *testing.T) { {name: "TcpExt:PAWSEstab", want: 3640, have: procNetstat.TcpExt.PAWSEstab}, {name: "IpExt:InNoRoutes", want: 0, have: procNetstat.IpExt.InNoRoutes}, - {name: "TcpExt:InMcastPkts", want: 208, have: procNetstat.IpExt.InMcastPkts}, - {name: "TcpExt:OutMcastPkts", want: 214, have: procNetstat.IpExt.OutMcastPkts}, + {name: "IpExt:InMcastPkts", want: 208, have: procNetstat.IpExt.InMcastPkts}, + {name: "IpExt:OutMcastPkts", want: 214, have: procNetstat.IpExt.OutMcastPkts}, } { if test.want != test.have { t.Errorf("want %s %f, have %f", test.name, test.want, test.have) } } - } diff --git a/proc_snmp.go b/proc_snmp.go index ef78321d2..c70853fba 100644 --- a/proc_snmp.go +++ b/proc_snmp.go @@ -21,7 +21,6 @@ import ( "strconv" "strings" - "github.com/mitchellh/mapstructure" "github.com/prometheus/procfs/internal/util" ) @@ -136,32 +135,21 @@ type UdpLite struct { func (p Proc) Snmp() (ProcSnmp, error) { filename := p.path("net/snmp") - procSnmp := ProcSnmp{PID: p.PID} - data, err := util.ReadFileNoStat(filename) if err != nil { - return procSnmp, err - } - - netStats, err := parseSnmp(bytes.NewReader(data), filename) - if err != nil { - return procSnmp, err - } - - mapStructureErr := mapstructure.Decode(netStats, &procSnmp) - if mapStructureErr != nil { - return procSnmp, mapStructureErr + return ProcSnmp{PID: p.PID}, err } - - return procSnmp, nil + procSnmp, err := parseSnmp(bytes.NewReader(data), filename) + procSnmp.PID = p.PID + return procSnmp, err } // parseSnmp parses the metrics from proc//net/snmp file // and returns a map contains those metrics (e.g. {"Ip": {"Forwarding": 2}}). -func parseSnmp(r io.Reader, fileName string) (map[string]map[string]float64, error) { +func parseSnmp(r io.Reader, fileName string) (ProcSnmp, error) { var ( - netStats = map[string]map[string]float64{} scanner = bufio.NewScanner(r) + procSnmp = ProcSnmp{} ) for scanner.Scan() { @@ -170,19 +158,196 @@ func parseSnmp(r io.Reader, fileName string) (map[string]map[string]float64, err valueParts := strings.Split(scanner.Text(), " ") // Remove trailing :. protocol := nameParts[0][:len(nameParts[0])-1] - netStats[protocol] = map[string]float64{} if len(nameParts) != len(valueParts) { - return nil, fmt.Errorf("mismatch field count mismatch in %s: %s", + return procSnmp, fmt.Errorf("mismatch field count mismatch in %s: %s", fileName, protocol) } for i := 1; i < len(nameParts); i++ { - var err error - netStats[protocol][nameParts[i]], err = strconv.ParseFloat(valueParts[i], 64) + value, err := strconv.ParseFloat(valueParts[i], 64) if err != nil { - return nil, err + return procSnmp, err + } + key := nameParts[i] + + switch protocol { + case "Ip": + switch key { + case "Forwarding": + procSnmp.Ip.Forwarding = value + case "DefaultTTL": + procSnmp.Ip.DefaultTTL = value + case "InReceives": + procSnmp.Ip.InReceives = value + case "InHdrErrors": + procSnmp.Ip.InHdrErrors = value + case "InAddrErrors": + procSnmp.Ip.InAddrErrors = value + case "ForwDatagrams": + procSnmp.Ip.ForwDatagrams = value + case "InUnknownProtos": + procSnmp.Ip.InUnknownProtos = value + case "InDiscards": + procSnmp.Ip.InDiscards = value + case "InDelivers": + procSnmp.Ip.InDelivers = value + case "OutRequests": + procSnmp.Ip.OutRequests = value + case "OutDiscards": + procSnmp.Ip.OutDiscards = value + case "OutNoRoutes": + procSnmp.Ip.OutNoRoutes = value + case "ReasmTimeout": + procSnmp.Ip.ReasmTimeout = value + case "ReasmReqds": + procSnmp.Ip.ReasmReqds = value + case "ReasmOKs": + procSnmp.Ip.ReasmOKs = value + case "ReasmFails": + procSnmp.Ip.ReasmFails = value + case "FragOKs": + procSnmp.Ip.FragOKs = value + case "FragFails": + procSnmp.Ip.FragFails = value + case "FragCreates": + procSnmp.Ip.FragCreates = value + } + case "Icmp": + switch key { + case "InMsgs": + procSnmp.Icmp.InMsgs = value + case "InErrors": + procSnmp.Icmp.InErrors = value + case "InCsumErrors": + procSnmp.Icmp.InCsumErrors = value + case "InDestUnreachs": + procSnmp.Icmp.InDestUnreachs = value + case "InTimeExcds": + procSnmp.Icmp.InTimeExcds = value + case "InParmProbs": + procSnmp.Icmp.InParmProbs = value + case "InSrcQuenchs": + procSnmp.Icmp.InSrcQuenchs = value + case "InRedirects": + procSnmp.Icmp.InRedirects = value + case "InEchos": + procSnmp.Icmp.InEchos = value + case "InEchoReps": + procSnmp.Icmp.InEchoReps = value + case "InTimestamps": + procSnmp.Icmp.InTimestamps = value + case "InTimestampReps": + procSnmp.Icmp.InTimestampReps = value + case "InAddrMasks": + procSnmp.Icmp.InAddrMasks = value + case "InAddrMaskReps": + procSnmp.Icmp.InAddrMaskReps = value + case "OutMsgs": + procSnmp.Icmp.OutMsgs = value + case "OutErrors": + procSnmp.Icmp.OutErrors = value + case "OutDestUnreachs": + procSnmp.Icmp.OutDestUnreachs = value + case "OutTimeExcds": + procSnmp.Icmp.OutTimeExcds = value + case "OutParmProbs": + procSnmp.Icmp.OutParmProbs = value + case "OutSrcQuenchs": + procSnmp.Icmp.OutSrcQuenchs = value + case "OutRedirects": + procSnmp.Icmp.OutRedirects = value + case "OutEchos": + procSnmp.Icmp.OutEchos = value + case "OutEchoReps": + procSnmp.Icmp.OutEchoReps = value + case "OutTimestamps": + procSnmp.Icmp.OutTimestamps = value + case "OutTimestampReps": + procSnmp.Icmp.OutTimestampReps = value + case "OutAddrMasks": + procSnmp.Icmp.OutAddrMasks = value + case "OutAddrMaskReps": + procSnmp.Icmp.OutAddrMaskReps = value + } + case "IcmpMsg": + switch key { + case "InType3": + procSnmp.IcmpMsg.InType3 = value + case "OutType3": + procSnmp.IcmpMsg.OutType3 = value + } + case "Tcp": + switch key { + case "RtoAlgorithm": + procSnmp.Tcp.RtoAlgorithm = value + case "RtoMin": + procSnmp.Tcp.RtoMin = value + case "RtoMax": + procSnmp.Tcp.RtoMax = value + case "MaxConn": + procSnmp.Tcp.MaxConn = value + case "ActiveOpens": + procSnmp.Tcp.ActiveOpens = value + case "PassiveOpens": + procSnmp.Tcp.PassiveOpens = value + case "AttemptFails": + procSnmp.Tcp.AttemptFails = value + case "EstabResets": + procSnmp.Tcp.EstabResets = value + case "CurrEstab": + procSnmp.Tcp.CurrEstab = value + case "InSegs": + procSnmp.Tcp.InSegs = value + case "OutSegs": + procSnmp.Tcp.OutSegs = value + case "RetransSegs": + procSnmp.Tcp.RetransSegs = value + case "InErrs": + procSnmp.Tcp.InErrs = value + case "OutRsts": + procSnmp.Tcp.OutRsts = value + case "InCsumErrors": + procSnmp.Tcp.InCsumErrors = value + } + case "Udp": + switch key { + case "InDatagrams": + procSnmp.Udp.InDatagrams = value + case "NoPorts": + procSnmp.Udp.NoPorts = value + case "InErrors": + procSnmp.Udp.InErrors = value + case "OutDatagrams": + procSnmp.Udp.OutDatagrams = value + case "RcvbufErrors": + procSnmp.Udp.RcvbufErrors = value + case "SndbufErrors": + procSnmp.Udp.SndbufErrors = value + case "InCsumErrors": + procSnmp.Udp.InCsumErrors = value + case "IgnoredMulti": + procSnmp.Udp.IgnoredMulti = value + } + case "UdpLite": + switch key { + case "InDatagrams": + procSnmp.UdpLite.InDatagrams = value + case "NoPorts": + procSnmp.UdpLite.NoPorts = value + case "InErrors": + procSnmp.UdpLite.InErrors = value + case "OutDatagrams": + procSnmp.UdpLite.OutDatagrams = value + case "RcvbufErrors": + procSnmp.UdpLite.RcvbufErrors = value + case "SndbufErrors": + procSnmp.UdpLite.SndbufErrors = value + case "InCsumErrors": + procSnmp.UdpLite.InCsumErrors = value + case "IgnoredMulti": + procSnmp.UdpLite.IgnoredMulti = value + } } } } - - return netStats, scanner.Err() + return procSnmp, scanner.Err() } diff --git a/proc_snmp6.go b/proc_snmp6.go index 54d3a3d90..943899528 100644 --- a/proc_snmp6.go +++ b/proc_snmp6.go @@ -22,7 +22,6 @@ import ( "strconv" "strings" - "github.com/mitchellh/mapstructure" "github.com/prometheus/procfs/internal/util" ) @@ -33,7 +32,7 @@ type ProcSnmp6 struct { Ip6 Icmp6 Udp6 - Udp6Lite + UdpLite6 } type Ip6 struct { @@ -129,7 +128,7 @@ type Udp6 struct { IgnoredMulti float64 } -type Udp6Lite struct { +type UdpLite6 struct { InDatagrams float64 NoPorts float64 InErrors float64 @@ -141,39 +140,28 @@ type Udp6Lite struct { func (p Proc) Snmp6() (ProcSnmp6, error) { filename := p.path("net/snmp6") - procSnmp6 := ProcSnmp6{PID: p.PID} - data, err := util.ReadFileNoStat(filename) if err != nil { // On systems with IPv6 disabled, this file won't exist. // Do nothing. if errors.Is(err, os.ErrNotExist) { - return procSnmp6, nil + return ProcSnmp6{PID: p.PID}, nil } - return procSnmp6, err - } - - netStats, err := parseSNMP6Stats(bytes.NewReader(data)) - if err != nil { - return procSnmp6, err - } - - mapStructureErr := mapstructure.Decode(netStats, &procSnmp6) - if mapStructureErr != nil { - return procSnmp6, mapStructureErr + return ProcSnmp6{PID: p.PID}, err } - return procSnmp6, nil - + procSnmp6, err := parseSNMP6Stats(bytes.NewReader(data)) + procSnmp6.PID = p.PID + return procSnmp6, err } // parseSnmp6 parses the metrics from proc//net/snmp6 file // and returns a map contains those metrics. -func parseSNMP6Stats(r io.Reader) (map[string]map[string]float64, error) { +func parseSNMP6Stats(r io.Reader) (ProcSnmp6, error) { var ( - netStats = map[string]map[string]float64{} scanner = bufio.NewScanner(r) + procSnmp6 = ProcSnmp6{} ) for scanner.Scan() { @@ -184,17 +172,210 @@ func parseSNMP6Stats(r io.Reader) (map[string]map[string]float64, error) { // Expect to have "6" in metric name, skip line otherwise if sixIndex := strings.Index(stat[0], "6"); sixIndex != -1 { protocol := stat[0][:sixIndex+1] - name := stat[0][sixIndex+1:] - if _, present := netStats[protocol]; !present { - netStats[protocol] = map[string]float64{} - } - var err error - netStats[protocol][name], err = strconv.ParseFloat(stat[1], 64) + key := stat[0][sixIndex+1:] + value, err := strconv.ParseFloat(stat[1], 64) if err != nil { - return nil, err + return procSnmp6, err + } + + switch protocol { + case "Ip6": + switch key { + case "InReceives": + procSnmp6.Ip6.InReceives = value + case "InHdrErrors": + procSnmp6.Ip6.InHdrErrors = value + case "InTooBigErrors": + procSnmp6.Ip6.InTooBigErrors = value + case "InNoRoutes": + procSnmp6.Ip6.InNoRoutes = value + case "InAddrErrors": + procSnmp6.Ip6.InAddrErrors = value + case "InUnknownProtos": + procSnmp6.Ip6.InUnknownProtos = value + case "InTruncatedPkts": + procSnmp6.Ip6.InTruncatedPkts = value + case "InDiscards": + procSnmp6.Ip6.InDiscards = value + case "InDelivers": + procSnmp6.Ip6.InDelivers = value + case "OutForwDatagrams": + procSnmp6.Ip6.OutForwDatagrams = value + case "OutRequests": + procSnmp6.Ip6.OutRequests = value + case "OutDiscards": + procSnmp6.Ip6.OutDiscards = value + case "OutNoRoutes": + procSnmp6.Ip6.OutNoRoutes = value + case "ReasmTimeout": + procSnmp6.Ip6.ReasmTimeout = value + case "ReasmReqds": + procSnmp6.Ip6.ReasmReqds = value + case "ReasmOKs": + procSnmp6.Ip6.ReasmOKs = value + case "ReasmFails": + procSnmp6.Ip6.ReasmFails = value + case "FragOKs": + procSnmp6.Ip6.FragOKs = value + case "FragFails": + procSnmp6.Ip6.FragFails = value + case "FragCreates": + procSnmp6.Ip6.FragCreates = value + case "InMcastPkts": + procSnmp6.Ip6.InMcastPkts = value + case "OutMcastPkts": + procSnmp6.Ip6.OutMcastPkts = value + case "InOctets": + procSnmp6.Ip6.InOctets = value + case "OutOctets": + procSnmp6.Ip6.OutOctets = value + case "InMcastOctets": + procSnmp6.Ip6.InMcastOctets = value + case "OutMcastOctets": + procSnmp6.Ip6.OutMcastOctets = value + case "InBcastOctets": + procSnmp6.Ip6.InBcastOctets = value + case "OutBcastOctets": + procSnmp6.Ip6.OutBcastOctets = value + case "InNoECTPkts": + procSnmp6.Ip6.InNoECTPkts = value + case "InECT1Pkts": + procSnmp6.Ip6.InECT1Pkts = value + case "InECT0Pkts": + procSnmp6.Ip6.InECT0Pkts = value + case "InCEPkts": + procSnmp6.Ip6.InCEPkts = value + + } + case "Icmp6": + switch key { + case "InMsgs": + procSnmp6.Icmp6.InMsgs = value + case "InErrors": + procSnmp6.Icmp6.InErrors = value + case "OutMsgs": + procSnmp6.Icmp6.OutMsgs = value + case "OutErrors": + procSnmp6.Icmp6.OutErrors = value + case "InCsumErrors": + procSnmp6.Icmp6.InCsumErrors = value + case "InDestUnreachs": + procSnmp6.Icmp6.InDestUnreachs = value + case "InPktTooBigs": + procSnmp6.Icmp6.InPktTooBigs = value + case "InTimeExcds": + procSnmp6.Icmp6.InTimeExcds = value + case "InParmProblems": + procSnmp6.Icmp6.InParmProblems = value + case "InEchos": + procSnmp6.Icmp6.InEchos = value + case "InEchoReplies": + procSnmp6.Icmp6.InEchoReplies = value + case "InGroupMembQueries": + procSnmp6.Icmp6.InGroupMembQueries = value + case "InGroupMembResponses": + procSnmp6.Icmp6.InGroupMembResponses = value + case "InGroupMembReductions": + procSnmp6.Icmp6.InGroupMembReductions = value + case "InRouterSolicits": + procSnmp6.Icmp6.InRouterSolicits = value + case "InRouterAdvertisements": + procSnmp6.Icmp6.InRouterAdvertisements = value + case "InNeighborSolicits": + procSnmp6.Icmp6.InNeighborSolicits = value + case "InNeighborAdvertisements": + procSnmp6.Icmp6.InNeighborAdvertisements = value + case "InRedirects": + procSnmp6.Icmp6.InRedirects = value + case "InMLDv2Reports": + procSnmp6.Icmp6.InMLDv2Reports = value + case "OutDestUnreachs": + procSnmp6.Icmp6.OutDestUnreachs = value + case "OutPktTooBigs": + procSnmp6.Icmp6.OutPktTooBigs = value + case "OutTimeExcds": + procSnmp6.Icmp6.OutTimeExcds = value + case "OutParmProblems": + procSnmp6.Icmp6.OutParmProblems = value + case "OutEchos": + procSnmp6.Icmp6.OutEchos = value + case "OutEchoReplies": + procSnmp6.Icmp6.OutEchoReplies = value + case "OutGroupMembQueries": + procSnmp6.Icmp6.OutGroupMembQueries = value + case "OutGroupMembResponses": + procSnmp6.Icmp6.OutGroupMembResponses = value + case "OutGroupMembReductions": + procSnmp6.Icmp6.OutGroupMembReductions = value + case "OutRouterSolicits": + procSnmp6.Icmp6.OutRouterSolicits = value + case "OutRouterAdvertisements": + procSnmp6.Icmp6.OutRouterAdvertisements = value + case "OutNeighborSolicits": + procSnmp6.Icmp6.OutNeighborSolicits = value + case "OutNeighborAdvertisements": + procSnmp6.Icmp6.OutNeighborAdvertisements = value + case "OutRedirects": + procSnmp6.Icmp6.OutRedirects = value + case "OutMLDv2Reports": + procSnmp6.Icmp6.OutMLDv2Reports = value + case "InType1": + procSnmp6.Icmp6.InType1 = value + case "InType134": + procSnmp6.Icmp6.InType134 = value + case "InType135": + procSnmp6.Icmp6.InType135 = value + case "InType136": + procSnmp6.Icmp6.InType136 = value + case "InType143": + procSnmp6.Icmp6.InType143 = value + case "OutType133": + procSnmp6.Icmp6.OutType133 = value + case "OutType135": + procSnmp6.Icmp6.OutType135 = value + case "OutType136": + procSnmp6.Icmp6.OutType136 = value + case "OutType143": + procSnmp6.Icmp6.OutType143 = value + } + case "Udp6": + switch key { + case "InDatagrams": + procSnmp6.Udp6.InDatagrams = value + case "NoPorts": + procSnmp6.Udp6.NoPorts = value + case "InErrors": + procSnmp6.Udp6.InErrors = value + case "OutDatagrams": + procSnmp6.Udp6.OutDatagrams = value + case "RcvbufErrors": + procSnmp6.Udp6.RcvbufErrors = value + case "SndbufErrors": + procSnmp6.Udp6.SndbufErrors = value + case "InCsumErrors": + procSnmp6.Udp6.InCsumErrors = value + case "IgnoredMulti": + procSnmp6.Udp6.IgnoredMulti = value + } + case "UdpLite6": + switch key { + case "InDatagrams": + procSnmp6.UdpLite6.InDatagrams = value + case "NoPorts": + procSnmp6.UdpLite6.NoPorts = value + case "InErrors": + procSnmp6.UdpLite6.InErrors = value + case "OutDatagrams": + procSnmp6.UdpLite6.OutDatagrams = value + case "RcvbufErrors": + procSnmp6.UdpLite6.RcvbufErrors = value + case "SndbufErrors": + procSnmp6.UdpLite6.SndbufErrors = value + case "InCsumErrors": + procSnmp6.UdpLite6.InCsumErrors = value + } } } } - - return netStats, scanner.Err() + return procSnmp6, scanner.Err() } diff --git a/proc_snmp6_test.go b/proc_snmp6_test.go index 11d4b53b3..c3a55bff0 100644 --- a/proc_snmp6_test.go +++ b/proc_snmp6_test.go @@ -25,7 +25,7 @@ func TestProcSnmp6(t *testing.T) { {name: "Ip6InOctets", want: 113479132, have: procSnmp6.Ip6.InOctets}, {name: "Icmp6InMsgs", want: 142, have: procSnmp6.Icmp6.InMsgs}, {name: "Udp6InDatagrams", want: 2016, have: procSnmp6.Udp6.InDatagrams}, - {name: "UdpLite6InDatagrams", want: 0, have: procSnmp6.Udp6Lite.InDatagrams}, + {name: "UdpLite6InDatagrams", want: 0, have: procSnmp6.UdpLite6.InDatagrams}, } { if test.want != test.have { t.Errorf("want %s %f, have %f", test.name, test.want, test.have) From 6ff7304f7a0dae5d4a8d94b068f33233e1631b15 Mon Sep 17 00:00:00 2001 From: Nikos Kakavas Date: Wed, 30 Mar 2022 15:20:59 +0300 Subject: [PATCH 017/176] Introduce strings.TrimSuffix instead of custom split Signed-off-by: Nikos Kakavas --- proc_netstat.go | 2 +- proc_snmp.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/proc_netstat.go b/proc_netstat.go index d7d270578..c974b9b2d 100644 --- a/proc_netstat.go +++ b/proc_netstat.go @@ -192,7 +192,7 @@ func parseNetstat(r io.Reader, fileName string) (ProcNetstat, error) { scanner.Scan() valueParts := strings.Split(scanner.Text(), " ") // Remove trailing :. - protocol := nameParts[0][:len(nameParts[0])-1] + protocol := strings.TrimSuffix(nameParts[0], ":") if len(nameParts) != len(valueParts) { return procNetstat, fmt.Errorf("mismatch field count mismatch in %s: %s", fileName, protocol) diff --git a/proc_snmp.go b/proc_snmp.go index c70853fba..85438cd43 100644 --- a/proc_snmp.go +++ b/proc_snmp.go @@ -157,7 +157,7 @@ func parseSnmp(r io.Reader, fileName string) (ProcSnmp, error) { scanner.Scan() valueParts := strings.Split(scanner.Text(), " ") // Remove trailing :. - protocol := nameParts[0][:len(nameParts[0])-1] + protocol := strings.TrimSuffix(nameParts[0], ":") if len(nameParts) != len(valueParts) { return procSnmp, fmt.Errorf("mismatch field count mismatch in %s: %s", fileName, protocol) From fba575dda75ac3de1e94ee7660f93c9367151935 Mon Sep 17 00:00:00 2001 From: Abbey Woodyear <81559466+abbeywoodyear@users.noreply.github.com> Date: Fri, 15 Apr 2022 15:52:51 +0100 Subject: [PATCH 018/176] Parsing for /proc/softirqs (#436) * Add parsing for softirqs Also fixes some linting and formatting issues Signed-off-by: abbeywoodyear --- fixtures.ttar | 32 ++++++--- proc_netstat.go | 2 +- proc_netstat_test.go | 13 ++++ proc_snmp6.go | 2 +- proc_snmp6_test.go | 13 ++++ softirqs.go | 160 +++++++++++++++++++++++++++++++++++++++++++ softirqs_test.go | 64 +++++++++++++++++ 7 files changed, 276 insertions(+), 10 deletions(-) create mode 100644 softirqs.go create mode 100644 softirqs_test.go diff --git a/fixtures.ttar b/fixtures.ttar index 0fe1e08c8..1eedeefaf 100644 --- a/fixtures.ttar +++ b/fixtures.ttar @@ -156,6 +156,14 @@ Inter-| Receive | Transmit eth0: 438 5 0 0 0 0 0 0 648 8 0 0 0 0 0 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/proc/26231/net/netstat +Lines: 4 +TcpExt: SyncookiesSent SyncookiesRecv SyncookiesFailed EmbryonicRsts PruneCalled RcvPruned OfoPruned OutOfWindowIcmps LockDroppedIcmps ArpFilter TW TWRecycled TWKilled PAWSActive PAWSEstab DelayedACKs DelayedACKLocked DelayedACKLost ListenOverflows ListenDrops TCPHPHits TCPPureAcks TCPHPAcks TCPRenoRecovery TCPSackRecovery TCPSACKReneging TCPSACKReorder TCPRenoReorder TCPTSReorder TCPFullUndo TCPPartialUndo TCPDSACKUndo TCPLossUndo TCPLostRetransmit TCPRenoFailures TCPSackFailures TCPLossFailures TCPFastRetrans TCPSlowStartRetrans TCPTimeouts TCPLossProbes TCPLossProbeRecovery TCPRenoRecoveryFail TCPSackRecoveryFail TCPRcvCollapsed TCPDSACKOldSent TCPDSACKOfoSent TCPDSACKRecv TCPDSACKOfoRecv TCPAbortOnData TCPAbortOnClose TCPAbortOnMemory TCPAbortOnTimeout TCPAbortOnLinger TCPAbortFailed TCPMemoryPressures TCPMemoryPressuresChrono TCPSACKDiscard TCPDSACKIgnoredOld TCPDSACKIgnoredNoUndo TCPSpuriousRTOs TCPMD5NotFound TCPMD5Unexpected TCPMD5Failure TCPSackShifted TCPSackMerged TCPSackShiftFallback TCPBacklogDrop PFMemallocDrop TCPMinTTLDrop TCPDeferAcceptDrop IPReversePathFilter TCPTimeWaitOverflow TCPReqQFullDoCookies TCPReqQFullDrop TCPRetransFail TCPRcvCoalesce TCPOFOQueue TCPOFODrop TCPOFOMerge TCPChallengeACK TCPSYNChallenge TCPFastOpenActive TCPFastOpenActiveFail TCPFastOpenPassive TCPFastOpenPassiveFail TCPFastOpenListenOverflow TCPFastOpenCookieReqd TCPFastOpenBlackhole TCPSpuriousRtxHostQueues BusyPollRxPackets TCPAutoCorking TCPFromZeroWindowAdv TCPToZeroWindowAdv TCPWantZeroWindowAdv TCPSynRetrans TCPOrigDataSent TCPHystartTrainDetect TCPHystartTrainCwnd TCPHystartDelayDetect TCPHystartDelayCwnd TCPACKSkippedSynRecv TCPACKSkippedPAWS TCPACKSkippedSeq TCPACKSkippedFinWait2 TCPACKSkippedTimeWait TCPACKSkippedChallenge TCPWinProbe TCPKeepAlive TCPMTUPFail TCPMTUPSuccess TCPWqueueTooBig +TcpExt: 0 0 0 1 0 0 0 0 0 0 83 0 0 0 3640 287 1 7460 0 0 134193 1335 829 0 4 0 1 0 0 0 0 1 19 0 0 0 0 3 0 32 100 4 0 0 0 7460 2421 49 1 62 6 0 23 0 7 0 0 0 0 19 2 0 0 0 0 0 6 0 0 0 0 3 0 0 0 0 92425 65515 0 2421 4 4 0 0 0 0 0 0 0 0 0 10 0 0 0 16 2221 0 0 2 45 0 0 3 0 0 0 0 456 0 0 0 +IpExt: InNoRoutes InTruncatedPkts InMcastPkts OutMcastPkts InBcastPkts OutBcastPkts InOctets OutOctets InMcastOctets OutMcastOctets InBcastOctets OutBcastOctets InCsumErrors InNoECTPkts InECT1Pkts InECT0Pkts InCEPkts ReasmOverlaps +IpExt: 0 0 208 214 118 111 190585481 7512674 26093 25903 14546 13628 0 134215 0 0 0 0 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: fixtures/proc/26231/net/snmp Lines: 12 Ip: Forwarding DefaultTTL InReceives InHdrErrors InAddrErrors ForwDatagrams InUnknownProtos InDiscards InDelivers OutRequests OutDiscards OutNoRoutes ReasmTimeout ReasmReqds ReasmOKs ReasmFails FragOKs FragFails FragCreates @@ -172,14 +180,6 @@ UdpLite: InDatagrams NoPorts InErrors OutDatagrams RcvbufErrors SndbufErrors InC UdpLite: 0 0 0 0 0 0 0 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/proc/26231/net/netstat -Lines: 4 -TcpExt: SyncookiesSent SyncookiesRecv SyncookiesFailed EmbryonicRsts PruneCalled RcvPruned OfoPruned OutOfWindowIcmps LockDroppedIcmps ArpFilter TW TWRecycled TWKilled PAWSActive PAWSEstab DelayedACKs DelayedACKLocked DelayedACKLost ListenOverflows ListenDrops TCPHPHits TCPPureAcks TCPHPAcks TCPRenoRecovery TCPSackRecovery TCPSACKReneging TCPSACKReorder TCPRenoReorder TCPTSReorder TCPFullUndo TCPPartialUndo TCPDSACKUndo TCPLossUndo TCPLostRetransmit TCPRenoFailures TCPSackFailures TCPLossFailures TCPFastRetrans TCPSlowStartRetrans TCPTimeouts TCPLossProbes TCPLossProbeRecovery TCPRenoRecoveryFail TCPSackRecoveryFail TCPRcvCollapsed TCPDSACKOldSent TCPDSACKOfoSent TCPDSACKRecv TCPDSACKOfoRecv TCPAbortOnData TCPAbortOnClose TCPAbortOnMemory TCPAbortOnTimeout TCPAbortOnLinger TCPAbortFailed TCPMemoryPressures TCPMemoryPressuresChrono TCPSACKDiscard TCPDSACKIgnoredOld TCPDSACKIgnoredNoUndo TCPSpuriousRTOs TCPMD5NotFound TCPMD5Unexpected TCPMD5Failure TCPSackShifted TCPSackMerged TCPSackShiftFallback TCPBacklogDrop PFMemallocDrop TCPMinTTLDrop TCPDeferAcceptDrop IPReversePathFilter TCPTimeWaitOverflow TCPReqQFullDoCookies TCPReqQFullDrop TCPRetransFail TCPRcvCoalesce TCPOFOQueue TCPOFODrop TCPOFOMerge TCPChallengeACK TCPSYNChallenge TCPFastOpenActive TCPFastOpenActiveFail TCPFastOpenPassive TCPFastOpenPassiveFail TCPFastOpenListenOverflow TCPFastOpenCookieReqd TCPFastOpenBlackhole TCPSpuriousRtxHostQueues BusyPollRxPackets TCPAutoCorking TCPFromZeroWindowAdv TCPToZeroWindowAdv TCPWantZeroWindowAdv TCPSynRetrans TCPOrigDataSent TCPHystartTrainDetect TCPHystartTrainCwnd TCPHystartDelayDetect TCPHystartDelayCwnd TCPACKSkippedSynRecv TCPACKSkippedPAWS TCPACKSkippedSeq TCPACKSkippedFinWait2 TCPACKSkippedTimeWait TCPACKSkippedChallenge TCPWinProbe TCPKeepAlive TCPMTUPFail TCPMTUPSuccess TCPWqueueTooBig -TcpExt: 0 0 0 1 0 0 0 0 0 0 83 0 0 0 3640 287 1 7460 0 0 134193 1335 829 0 4 0 1 0 0 0 0 1 19 0 0 0 0 3 0 32 100 4 0 0 0 7460 2421 49 1 62 6 0 23 0 7 0 0 0 0 19 2 0 0 0 0 0 6 0 0 0 0 3 0 0 0 0 92425 65515 0 2421 4 4 0 0 0 0 0 0 0 0 0 10 0 0 0 16 2221 0 0 2 45 0 0 3 0 0 0 0 456 0 0 0 -IpExt: InNoRoutes InTruncatedPkts InMcastPkts OutMcastPkts InBcastPkts OutBcastPkts InOctets OutOctets InMcastOctets OutMcastOctets InBcastOctets OutBcastOctets InCsumErrors InNoECTPkts InECT1Pkts InECT0Pkts InCEPkts ReasmOverlaps -IpExt: 0 0 208 214 118 111 190585481 7512674 26093 25903 14546 13628 0 134215 0 0 0 0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: fixtures/proc/26231/net/snmp6 Lines: 92 Ip6InReceives 92166 @@ -274,6 +274,7 @@ UdpLite6RcvbufErrors 0 UdpLite6SndbufErrors 0 UdpLite6InCsumErrors 0 Mode: 644 +Mode: 664 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: fixtures/proc/26231/ns Mode: 755 @@ -2773,6 +2774,21 @@ kmem_cache_node 904 928 512 32 4 : tunables 0 0 0 : sla kmem_cache 904 936 832 39 8 : tunables 0 0 0 : slabdata 24 24 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/proc/softirqs +Lines: 11 + CPU0 CPU1 + HI: 3 0 + TIMER: 2776180 247490 + NET_TX: 2419 772 + NET_RX: 55919 28694 + BLOCK: 174915 262755 + IRQ_POLL: 0 0 + TASKLET: 209 75 + SCHED: 2278692 815209 + HRTIMER: 1281 220 + RCU: 605871 532783 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: fixtures/proc/stat Lines: 16 cpu 301854 612 111922 8979004 3552 2 3944 0 0 0 diff --git a/proc_netstat.go b/proc_netstat.go index c974b9b2d..da40ea105 100644 --- a/proc_netstat.go +++ b/proc_netstat.go @@ -183,7 +183,7 @@ func (p Proc) Netstat() (ProcNetstat, error) { // and returns a ProcNetstat structure. func parseNetstat(r io.Reader, fileName string) (ProcNetstat, error) { var ( - scanner = bufio.NewScanner(r) + scanner = bufio.NewScanner(r) procNetstat = ProcNetstat{} ) diff --git a/proc_netstat_test.go b/proc_netstat_test.go index 3a0ed31ca..6cb9af270 100644 --- a/proc_netstat_test.go +++ b/proc_netstat_test.go @@ -1,3 +1,16 @@ +// Copyright 2022 The Prometheus Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package procfs import ( diff --git a/proc_snmp6.go b/proc_snmp6.go index 943899528..52c4891bf 100644 --- a/proc_snmp6.go +++ b/proc_snmp6.go @@ -160,7 +160,7 @@ func (p Proc) Snmp6() (ProcSnmp6, error) { // and returns a map contains those metrics. func parseSNMP6Stats(r io.Reader) (ProcSnmp6, error) { var ( - scanner = bufio.NewScanner(r) + scanner = bufio.NewScanner(r) procSnmp6 = ProcSnmp6{} ) diff --git a/proc_snmp6_test.go b/proc_snmp6_test.go index c3a55bff0..aed483eb2 100644 --- a/proc_snmp6_test.go +++ b/proc_snmp6_test.go @@ -1,3 +1,16 @@ +// Copyright 2022 The Prometheus Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + package procfs import "testing" diff --git a/softirqs.go b/softirqs.go new file mode 100644 index 000000000..d27c35fd6 --- /dev/null +++ b/softirqs.go @@ -0,0 +1,160 @@ +// Copyright 2022 The Prometheus Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package procfs + +import ( + "bufio" + "bytes" + "fmt" + "io" + "strconv" + "strings" + + "github.com/prometheus/procfs/internal/util" +) + +// Softirqs represents the softirq statistics. +type Softirqs struct { + Hi []uint64 + Timer []uint64 + NetTx []uint64 + NetRx []uint64 + Block []uint64 + IRQPoll []uint64 + Tasklet []uint64 + Sched []uint64 + HRTimer []uint64 + RCU []uint64 +} + +func (fs FS) Softirqs() (Softirqs, error) { + fileName := fs.proc.Path("softirqs") + data, err := util.ReadFileNoStat(fileName) + if err != nil { + return Softirqs{}, err + } + + reader := bytes.NewReader(data) + + return parseSoftirqs(reader) +} + +func parseSoftirqs(r io.Reader) (Softirqs, error) { + var ( + softirqs = Softirqs{} + scanner = bufio.NewScanner(r) + ) + + if !scanner.Scan() { + return Softirqs{}, fmt.Errorf("softirqs empty") + } + + for scanner.Scan() { + parts := strings.Fields(scanner.Text()) + var err error + + // require at least one cpu + if len(parts) < 2 { + continue + } + switch { + case parts[0] == "HI:": + perCpu := parts[1:] + softirqs.Hi = make([]uint64, len(perCpu)) + for i, count := range perCpu { + if softirqs.Hi[i], err = strconv.ParseUint(count, 10, 64); err != nil { + return Softirqs{}, fmt.Errorf("couldn't parse %q (HI%d): %w", count, i, err) + } + } + case parts[0] == "TIMER:": + perCpu := parts[1:] + softirqs.Timer = make([]uint64, len(perCpu)) + for i, count := range perCpu { + if softirqs.Timer[i], err = strconv.ParseUint(count, 10, 64); err != nil { + return Softirqs{}, fmt.Errorf("couldn't parse %q (TIMER%d): %w", count, i, err) + } + } + case parts[0] == "NET_TX:": + perCpu := parts[1:] + softirqs.NetTx = make([]uint64, len(perCpu)) + for i, count := range perCpu { + if softirqs.NetTx[i], err = strconv.ParseUint(count, 10, 64); err != nil { + return Softirqs{}, fmt.Errorf("couldn't parse %q (NET_TX%d): %w", count, i, err) + } + } + case parts[0] == "NET_RX:": + perCpu := parts[1:] + softirqs.NetRx = make([]uint64, len(perCpu)) + for i, count := range perCpu { + if softirqs.NetRx[i], err = strconv.ParseUint(count, 10, 64); err != nil { + return Softirqs{}, fmt.Errorf("couldn't parse %q (NET_RX%d): %w", count, i, err) + } + } + case parts[0] == "BLOCK:": + perCpu := parts[1:] + softirqs.Block = make([]uint64, len(perCpu)) + for i, count := range perCpu { + if softirqs.Block[i], err = strconv.ParseUint(count, 10, 64); err != nil { + return Softirqs{}, fmt.Errorf("couldn't parse %q (BLOCK%d): %w", count, i, err) + } + } + case parts[0] == "IRQ_POLL:": + perCpu := parts[1:] + softirqs.IRQPoll = make([]uint64, len(perCpu)) + for i, count := range perCpu { + if softirqs.IRQPoll[i], err = strconv.ParseUint(count, 10, 64); err != nil { + return Softirqs{}, fmt.Errorf("couldn't parse %q (IRQ_POLL%d): %w", count, i, err) + } + } + case parts[0] == "TASKLET:": + perCpu := parts[1:] + softirqs.Tasklet = make([]uint64, len(perCpu)) + for i, count := range perCpu { + if softirqs.Tasklet[i], err = strconv.ParseUint(count, 10, 64); err != nil { + return Softirqs{}, fmt.Errorf("couldn't parse %q (TASKLET%d): %w", count, i, err) + } + } + case parts[0] == "SCHED:": + perCpu := parts[1:] + softirqs.Sched = make([]uint64, len(perCpu)) + for i, count := range perCpu { + if softirqs.Sched[i], err = strconv.ParseUint(count, 10, 64); err != nil { + return Softirqs{}, fmt.Errorf("couldn't parse %q (SCHED%d): %w", count, i, err) + } + } + case parts[0] == "HRTIMER:": + perCpu := parts[1:] + softirqs.HRTimer = make([]uint64, len(perCpu)) + for i, count := range perCpu { + if softirqs.HRTimer[i], err = strconv.ParseUint(count, 10, 64); err != nil { + return Softirqs{}, fmt.Errorf("couldn't parse %q (HRTIMER%d): %w", count, i, err) + } + } + case parts[0] == "RCU:": + perCpu := parts[1:] + softirqs.RCU = make([]uint64, len(perCpu)) + for i, count := range perCpu { + if softirqs.RCU[i], err = strconv.ParseUint(count, 10, 64); err != nil { + return Softirqs{}, fmt.Errorf("couldn't parse %q (RCU%d): %w", count, i, err) + } + } + } + } + + if err := scanner.Err(); err != nil { + return Softirqs{}, fmt.Errorf("couldn't parse softirqs: %w", err) + } + + return softirqs, scanner.Err() +} diff --git a/softirqs_test.go b/softirqs_test.go new file mode 100644 index 000000000..bf32af297 --- /dev/null +++ b/softirqs_test.go @@ -0,0 +1,64 @@ +// Copyright 2022 The Prometheus Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package procfs + +import "testing" + +func TestSoftirqs(t *testing.T) { + s, err := getProcFixtures(t).Softirqs() + if err != nil { + t.Fatal(err) + } + + // hi + if want, have := uint64(3), s.Hi[0]; want != have { + t.Errorf("want softirq HI count %d, have %d", want, have) + } + // timer + if want, have := uint64(247490), s.Timer[1]; want != have { + t.Errorf("want softirq TIMER count %d, have %d", want, have) + } + // net_tx + if want, have := uint64(2419), s.NetTx[0]; want != have { + t.Errorf("want softirq NET_TX count %d, have %d", want, have) + } + // net_rx + if want, have := uint64(28694), s.NetRx[1]; want != have { + t.Errorf("want softirq NET_RX count %d, have %d", want, have) + } + // block + if want, have := uint64(262755), s.Block[1]; want != have { + t.Errorf("want softirq BLOCK count %d, have %d", want, have) + } + // irq_poll + if want, have := uint64(0), s.IRQPoll[0]; want != have { + t.Errorf("want softirq IRQ_POLL count %d, have %d", want, have) + } + // tasklet + if want, have := uint64(209), s.Tasklet[0]; want != have { + t.Errorf("want softirq TASKLET count %d, have %d", want, have) + } + // sched + if want, have := uint64(2278692), s.Sched[0]; want != have { + t.Errorf("want softirq SCHED count %d, have %d", want, have) + } + // hrtimer + if want, have := uint64(1281), s.HRTimer[0]; want != have { + t.Errorf("want softirq HRTIMER count %d, have %d", want, have) + } + // rcu + if want, have := uint64(532783), s.RCU[1]; want != have { + t.Errorf("want softirq RCU count %d, have %d", want, have) + } +} From cdc45126aef95c2e741f1d56ded3d24fdcd3d167 Mon Sep 17 00:00:00 2001 From: Ben Kochie Date: Fri, 15 Apr 2022 20:33:36 +0200 Subject: [PATCH 019/176] Fixup linting (#442) * Fix check license issues. * Ignore some revive naming issues. * Update minimum Go versions. * Update go fmt for newer Go versions * Update Go CI versions. * Repac fixtures. * Use cimg/go. Signed-off-by: SuperQ --- .circleci/config.yml | 12 ++++++------ cmdline_test.go | 1 + cpuinfo.go | 1 + cpuinfo_armx.go | 1 + cpuinfo_mipsx.go | 1 + cpuinfo_others.go | 4 ++-- cpuinfo_ppcx.go | 1 + cpuinfo_riscvx.go | 1 + cpuinfo_s390x.go | 1 + cpuinfo_test.go | 1 + cpuinfo_x86.go | 1 + go.mod | 8 ++++---- go.sum | 12 ++++++------ internal/util/sysreadfile.go | 1 + internal/util/sysreadfile_compat.go | 1 + kernel_random.go | 1 + kernel_random_test.go | 1 + proc_maps.go | 1 + proc_maps32_test.go | 1 + proc_maps64_test.go | 6 +++++- proc_netstat.go | 4 ++-- proc_smaps.go | 1 + proc_smaps_test.go | 1 + proc_snmp.go | 8 ++++---- proc_snmp6.go | 6 +++--- sysfs/class_cooling_device.go | 1 + sysfs/class_cooling_device_test.go | 1 + sysfs/class_dmi.go | 1 + sysfs/class_dmi_test.go | 1 + sysfs/class_drm.go | 1 + sysfs/class_drm_amdgpu.go | 1 + sysfs/class_drm_amdgpu_test.go | 1 + sysfs/class_fibrechannel.go | 1 + sysfs/class_fibrechannel_test.go | 1 + sysfs/class_infiniband.go | 1 + sysfs/class_infiniband_test.go | 1 + sysfs/class_nvme.go | 1 + sysfs/class_nvme_test.go | 1 + sysfs/class_power_supply.go | 1 + sysfs/class_power_supply_test.go | 1 + sysfs/class_powercap.go | 1 + sysfs/class_powercap_test.go | 1 + sysfs/class_scsitape.go | 1 + sysfs/class_scsitape_test.go | 1 + sysfs/class_thermal.go | 1 + sysfs/class_thermal_test.go | 1 + sysfs/clocksource.go | 1 + sysfs/clocksource_test.go | 1 + sysfs/doc.go | 1 + sysfs/fs.go | 1 + sysfs/fs_test.go | 1 + sysfs/net_class.go | 1 + sysfs/net_class_test.go | 1 + sysfs/system_cpu.go | 1 + sysfs/system_cpu_test.go | 1 + sysfs/vmstat_numa.go | 1 + sysfs/vmstat_numa_test.go | 1 + sysfs/vulnerability.go | 1 + vm.go | 1 + vm_test.go | 1 + zoneinfo.go | 1 + zoneinfo_test.go | 1 + 62 files changed, 86 insertions(+), 28 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index d563c54bd..b95e376f6 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -4,7 +4,7 @@ version: 2.1 jobs: lint: docker: - - image: cimg/go:1.16 + - image: cimg/go:1.18 steps: - checkout - run: make check_license @@ -23,7 +23,7 @@ jobs: type: boolean default: true docker: - - image: circleci/golang:<< parameters.go_version >> + - image: cimg/go:<< parameters.go_version >> environment: GOOS: "<< parameters.os >>" steps: @@ -54,10 +54,10 @@ workflows: matrix: parameters: go_version: - - "1.13" - - "1.14" - "1.15" - "1.16" + - "1.17" + - "1.18" - test: name: test-windows os: windows @@ -65,8 +65,8 @@ workflows: matrix: parameters: go_version: - - "1.13" - - "1.14" - "1.15" - "1.16" + - "1.17" + - "1.18" - codespell diff --git a/cmdline_test.go b/cmdline_test.go index f9cc1b829..4eb433f84 100644 --- a/cmdline_test.go +++ b/cmdline_test.go @@ -11,6 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build linux // +build linux package procfs diff --git a/cpuinfo.go b/cpuinfo.go index 0c09336d8..ff6b927da 100644 --- a/cpuinfo.go +++ b/cpuinfo.go @@ -11,6 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build linux // +build linux package procfs diff --git a/cpuinfo_armx.go b/cpuinfo_armx.go index 44b590ed3..64cfd534c 100644 --- a/cpuinfo_armx.go +++ b/cpuinfo_armx.go @@ -11,6 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build linux && (arm || arm64) // +build linux // +build arm arm64 diff --git a/cpuinfo_mipsx.go b/cpuinfo_mipsx.go index 91e272573..c11207f3a 100644 --- a/cpuinfo_mipsx.go +++ b/cpuinfo_mipsx.go @@ -11,6 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build linux && (mips || mipsle || mips64 || mips64le) // +build linux // +build mips mipsle mips64 mips64le diff --git a/cpuinfo_others.go b/cpuinfo_others.go index 95b5b4ec4..ea41bf2ca 100644 --- a/cpuinfo_others.go +++ b/cpuinfo_others.go @@ -11,8 +11,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -// +build linux -// +build !386,!amd64,!arm,!arm64,!mips,!mips64,!mips64le,!mipsle,!ppc64,!ppc64le,!riscv64,!s390x +//go:build linux && !386 && !amd64 && !arm && !arm64 && !mips && !mips64 && !mips64le && !mipsle && !ppc64 && !ppc64le && !riscv64 && !s390x +// +build linux,!386,!amd64,!arm,!arm64,!mips,!mips64,!mips64le,!mipsle,!ppc64,!ppc64le,!riscv64,!s390x package procfs diff --git a/cpuinfo_ppcx.go b/cpuinfo_ppcx.go index 6068bd571..003bc2ad4 100644 --- a/cpuinfo_ppcx.go +++ b/cpuinfo_ppcx.go @@ -11,6 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build linux && (ppc64 || ppc64le) // +build linux // +build ppc64 ppc64le diff --git a/cpuinfo_riscvx.go b/cpuinfo_riscvx.go index e83c2e207..1c9b7313b 100644 --- a/cpuinfo_riscvx.go +++ b/cpuinfo_riscvx.go @@ -11,6 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build linux && (riscv || riscv64) // +build linux // +build riscv riscv64 diff --git a/cpuinfo_s390x.go b/cpuinfo_s390x.go index 26814eeba..fa3686bc0 100644 --- a/cpuinfo_s390x.go +++ b/cpuinfo_s390x.go @@ -11,6 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build linux // +build linux package procfs diff --git a/cpuinfo_test.go b/cpuinfo_test.go index 9a00d693a..c339fea78 100644 --- a/cpuinfo_test.go +++ b/cpuinfo_test.go @@ -11,6 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build linux // +build linux package procfs diff --git a/cpuinfo_x86.go b/cpuinfo_x86.go index d5bedf97f..a0ef55562 100644 --- a/cpuinfo_x86.go +++ b/cpuinfo_x86.go @@ -11,6 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build linux && (386 || amd64) // +build linux // +build 386 amd64 diff --git a/go.mod b/go.mod index ba6681f52..bff0d0b9e 100644 --- a/go.mod +++ b/go.mod @@ -1,9 +1,9 @@ module github.com/prometheus/procfs -go 1.13 +go 1.15 require ( - github.com/google/go-cmp v0.5.4 - golang.org/x/sync v0.0.0-20201207232520-09787c993a3a - golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c + github.com/google/go-cmp v0.5.7 + golang.org/x/sync v0.0.0-20210220032951-036812b2e83c + golang.org/x/sys v0.0.0-20220412211240-33da011f77ad ) diff --git a/go.sum b/go.sum index 7ceaf56b7..e2fe30a16 100644 --- a/go.sum +++ b/go.sum @@ -1,8 +1,8 @@ -github.com/google/go-cmp v0.5.4 h1:L8R9j+yAqZuZjsqh/z+F1NCffTKKLShY6zXTItVIZ8M= -github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -golang.org/x/sync v0.0.0-20201207232520-09787c993a3a h1:DcqTD9SDLc+1P/r1EmRBwnVsrOwW+kk2vWf9n+1sGhs= -golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c h1:VwygUrnw9jn88c4u8GD3rZQbqrP/tgas88tPUbBxQrk= -golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +github.com/google/go-cmp v0.5.7 h1:81/ik6ipDQS2aGcBfIN5dHDB36BwrStyeAQquSYCV4o= +github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ= +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20220412211240-33da011f77ad h1:ntjMns5wyP/fN65tdBD4g8J5w8n015+iIIs9rtjXkY0= +golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/internal/util/sysreadfile.go b/internal/util/sysreadfile.go index c07de0b6c..38e76f920 100644 --- a/internal/util/sysreadfile.go +++ b/internal/util/sysreadfile.go @@ -11,6 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build linux && !appengine // +build linux,!appengine package util diff --git a/internal/util/sysreadfile_compat.go b/internal/util/sysreadfile_compat.go index bd55b4537..8702ab3b0 100644 --- a/internal/util/sysreadfile_compat.go +++ b/internal/util/sysreadfile_compat.go @@ -11,6 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build (linux && appengine) || !linux // +build linux,appengine !linux package util diff --git a/kernel_random.go b/kernel_random.go index da3a941d6..db88566bd 100644 --- a/kernel_random.go +++ b/kernel_random.go @@ -11,6 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build !windows // +build !windows package procfs diff --git a/kernel_random_test.go b/kernel_random_test.go index da9b93cc6..fcd85c82d 100644 --- a/kernel_random_test.go +++ b/kernel_random_test.go @@ -11,6 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build !windows // +build !windows package procfs diff --git a/proc_maps.go b/proc_maps.go index ddc13b391..f1bcbf32b 100644 --- a/proc_maps.go +++ b/proc_maps.go @@ -11,6 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build (aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris) && !js // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris // +build !js diff --git a/proc_maps32_test.go b/proc_maps32_test.go index 87be9726a..77444c4c5 100644 --- a/proc_maps32_test.go +++ b/proc_maps32_test.go @@ -11,6 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build (aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris) && (386 || arm || mips || mipsle) // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris // +build 386 arm mips mipsle diff --git a/proc_maps64_test.go b/proc_maps64_test.go index 11234a4fe..66ef1349d 100644 --- a/proc_maps64_test.go +++ b/proc_maps64_test.go @@ -11,8 +11,12 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build (aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris) && !386 && !arm && !mips && !mipsle // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris -// +build !386,!arm,!mips,!mipsle +// +build !386 +// +build !arm +// +build !mips +// +build !mipsle package procfs diff --git a/proc_netstat.go b/proc_netstat.go index da40ea105..48b523819 100644 --- a/proc_netstat.go +++ b/proc_netstat.go @@ -32,7 +32,7 @@ type ProcNetstat struct { IpExt } -type TcpExt struct { +type TcpExt struct { // nolint:revive SyncookiesSent float64 SyncookiesRecv float64 SyncookiesFailed float64 @@ -147,7 +147,7 @@ type TcpExt struct { TCPWqueueTooBig float64 } -type IpExt struct { +type IpExt struct { // nolint:revive InNoRoutes float64 InTruncatedPkts float64 InMcastPkts float64 diff --git a/proc_smaps.go b/proc_smaps.go index 664b9f184..0e97d9957 100644 --- a/proc_smaps.go +++ b/proc_smaps.go @@ -11,6 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build !windows // +build !windows package procfs diff --git a/proc_smaps_test.go b/proc_smaps_test.go index bedb1cf82..b11b98fe7 100644 --- a/proc_smaps_test.go +++ b/proc_smaps_test.go @@ -11,6 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build !windows // +build !windows package procfs diff --git a/proc_snmp.go b/proc_snmp.go index 85438cd43..ae191896c 100644 --- a/proc_snmp.go +++ b/proc_snmp.go @@ -36,7 +36,7 @@ type ProcSnmp struct { UdpLite } -type Ip struct { +type Ip struct { // nolint:revive Forwarding float64 DefaultTTL float64 InReceives float64 @@ -93,7 +93,7 @@ type IcmpMsg struct { OutType3 float64 } -type Tcp struct { +type Tcp struct { // nolint:revive RtoAlgorithm float64 RtoMin float64 RtoMax float64 @@ -111,7 +111,7 @@ type Tcp struct { InCsumErrors float64 } -type Udp struct { +type Udp struct { // nolint:revive InDatagrams float64 NoPorts float64 InErrors float64 @@ -122,7 +122,7 @@ type Udp struct { IgnoredMulti float64 } -type UdpLite struct { +type UdpLite struct { // nolint:revive InDatagrams float64 NoPorts float64 InErrors float64 diff --git a/proc_snmp6.go b/proc_snmp6.go index 52c4891bf..f611992d5 100644 --- a/proc_snmp6.go +++ b/proc_snmp6.go @@ -35,7 +35,7 @@ type ProcSnmp6 struct { UdpLite6 } -type Ip6 struct { +type Ip6 struct { // nolint:revive InReceives float64 InHdrErrors float64 InTooBigErrors float64 @@ -117,7 +117,7 @@ type Icmp6 struct { OutType143 float64 } -type Udp6 struct { +type Udp6 struct { // nolint:revive InDatagrams float64 NoPorts float64 InErrors float64 @@ -128,7 +128,7 @@ type Udp6 struct { IgnoredMulti float64 } -type UdpLite6 struct { +type UdpLite6 struct { // nolint:revive InDatagrams float64 NoPorts float64 InErrors float64 diff --git a/sysfs/class_cooling_device.go b/sysfs/class_cooling_device.go index a67067f84..4bf1d273e 100644 --- a/sysfs/class_cooling_device.go +++ b/sysfs/class_cooling_device.go @@ -11,6 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build linux // +build linux package sysfs diff --git a/sysfs/class_cooling_device_test.go b/sysfs/class_cooling_device_test.go index 7555d38b6..0c7c497c1 100644 --- a/sysfs/class_cooling_device_test.go +++ b/sysfs/class_cooling_device_test.go @@ -11,6 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build linux // +build linux package sysfs diff --git a/sysfs/class_dmi.go b/sysfs/class_dmi.go index 13878536f..e556c7462 100644 --- a/sysfs/class_dmi.go +++ b/sysfs/class_dmi.go @@ -11,6 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build linux // +build linux package sysfs diff --git a/sysfs/class_dmi_test.go b/sysfs/class_dmi_test.go index 9e3d1187b..a149ef417 100644 --- a/sysfs/class_dmi_test.go +++ b/sysfs/class_dmi_test.go @@ -11,6 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build linux // +build linux package sysfs diff --git a/sysfs/class_drm.go b/sysfs/class_drm.go index 1febea25b..b221e688b 100644 --- a/sysfs/class_drm.go +++ b/sysfs/class_drm.go @@ -11,6 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build linux // +build linux package sysfs diff --git a/sysfs/class_drm_amdgpu.go b/sysfs/class_drm_amdgpu.go index 308d1d134..51b50d0f7 100644 --- a/sysfs/class_drm_amdgpu.go +++ b/sysfs/class_drm_amdgpu.go @@ -11,6 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build linux // +build linux package sysfs diff --git a/sysfs/class_drm_amdgpu_test.go b/sysfs/class_drm_amdgpu_test.go index 902764e35..c219ccd29 100644 --- a/sysfs/class_drm_amdgpu_test.go +++ b/sysfs/class_drm_amdgpu_test.go @@ -11,6 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build linux // +build linux package sysfs diff --git a/sysfs/class_fibrechannel.go b/sysfs/class_fibrechannel.go index a0c49eb8d..5d898168f 100644 --- a/sysfs/class_fibrechannel.go +++ b/sysfs/class_fibrechannel.go @@ -11,6 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build linux // +build linux package sysfs diff --git a/sysfs/class_fibrechannel_test.go b/sysfs/class_fibrechannel_test.go index 569371845..7181795c9 100644 --- a/sysfs/class_fibrechannel_test.go +++ b/sysfs/class_fibrechannel_test.go @@ -11,6 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build linux // +build linux package sysfs diff --git a/sysfs/class_infiniband.go b/sysfs/class_infiniband.go index 7b7a86ffa..17b986262 100644 --- a/sysfs/class_infiniband.go +++ b/sysfs/class_infiniband.go @@ -11,6 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build linux // +build linux package sysfs diff --git a/sysfs/class_infiniband_test.go b/sysfs/class_infiniband_test.go index 79f4b1fb5..acb6263be 100644 --- a/sysfs/class_infiniband_test.go +++ b/sysfs/class_infiniband_test.go @@ -11,6 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build linux // +build linux package sysfs diff --git a/sysfs/class_nvme.go b/sysfs/class_nvme.go index 2e4fa3481..5daf15005 100644 --- a/sysfs/class_nvme.go +++ b/sysfs/class_nvme.go @@ -11,6 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build linux // +build linux package sysfs diff --git a/sysfs/class_nvme_test.go b/sysfs/class_nvme_test.go index 884144736..3867be8da 100644 --- a/sysfs/class_nvme_test.go +++ b/sysfs/class_nvme_test.go @@ -11,6 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build linux // +build linux package sysfs diff --git a/sysfs/class_power_supply.go b/sysfs/class_power_supply.go index 4ca816592..2199de498 100644 --- a/sysfs/class_power_supply.go +++ b/sysfs/class_power_supply.go @@ -11,6 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build linux // +build linux package sysfs diff --git a/sysfs/class_power_supply_test.go b/sysfs/class_power_supply_test.go index a83e595f4..52641497c 100644 --- a/sysfs/class_power_supply_test.go +++ b/sysfs/class_power_supply_test.go @@ -11,6 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build linux // +build linux package sysfs diff --git a/sysfs/class_powercap.go b/sysfs/class_powercap.go index f0321909f..d1434a2eb 100644 --- a/sysfs/class_powercap.go +++ b/sysfs/class_powercap.go @@ -11,6 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build linux // +build linux package sysfs diff --git a/sysfs/class_powercap_test.go b/sysfs/class_powercap_test.go index c78d1c5ef..4122a9dcf 100644 --- a/sysfs/class_powercap_test.go +++ b/sysfs/class_powercap_test.go @@ -11,6 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build linux // +build linux package sysfs diff --git a/sysfs/class_scsitape.go b/sysfs/class_scsitape.go index 371b4ae97..b2d4ba584 100644 --- a/sysfs/class_scsitape.go +++ b/sysfs/class_scsitape.go @@ -11,6 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build linux // +build linux package sysfs diff --git a/sysfs/class_scsitape_test.go b/sysfs/class_scsitape_test.go index 17480d441..1ab81b135 100644 --- a/sysfs/class_scsitape_test.go +++ b/sysfs/class_scsitape_test.go @@ -11,6 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build linux // +build linux package sysfs diff --git a/sysfs/class_thermal.go b/sysfs/class_thermal.go index 6b4823e9b..0935a21ca 100644 --- a/sysfs/class_thermal.go +++ b/sysfs/class_thermal.go @@ -11,6 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build linux // +build linux package sysfs diff --git a/sysfs/class_thermal_test.go b/sysfs/class_thermal_test.go index 0bce736f1..7d54fb11d 100644 --- a/sysfs/class_thermal_test.go +++ b/sysfs/class_thermal_test.go @@ -11,6 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build linux // +build linux package sysfs diff --git a/sysfs/clocksource.go b/sysfs/clocksource.go index ac507396d..bb3a84211 100644 --- a/sysfs/clocksource.go +++ b/sysfs/clocksource.go @@ -11,6 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build linux // +build linux package sysfs diff --git a/sysfs/clocksource_test.go b/sysfs/clocksource_test.go index 7c38d4b5f..d2ebc90b2 100644 --- a/sysfs/clocksource_test.go +++ b/sysfs/clocksource_test.go @@ -11,6 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build linux // +build linux package sysfs diff --git a/sysfs/doc.go b/sysfs/doc.go index cb251c81e..dc963446b 100644 --- a/sysfs/doc.go +++ b/sysfs/doc.go @@ -11,6 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build linux // +build linux // Package sysfs provides functions to retrieve system and kernel metrics diff --git a/sysfs/fs.go b/sysfs/fs.go index c11e9a68c..b8ee21d71 100644 --- a/sysfs/fs.go +++ b/sysfs/fs.go @@ -11,6 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build linux // +build linux package sysfs diff --git a/sysfs/fs_test.go b/sysfs/fs_test.go index 7745fbe77..37ffe7d20 100644 --- a/sysfs/fs_test.go +++ b/sysfs/fs_test.go @@ -11,6 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build linux // +build linux package sysfs diff --git a/sysfs/net_class.go b/sysfs/net_class.go index 6dff98e69..940b4e451 100644 --- a/sysfs/net_class.go +++ b/sysfs/net_class.go @@ -11,6 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build linux // +build linux package sysfs diff --git a/sysfs/net_class_test.go b/sysfs/net_class_test.go index f85660756..4784fe413 100644 --- a/sysfs/net_class_test.go +++ b/sysfs/net_class_test.go @@ -11,6 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build linux // +build linux package sysfs diff --git a/sysfs/system_cpu.go b/sysfs/system_cpu.go index 7c46c2eaf..ed975ba72 100644 --- a/sysfs/system_cpu.go +++ b/sysfs/system_cpu.go @@ -11,6 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build linux // +build linux package sysfs diff --git a/sysfs/system_cpu_test.go b/sysfs/system_cpu_test.go index 0ae9f0fd9..afce58d1c 100644 --- a/sysfs/system_cpu_test.go +++ b/sysfs/system_cpu_test.go @@ -11,6 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build linux // +build linux package sysfs diff --git a/sysfs/vmstat_numa.go b/sysfs/vmstat_numa.go index f33ef084a..8a6d09595 100644 --- a/sysfs/vmstat_numa.go +++ b/sysfs/vmstat_numa.go @@ -11,6 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build linux // +build linux package sysfs diff --git a/sysfs/vmstat_numa_test.go b/sysfs/vmstat_numa_test.go index 81c0a1801..9b48987ed 100644 --- a/sysfs/vmstat_numa_test.go +++ b/sysfs/vmstat_numa_test.go @@ -11,6 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build linux // +build linux package sysfs diff --git a/sysfs/vulnerability.go b/sysfs/vulnerability.go index 477135fa1..721948faf 100644 --- a/sysfs/vulnerability.go +++ b/sysfs/vulnerability.go @@ -11,6 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build linux // +build linux package sysfs diff --git a/vm.go b/vm.go index f53f98ed6..a03768a6f 100644 --- a/vm.go +++ b/vm.go @@ -11,6 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build !windows // +build !windows package procfs diff --git a/vm_test.go b/vm_test.go index 988f9a161..4bf405247 100644 --- a/vm_test.go +++ b/vm_test.go @@ -11,6 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build !windows // +build !windows package procfs diff --git a/zoneinfo.go b/zoneinfo.go index 209e2ac98..33ddf6838 100644 --- a/zoneinfo.go +++ b/zoneinfo.go @@ -11,6 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build !windows // +build !windows package procfs diff --git a/zoneinfo_test.go b/zoneinfo_test.go index f64398033..da5574449 100644 --- a/zoneinfo_test.go +++ b/zoneinfo_test.go @@ -11,6 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +//go:build !windows // +build !windows package procfs From 7e8ef21ecd83ac8aa7f09c4fe566bf1720f8dfc6 Mon Sep 17 00:00:00 2001 From: prombot Date: Sat, 16 Apr 2022 19:50:30 +0000 Subject: [PATCH 020/176] Update common Prometheus files Signed-off-by: prombot --- .github/workflows/golangci-lint.yml | 18 +++++++----------- Makefile.common | 4 ++-- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index f96c76a65..662ea3b6e 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -9,13 +9,6 @@ on: - ".github/workflows/golangci-lint.yml" - ".golangci.yml" pull_request: - paths: - - "go.sum" - - "go.mod" - - "**.go" - - "scripts/errcheck_excludes.txt" - - ".github/workflows/golangci-lint.yml" - - ".golangci.yml" jobs: golangci: @@ -23,9 +16,12 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout repository - uses: actions/checkout@v2 - + uses: actions/checkout@v3 + - name: install Go + uses: actions/setup-go@v2 + with: + go-version: 1.18.x - name: Lint - uses: golangci/golangci-lint-action@v2 + uses: golangci/golangci-lint-action@v3.1.0 with: - version: v1.42.0 + version: v1.45.2 diff --git a/Makefile.common b/Makefile.common index ed7d1826e..c263b733f 100644 --- a/Makefile.common +++ b/Makefile.common @@ -78,12 +78,12 @@ ifneq ($(shell which gotestsum),) endif endif -PROMU_VERSION ?= 0.12.0 +PROMU_VERSION ?= 0.13.0 PROMU_URL := https://github.com/prometheus/promu/releases/download/v$(PROMU_VERSION)/promu-$(PROMU_VERSION).$(GO_BUILD_PLATFORM).tar.gz GOLANGCI_LINT := GOLANGCI_LINT_OPTS ?= -GOLANGCI_LINT_VERSION ?= v1.42.0 +GOLANGCI_LINT_VERSION ?= v1.45.2 # golangci-lint only supports linux, darwin and windows platforms on i386/amd64. # windows isn't included here because of the path separator being different. ifeq ($(GOHOSTOS),$(filter $(GOHOSTOS),linux darwin)) From 107ccd5da4dc99c2d20182e7670a0db8b9b9c542 Mon Sep 17 00:00:00 2001 From: SuperQ Date: Sun, 17 Apr 2022 10:14:09 +0200 Subject: [PATCH 021/176] Fixup var-naming lint warnings. Signed-off-by: SuperQ --- softirqs.go | 60 ++++++++++++++++++++++++++--------------------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/softirqs.go b/softirqs.go index d27c35fd6..559129cbc 100644 --- a/softirqs.go +++ b/softirqs.go @@ -70,81 +70,81 @@ func parseSoftirqs(r io.Reader) (Softirqs, error) { } switch { case parts[0] == "HI:": - perCpu := parts[1:] - softirqs.Hi = make([]uint64, len(perCpu)) - for i, count := range perCpu { + perCPU := parts[1:] + softirqs.Hi = make([]uint64, len(perCPU)) + for i, count := range perCPU { if softirqs.Hi[i], err = strconv.ParseUint(count, 10, 64); err != nil { return Softirqs{}, fmt.Errorf("couldn't parse %q (HI%d): %w", count, i, err) } } case parts[0] == "TIMER:": - perCpu := parts[1:] - softirqs.Timer = make([]uint64, len(perCpu)) - for i, count := range perCpu { + perCPU := parts[1:] + softirqs.Timer = make([]uint64, len(perCPU)) + for i, count := range perCPU { if softirqs.Timer[i], err = strconv.ParseUint(count, 10, 64); err != nil { return Softirqs{}, fmt.Errorf("couldn't parse %q (TIMER%d): %w", count, i, err) } } case parts[0] == "NET_TX:": - perCpu := parts[1:] - softirqs.NetTx = make([]uint64, len(perCpu)) - for i, count := range perCpu { + perCPU := parts[1:] + softirqs.NetTx = make([]uint64, len(perCPU)) + for i, count := range perCPU { if softirqs.NetTx[i], err = strconv.ParseUint(count, 10, 64); err != nil { return Softirqs{}, fmt.Errorf("couldn't parse %q (NET_TX%d): %w", count, i, err) } } case parts[0] == "NET_RX:": - perCpu := parts[1:] - softirqs.NetRx = make([]uint64, len(perCpu)) - for i, count := range perCpu { + perCPU := parts[1:] + softirqs.NetRx = make([]uint64, len(perCPU)) + for i, count := range perCPU { if softirqs.NetRx[i], err = strconv.ParseUint(count, 10, 64); err != nil { return Softirqs{}, fmt.Errorf("couldn't parse %q (NET_RX%d): %w", count, i, err) } } case parts[0] == "BLOCK:": - perCpu := parts[1:] - softirqs.Block = make([]uint64, len(perCpu)) - for i, count := range perCpu { + perCPU := parts[1:] + softirqs.Block = make([]uint64, len(perCPU)) + for i, count := range perCPU { if softirqs.Block[i], err = strconv.ParseUint(count, 10, 64); err != nil { return Softirqs{}, fmt.Errorf("couldn't parse %q (BLOCK%d): %w", count, i, err) } } case parts[0] == "IRQ_POLL:": - perCpu := parts[1:] - softirqs.IRQPoll = make([]uint64, len(perCpu)) - for i, count := range perCpu { + perCPU := parts[1:] + softirqs.IRQPoll = make([]uint64, len(perCPU)) + for i, count := range perCPU { if softirqs.IRQPoll[i], err = strconv.ParseUint(count, 10, 64); err != nil { return Softirqs{}, fmt.Errorf("couldn't parse %q (IRQ_POLL%d): %w", count, i, err) } } case parts[0] == "TASKLET:": - perCpu := parts[1:] - softirqs.Tasklet = make([]uint64, len(perCpu)) - for i, count := range perCpu { + perCPU := parts[1:] + softirqs.Tasklet = make([]uint64, len(perCPU)) + for i, count := range perCPU { if softirqs.Tasklet[i], err = strconv.ParseUint(count, 10, 64); err != nil { return Softirqs{}, fmt.Errorf("couldn't parse %q (TASKLET%d): %w", count, i, err) } } case parts[0] == "SCHED:": - perCpu := parts[1:] - softirqs.Sched = make([]uint64, len(perCpu)) - for i, count := range perCpu { + perCPU := parts[1:] + softirqs.Sched = make([]uint64, len(perCPU)) + for i, count := range perCPU { if softirqs.Sched[i], err = strconv.ParseUint(count, 10, 64); err != nil { return Softirqs{}, fmt.Errorf("couldn't parse %q (SCHED%d): %w", count, i, err) } } case parts[0] == "HRTIMER:": - perCpu := parts[1:] - softirqs.HRTimer = make([]uint64, len(perCpu)) - for i, count := range perCpu { + perCPU := parts[1:] + softirqs.HRTimer = make([]uint64, len(perCPU)) + for i, count := range perCPU { if softirqs.HRTimer[i], err = strconv.ParseUint(count, 10, 64); err != nil { return Softirqs{}, fmt.Errorf("couldn't parse %q (HRTIMER%d): %w", count, i, err) } } case parts[0] == "RCU:": - perCpu := parts[1:] - softirqs.RCU = make([]uint64, len(perCpu)) - for i, count := range perCpu { + perCPU := parts[1:] + softirqs.RCU = make([]uint64, len(perCPU)) + for i, count := range perCPU { if softirqs.RCU[i], err = strconv.ParseUint(count, 10, 64); err != nil { return Softirqs{}, fmt.Errorf("couldn't parse %q (RCU%d): %w", count, i, err) } From e8d949b5433e067774a0d4a6b9b3e7749d5543dd Mon Sep 17 00:00:00 2001 From: Josh Niec Date: Mon, 25 Apr 2022 16:20:21 -0400 Subject: [PATCH 022/176] bcache: Ignore missing files Ignore missing files in bcache metrics. * cache_readahead was removed in Kernel Version 5.13: https://lkml.org/lkml/2021/5/31/1602 Fixes: https://github.com/prometheus/procfs/issues/445 Signed-off-by: Josh Niec --- bcache/get.go | 6 +++++- fixtures.ttar | 60 --------------------------------------------------- 2 files changed, 5 insertions(+), 61 deletions(-) diff --git a/bcache/get.go b/bcache/get.go index 26638e9ee..41ac1899c 100644 --- a/bcache/get.go +++ b/bcache/get.go @@ -197,6 +197,8 @@ func (p *parser) setSubDir(pathElements ...string) { p.currentDir = path.Join(p.uuidPath, p.subDir) } +// readValues reads a number of numerical values into an uint64 slice. +// Non-existing files are ignored. func (p *parser) readValue(fileName string) uint64 { if p.err != nil { return 0 @@ -204,7 +206,9 @@ func (p *parser) readValue(fileName string) uint64 { path := path.Join(p.currentDir, fileName) byt, err := ioutil.ReadFile(path) if err != nil { - p.err = fmt.Errorf("failed to read: %s", path) + if !os.IsNotExist(err) { + p.err = fmt.Errorf("failed to read: %s", path) + } return 0 } // Remove trailing newline. diff --git a/fixtures.ttar b/fixtures.ttar index 1eedeefaf..a24c42866 100644 --- a/fixtures.ttar +++ b/fixtures.ttar @@ -6070,11 +6070,6 @@ Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/bcache/stats_day/cache_readaheads -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: fixtures/sys/devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/bcache/stats_five_minute Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -6113,11 +6108,6 @@ Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/bcache/stats_five_minute/cache_readaheads -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: fixtures/sys/devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/bcache/stats_hour Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -6156,11 +6146,6 @@ Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/bcache/stats_hour/cache_readaheads -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: fixtures/sys/devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/bcache/stats_total Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -6199,11 +6184,6 @@ Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/devices/pci0000:00/0000:00:0d.0/ata4/host3/target3:0:0/3:0:0:0/block/sdb/bcache/stats_total/cache_readaheads -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: fixtures/sys/devices/pci0000:00/0000:00:0d.0/ata5 Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -6756,11 +6736,6 @@ Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/bdev0/stats_day/cache_readaheads -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/bdev0/stats_five_minute Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -6799,11 +6774,6 @@ Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/bdev0/stats_five_minute/cache_readaheads -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/bdev0/stats_hour Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -6842,11 +6812,6 @@ Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/bdev0/stats_hour/cache_readaheads -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/bdev0/stats_total Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -6885,11 +6850,6 @@ Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/bdev0/stats_total/cache_readaheads -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/bdev0/writeback_rate_debug Lines: 7 rate: 1.1M/sec @@ -7009,11 +6969,6 @@ Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/stats_day/cache_readaheads -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/stats_five_minute Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -7052,11 +7007,6 @@ Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/stats_five_minute/cache_readaheads -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/stats_hour Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -7095,11 +7045,6 @@ Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/stats_hour/cache_readaheads -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/stats_total Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -7138,11 +7083,6 @@ Lines: 1 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Path: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/stats_total/cache_readaheads -Lines: 1 -0 -Mode: 644 -# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: fixtures/sys/fs/bcache/deaddd54-c735-46d5-868e-f331c5fd7c74/tree_depth Lines: 1 0 From b9b5ad9b6d5a3ba720f13d9e0ff0ff9eb8ad3a3d Mon Sep 17 00:00:00 2001 From: Artur Makutunowicz Date: Mon, 2 May 2022 12:43:41 -0700 Subject: [PATCH 023/176] Prevent panic if status line is empty in mdstat (#441) This change fixes a potential source of panic when the status line in mdstat is empty and the code is trying to reference first item in a zero-sized slice. Signed-off-by: Artur Makutunowicz --- mdstat.go | 6 +++++- mdstat_test.go | 17 ++++++++++++----- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/mdstat.go b/mdstat.go index f0b9e5f75..2c7900f35 100644 --- a/mdstat.go +++ b/mdstat.go @@ -166,8 +166,12 @@ func parseMDStat(mdStatData []byte) ([]MDStat, error) { } func evalStatusLine(deviceLine, statusLine string) (active, total, down, size int64, err error) { + statusFields := strings.Fields(statusLine) + if len(statusFields) < 1 { + return 0, 0, 0, 0, fmt.Errorf("unexpected statusLine %q", statusLine) + } - sizeStr := strings.Fields(statusLine)[0] + sizeStr := statusFields[0] size, err = strconv.ParseInt(sizeStr, 10, 64) if err != nil { return 0, 0, 0, 0, fmt.Errorf("unexpected statusLine %q: %w", statusLine, err) diff --git a/mdstat_test.go b/mdstat_test.go index d572cb346..871e95ae3 100644 --- a/mdstat_test.go +++ b/mdstat_test.go @@ -56,16 +56,23 @@ func TestFS_MDStat(t *testing.T) { } func TestInvalidMdstat(t *testing.T) { - invalidMount := []byte(` + invalidMount := [][]byte{[]byte(` Personalities : [invalid] md3 : invalid 314159265 blocks 64k chunks unused devices: -`) +`), + []byte(` +md12 : active raid0 sdc2[0] sdd2[1] - _, err := parseMDStat(invalidMount) - if err == nil { - t.Fatalf("parsing of invalid reference file did not find any errors") + 3886394368 blocks super 1.2 512k chunks +`)} + + for _, invalid := range invalidMount { + _, err := parseMDStat(invalid) + if err == nil { + t.Fatalf("parsing of invalid reference file did not find any errors") + } } } From 7452dd6b3e85d78385406d00600b7c78b0908f86 Mon Sep 17 00:00:00 2001 From: prombot Date: Wed, 4 May 2022 19:50:41 +0000 Subject: [PATCH 024/176] Update common Prometheus files Signed-off-by: prombot --- CODE_OF_CONDUCT.md | 4 ++-- SECURITY.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 9a1aff412..d325872bd 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -1,3 +1,3 @@ -## Prometheus Community Code of Conduct +# Prometheus Community Code of Conduct -Prometheus follows the [CNCF Code of Conduct](https://github.com/cncf/foundation/blob/master/code-of-conduct.md). +Prometheus follows the [CNCF Code of Conduct](https://github.com/cncf/foundation/blob/main/code-of-conduct.md). diff --git a/SECURITY.md b/SECURITY.md index 67741f015..fed02d85c 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -3,4 +3,4 @@ The Prometheus security policy, including how to report vulnerabilities, can be found here: -https://prometheus.io/docs/operating/security/ + From 2000e8f169197cbe9b3b96da494bec806c5b9c17 Mon Sep 17 00:00:00 2001 From: prombot Date: Fri, 6 May 2022 11:02:30 +0000 Subject: [PATCH 025/176] Update common Prometheus files Signed-off-by: prombot --- .github/workflows/golangci-lint.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index 662ea3b6e..136d7d4b9 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -21,6 +21,9 @@ jobs: uses: actions/setup-go@v2 with: go-version: 1.18.x + - name: Install snmp_exporter/generator dependencies + run: sudo apt-get update && sudo apt-get -y install libsnmp-dev + if: github.repository == 'prometheus/snmp_exporter' - name: Lint uses: golangci/golangci-lint-action@v3.1.0 with: From 80eb60987c0113dc97f135b97ab8fe29d9c16c3d Mon Sep 17 00:00:00 2001 From: Dave Protasowski Date: Tue, 7 Jun 2022 09:42:46 -0400 Subject: [PATCH 026/176] Move fixtures to testdata folder (#447) This prevents the test fixtures from being shipped around in the module cache. ie. Prior if project A has a dependency on this project then running `go mod vendor` will pull the fixtures.ttar into the vendor folder Signed-off-by: dprotaso --- .gitignore | 3 ++- Makefile | 10 +++++----- bcache/get_test.go | 2 +- bcache/testdata/fixtures | 1 + blockdevice/stats_test.go | 10 +++++----- blockdevice/testdata/fixtures | 1 + btrfs/get_test.go | 2 +- btrfs/testdata/fixtures | 1 + fs_test.go | 2 +- internal/fs/fs_test.go | 2 +- internal/fs/testdata/fixtures | 1 + iscsi/get_test.go | 26 ++++++++++++------------- iscsi/testdata/fixtures | 1 + kernel_random_test.go | 2 +- net_tcp_test.go | 12 ++++++------ net_udp_test.go | 12 ++++++------ sysfs/fs_test.go | 2 +- sysfs/testdata/fixtures | 1 + fixtures.ttar => testdata/fixtures.ttar | 2 +- xfs/parse_test.go | 2 +- xfs/testdata/fixtures | 1 + xfs/xfs_test.go | 4 ++-- 22 files changed, 54 insertions(+), 46 deletions(-) create mode 120000 bcache/testdata/fixtures create mode 120000 blockdevice/testdata/fixtures create mode 120000 btrfs/testdata/fixtures create mode 120000 internal/fs/testdata/fixtures create mode 120000 iscsi/testdata/fixtures create mode 120000 sysfs/testdata/fixtures rename fixtures.ttar => testdata/fixtures.ttar (99%) create mode 120000 xfs/testdata/fixtures diff --git a/.gitignore b/.gitignore index 25e3659ab..7cc33ae4a 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -/fixtures/ +/testdata/fixtures/ +/fixtures diff --git a/Makefile b/Makefile index fa2bd5b52..7edfe4d09 100644 --- a/Makefile +++ b/Makefile @@ -14,18 +14,18 @@ include Makefile.common %/.unpacked: %.ttar - @echo ">> extracting fixtures" + @echo ">> extracting fixtures $*" ./ttar -C $(dir $*) -x -f $*.ttar touch $@ -fixtures: fixtures/.unpacked +fixtures: testdata/fixtures/.unpacked update_fixtures: - rm -vf fixtures/.unpacked - ./ttar -c -f fixtures.ttar fixtures/ + rm -vf testdata/fixtures/.unpacked + ./ttar -c -f testdata/fixtures.ttar -C testdata/ fixtures/ .PHONY: build build: .PHONY: test -test: fixtures/.unpacked common-test +test: testdata/fixtures/.unpacked common-test diff --git a/bcache/get_test.go b/bcache/get_test.go index 22f562e99..aa0b3d9bf 100644 --- a/bcache/get_test.go +++ b/bcache/get_test.go @@ -19,7 +19,7 @@ import ( ) func TestFSBcacheStats(t *testing.T) { - bcache, err := NewFS("../fixtures/sys") + bcache, err := NewFS("testdata/fixtures/sys") if err != nil { t.Fatalf("failed to access bcache fs: %v", err) } diff --git a/bcache/testdata/fixtures b/bcache/testdata/fixtures new file mode 120000 index 000000000..5fdc97bed --- /dev/null +++ b/bcache/testdata/fixtures @@ -0,0 +1 @@ +../../testdata/fixtures \ No newline at end of file diff --git a/blockdevice/stats_test.go b/blockdevice/stats_test.go index a701bcd2a..7343a0f24 100644 --- a/blockdevice/stats_test.go +++ b/blockdevice/stats_test.go @@ -21,8 +21,8 @@ import ( const ( failMsgFormat = "%v, expected %v, actual %v" - procfsFixtures = "../fixtures/proc" - sysfsFixtures = "../fixtures/sys" + procfsFixtures = "testdata/fixtures/proc" + sysfsFixtures = "testdata/fixtures/sys" ) func TestDiskstats(t *testing.T) { @@ -65,7 +65,7 @@ func TestDiskstats(t *testing.T) { } func TestBlockDevice(t *testing.T) { - blockdevice, err := NewFS("../fixtures/proc", "../fixtures/sys") + blockdevice, err := NewFS("testdata/fixtures/proc", "testdata/fixtures/sys") if err != nil { t.Fatalf("failed to access blockdevice fs: %v", err) } @@ -155,7 +155,7 @@ func TestBlockDevice(t *testing.T) { } func TestBlockDmInfo(t *testing.T) { - blockdevice, err := NewFS("../fixtures/proc", "../fixtures/sys") + blockdevice, err := NewFS("testdata/fixtures/proc", "testdata/fixtures/sys") if err != nil { t.Fatalf("failed to access blockdevice fs: %v", err) } @@ -199,7 +199,7 @@ func TestBlockDmInfo(t *testing.T) { } func TestSysBlockDeviceUnderlyingDevices(t *testing.T) { - blockdevice, err := NewFS("../fixtures/proc", "../fixtures/sys") + blockdevice, err := NewFS("testdata/fixtures/proc", "testdata/fixtures/sys") if err != nil { t.Fatalf("failed to access blockdevice fs: %v", err) } diff --git a/blockdevice/testdata/fixtures b/blockdevice/testdata/fixtures new file mode 120000 index 000000000..5fdc97bed --- /dev/null +++ b/blockdevice/testdata/fixtures @@ -0,0 +1 @@ +../../testdata/fixtures \ No newline at end of file diff --git a/btrfs/get_test.go b/btrfs/get_test.go index 224123f4e..23059c628 100644 --- a/btrfs/get_test.go +++ b/btrfs/get_test.go @@ -28,7 +28,7 @@ type alloc struct { } func TestFSBtrfsStats(t *testing.T) { - btrfs, err := NewFS("../fixtures/sys") + btrfs, err := NewFS("testdata/fixtures/sys") if err != nil { t.Fatalf("failed to access Btrfs filesystem: %v", err) } diff --git a/btrfs/testdata/fixtures b/btrfs/testdata/fixtures new file mode 120000 index 000000000..5fdc97bed --- /dev/null +++ b/btrfs/testdata/fixtures @@ -0,0 +1 @@ +../../testdata/fixtures \ No newline at end of file diff --git a/fs_test.go b/fs_test.go index 1764bd431..2d8af3275 100644 --- a/fs_test.go +++ b/fs_test.go @@ -16,7 +16,7 @@ package procfs import "testing" const ( - procTestFixtures = "fixtures/proc" + procTestFixtures = "testdata/fixtures/proc" ) func TestNewFS(t *testing.T) { diff --git a/internal/fs/fs_test.go b/internal/fs/fs_test.go index bebcbe2dc..559ceff19 100644 --- a/internal/fs/fs_test.go +++ b/internal/fs/fs_test.go @@ -16,7 +16,7 @@ package fs import "testing" const ( - sysTestFixtures = "../../fixtures/sys" + sysTestFixtures = "testdata/fixtures/sys" ) func TestNewFS(t *testing.T) { diff --git a/internal/fs/testdata/fixtures b/internal/fs/testdata/fixtures new file mode 120000 index 000000000..1eb482091 --- /dev/null +++ b/internal/fs/testdata/fixtures @@ -0,0 +1 @@ +../../../testdata/fixtures \ No newline at end of file diff --git a/iscsi/get_test.go b/iscsi/get_test.go index f21b1abf1..86e34eac3 100644 --- a/iscsi/get_test.go +++ b/iscsi/get_test.go @@ -30,12 +30,12 @@ func TestGetStats(t *testing.T) { Tpgt: []iscsi.TPGT{ { Name: "tpgt_1", - TpgtPath: "../fixtures/sys/kernel/config/target/iscsi/iqn.2003-01.org.linux-iscsi.osd1.x8664:sn.8888bbbbddd0/tpgt_1", + TpgtPath: "testdata/fixtures/sys/kernel/config/target/iscsi/iqn.2003-01.org.linux-iscsi.osd1.x8664:sn.8888bbbbddd0/tpgt_1", IsEnable: true, Luns: []iscsi.LUN{ { Name: "lun_0", - LunPath: "../fixtures/sys/kernel/config/target/iscsi/iqn.2003-01.org.linux-iscsi.osd1.x8664:sn.8888bbbbddd0/tpgt_1/lun/lun_0", + LunPath: "testdata/fixtures/sys/kernel/config/target/iscsi/iqn.2003-01.org.linux-iscsi.osd1.x8664:sn.8888bbbbddd0/tpgt_1/lun/lun_0", Backstore: "rd_mcp", ObjectName: "ramdisk_lio_1G", TypeNumber: "119", @@ -43,7 +43,7 @@ func TestGetStats(t *testing.T) { }, }, }, - RootPath: "../fixtures/sys/kernel/config/target/iscsi", + RootPath: "testdata/fixtures/sys/kernel/config/target/iscsi", }, }, { @@ -52,12 +52,12 @@ func TestGetStats(t *testing.T) { Tpgt: []iscsi.TPGT{ { Name: "tpgt_1", - TpgtPath: "../fixtures/sys/kernel/config/target/iscsi/iqn.2003-01.org.linux-iscsi.osd1.x8664:sn.abcd1abcd2ab/tpgt_1", + TpgtPath: "testdata/fixtures/sys/kernel/config/target/iscsi/iqn.2003-01.org.linux-iscsi.osd1.x8664:sn.abcd1abcd2ab/tpgt_1", IsEnable: true, Luns: []iscsi.LUN{ { Name: "lun_0", - LunPath: "../fixtures/sys/kernel/config/target/iscsi/iqn.2003-01.org.linux-iscsi.osd1.x8664:sn.abcd1abcd2ab/tpgt_1/lun/lun_0", + LunPath: "testdata/fixtures/sys/kernel/config/target/iscsi/iqn.2003-01.org.linux-iscsi.osd1.x8664:sn.abcd1abcd2ab/tpgt_1/lun/lun_0", Backstore: "iblock", ObjectName: "block_lio_rbd1", TypeNumber: "0", @@ -65,7 +65,7 @@ func TestGetStats(t *testing.T) { }, }, }, - RootPath: "../fixtures/sys/kernel/config/target/iscsi", + RootPath: "testdata/fixtures/sys/kernel/config/target/iscsi", }, }, { @@ -74,12 +74,12 @@ func TestGetStats(t *testing.T) { Tpgt: []iscsi.TPGT{ { Name: "tpgt_1", - TpgtPath: "../fixtures/sys/kernel/config/target/iscsi/iqn.2016-11.org.linux-iscsi.igw.x86:dev.rbd0/tpgt_1", + TpgtPath: "testdata/fixtures/sys/kernel/config/target/iscsi/iqn.2016-11.org.linux-iscsi.igw.x86:dev.rbd0/tpgt_1", IsEnable: true, Luns: []iscsi.LUN{ { Name: "lun_0", - LunPath: "../fixtures/sys/kernel/config/target/iscsi/iqn.2016-11.org.linux-iscsi.igw.x86:dev.rbd0/tpgt_1/lun/lun_0", + LunPath: "testdata/fixtures/sys/kernel/config/target/iscsi/iqn.2016-11.org.linux-iscsi.igw.x86:dev.rbd0/tpgt_1/lun/lun_0", Backstore: "fileio", ObjectName: "file_lio_1G", TypeNumber: "1", @@ -87,7 +87,7 @@ func TestGetStats(t *testing.T) { }, }, }, - RootPath: "../fixtures/sys/kernel/config/target/iscsi", + RootPath: "testdata/fixtures/sys/kernel/config/target/iscsi", }, }, { @@ -96,12 +96,12 @@ func TestGetStats(t *testing.T) { Tpgt: []iscsi.TPGT{ { Name: "tpgt_1", - TpgtPath: "../fixtures/sys/kernel/config/target/iscsi/iqn.2016-11.org.linux-iscsi.igw.x86:sn.ramdemo/tpgt_1", + TpgtPath: "testdata/fixtures/sys/kernel/config/target/iscsi/iqn.2016-11.org.linux-iscsi.igw.x86:sn.ramdemo/tpgt_1", IsEnable: true, Luns: []iscsi.LUN{ { Name: "lun_0", - LunPath: "../fixtures/sys/kernel/config/target/iscsi/iqn.2016-11.org.linux-iscsi.igw.x86:sn.ramdemo/tpgt_1/lun/lun_0", + LunPath: "testdata/fixtures/sys/kernel/config/target/iscsi/iqn.2016-11.org.linux-iscsi.igw.x86:sn.ramdemo/tpgt_1/lun/lun_0", Backstore: "rbd", ObjectName: "iscsi-images-demo", TypeNumber: "0", @@ -109,7 +109,7 @@ func TestGetStats(t *testing.T) { }, }, }, - RootPath: "../fixtures/sys/kernel/config/target/iscsi", + RootPath: "testdata/fixtures/sys/kernel/config/target/iscsi", }, }, } @@ -125,7 +125,7 @@ func TestGetStats(t *testing.T) { {1504, 4733, 1234}, } - sysconfigfs, err := iscsi.NewFS("../fixtures/sys", "../fixtures/sys/kernel/config") + sysconfigfs, err := iscsi.NewFS("testdata/fixtures/sys", "testdata/fixtures/sys/kernel/config") if err != nil { t.Fatalf("failed to access xfs fs: %v", err) } diff --git a/iscsi/testdata/fixtures b/iscsi/testdata/fixtures new file mode 120000 index 000000000..5fdc97bed --- /dev/null +++ b/iscsi/testdata/fixtures @@ -0,0 +1 @@ +../../testdata/fixtures \ No newline at end of file diff --git a/kernel_random_test.go b/kernel_random_test.go index fcd85c82d..836a88d2f 100644 --- a/kernel_random_test.go +++ b/kernel_random_test.go @@ -20,7 +20,7 @@ import ( "testing" ) -const procfsFixtures = "fixtures/proc" +const procfsFixtures = "testdata/fixtures/proc" func TestKernelRandom(t *testing.T) { fs, err := NewFS(procfsFixtures) diff --git a/net_tcp_test.go b/net_tcp_test.go index 1be706da9..a32e2fbf8 100644 --- a/net_tcp_test.go +++ b/net_tcp_test.go @@ -28,7 +28,7 @@ func Test_newNetTCP(t *testing.T) { }{ { name: "tcp file found, no error should come up", - file: "fixtures/proc/net/tcp", + file: "testdata/fixtures/proc/net/tcp", want: []*netIPSocketLine{ &netIPSocketLine{ Sl: 0, @@ -71,7 +71,7 @@ func Test_newNetTCP(t *testing.T) { }, { name: "tcp6 file found, no error should come up", - file: "fixtures/proc/net/tcp6", + file: "testdata/fixtures/proc/net/tcp6", want: []*netIPSocketLine{ &netIPSocketLine{ Sl: 1315, @@ -108,7 +108,7 @@ func Test_newNetTCP(t *testing.T) { }, { name: "error case - parse error", - file: "fixtures/proc/net/tcp_broken", + file: "testdata/fixtures/proc/net/tcp_broken", want: nil, wantErr: true, }, @@ -136,13 +136,13 @@ func Test_newNetTCPSummary(t *testing.T) { }{ { name: "tcp file found, no error should come up", - file: "fixtures/proc/net/tcp", + file: "testdata/fixtures/proc/net/tcp", want: &NetTCPSummary{TxQueueLength: 2, RxQueueLength: 2, UsedSockets: 3}, wantErr: false, }, { name: "tcp6 file found, no error should come up", - file: "fixtures/proc/net/tcp6", + file: "testdata/fixtures/proc/net/tcp6", want: &NetTCPSummary{TxQueueLength: 0, RxQueueLength: 0, UsedSockets: 2}, wantErr: false, }, @@ -154,7 +154,7 @@ func Test_newNetTCPSummary(t *testing.T) { }, { name: "error case - parse error", - file: "fixtures/proc/net/tcp_broken", + file: "testdata/fixtures/proc/net/tcp_broken", want: nil, wantErr: true, }, diff --git a/net_udp_test.go b/net_udp_test.go index 50237557c..9abb64d5c 100644 --- a/net_udp_test.go +++ b/net_udp_test.go @@ -28,7 +28,7 @@ func Test_newNetUDP(t *testing.T) { }{ { name: "udp file found, no error should come up", - file: "fixtures/proc/net/udp", + file: "testdata/fixtures/proc/net/udp", want: []*netIPSocketLine{ &netIPSocketLine{ Sl: 0, @@ -71,7 +71,7 @@ func Test_newNetUDP(t *testing.T) { }, { name: "udp6 file found, no error should come up", - file: "fixtures/proc/net/udp6", + file: "testdata/fixtures/proc/net/udp6", want: []*netIPSocketLine{ &netIPSocketLine{ Sl: 1315, @@ -108,7 +108,7 @@ func Test_newNetUDP(t *testing.T) { }, { name: "error case - parse error", - file: "fixtures/proc/net/udp_broken", + file: "testdata/fixtures/proc/net/udp_broken", want: nil, wantErr: true, }, @@ -136,13 +136,13 @@ func Test_newNetUDPSummary(t *testing.T) { }{ { name: "udp file found, no error should come up", - file: "fixtures/proc/net/udp", + file: "testdata/fixtures/proc/net/udp", want: &NetUDPSummary{TxQueueLength: 2, RxQueueLength: 2, UsedSockets: 3}, wantErr: false, }, { name: "udp6 file found, no error should come up", - file: "fixtures/proc/net/udp6", + file: "testdata/fixtures/proc/net/udp6", want: &NetUDPSummary{TxQueueLength: 0, RxQueueLength: 0, UsedSockets: 2}, wantErr: false, }, @@ -154,7 +154,7 @@ func Test_newNetUDPSummary(t *testing.T) { }, { name: "error case - parse error", - file: "fixtures/proc/net/udp_broken", + file: "testdata/fixtures/proc/net/udp_broken", want: nil, wantErr: true, }, diff --git a/sysfs/fs_test.go b/sysfs/fs_test.go index 37ffe7d20..ee4e147d2 100644 --- a/sysfs/fs_test.go +++ b/sysfs/fs_test.go @@ -19,7 +19,7 @@ package sysfs import "testing" const ( - sysTestFixtures = "../fixtures/sys" + sysTestFixtures = "testdata/fixtures/sys" ) func TestNewFS(t *testing.T) { diff --git a/sysfs/testdata/fixtures b/sysfs/testdata/fixtures new file mode 120000 index 000000000..5fdc97bed --- /dev/null +++ b/sysfs/testdata/fixtures @@ -0,0 +1 @@ +../../testdata/fixtures \ No newline at end of file diff --git a/fixtures.ttar b/testdata/fixtures.ttar similarity index 99% rename from fixtures.ttar rename to testdata/fixtures.ttar index a24c42866..bd25048a5 100644 --- a/fixtures.ttar +++ b/testdata/fixtures.ttar @@ -1,4 +1,4 @@ -# Archive created by ttar -c -f fixtures.ttar fixtures/ +# Archive created by ttar -c -f testdata/fixtures.ttar -C testdata/ fixtures/ Directory: fixtures Mode: 775 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/xfs/parse_test.go b/xfs/parse_test.go index 4989ecac0..aab5a7bcb 100644 --- a/xfs/parse_test.go +++ b/xfs/parse_test.go @@ -731,7 +731,7 @@ func TestParseStats(t *testing.T) { stats, err = xfs.ParseStats(strings.NewReader(tt.s)) } if tt.fs { - xfs, err := xfs.NewFS("../fixtures/proc", "../fixtures/sys") + xfs, err := xfs.NewFS("testdata/fixtures/proc", "testdata/fixtures/sys") if err != nil { t.Fatalf("failed to access xfs fs: %v", err) } diff --git a/xfs/testdata/fixtures b/xfs/testdata/fixtures new file mode 120000 index 000000000..5fdc97bed --- /dev/null +++ b/xfs/testdata/fixtures @@ -0,0 +1 @@ +../../testdata/fixtures \ No newline at end of file diff --git a/xfs/xfs_test.go b/xfs/xfs_test.go index 03fe81e49..ad9997e2e 100644 --- a/xfs/xfs_test.go +++ b/xfs/xfs_test.go @@ -21,7 +21,7 @@ import ( ) func TestReadProcStat(t *testing.T) { - xfs, err := xfs.NewFS("../fixtures/proc", "../fixtures/sys") + xfs, err := xfs.NewFS("testdata/fixtures/proc", "testdata/fixtures/sys") if err != nil { t.Fatalf("failed to access xfs fs: %v", err) } @@ -38,7 +38,7 @@ func TestReadProcStat(t *testing.T) { } func TestReadSysStats(t *testing.T) { - xfs, err := xfs.NewFS("../fixtures/proc", "../fixtures/sys") + xfs, err := xfs.NewFS("testdata/fixtures/proc", "testdata/fixtures/sys") if err != nil { t.Fatalf("failed to access xfs fs: %v", err) } From 986382d81e5ba05908ab154f2dbc1711e388af46 Mon Sep 17 00:00:00 2001 From: PrometheusBot Date: Tue, 7 Jun 2022 15:43:07 +0200 Subject: [PATCH 027/176] Update common Prometheus files (#451) Signed-off-by: prombot --- .github/workflows/golangci-lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index 136d7d4b9..6034bcbf8 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -25,6 +25,6 @@ jobs: run: sudo apt-get update && sudo apt-get -y install libsnmp-dev if: github.repository == 'prometheus/snmp_exporter' - name: Lint - uses: golangci/golangci-lint-action@v3.1.0 + uses: golangci/golangci-lint-action@v3.2.0 with: version: v1.45.2 From 5be723405f68d8381a9accdc0bd7bdbe7621e2b6 Mon Sep 17 00:00:00 2001 From: PrometheusBot Date: Tue, 14 Jun 2022 00:18:23 +0200 Subject: [PATCH 028/176] Update common Prometheus files (#455) Signed-off-by: prombot --- Makefile.common | 75 ++++++++----------------------------------------- 1 file changed, 11 insertions(+), 64 deletions(-) diff --git a/Makefile.common b/Makefile.common index c263b733f..6c8e3e219 100644 --- a/Makefile.common +++ b/Makefile.common @@ -36,29 +36,6 @@ GO_VERSION ?= $(shell $(GO) version) GO_VERSION_NUMBER ?= $(word 3, $(GO_VERSION)) PRE_GO_111 ?= $(shell echo $(GO_VERSION_NUMBER) | grep -E 'go1\.(10|[0-9])\.') -GOVENDOR := -GO111MODULE := -ifeq (, $(PRE_GO_111)) - ifneq (,$(wildcard go.mod)) - # Enforce Go modules support just in case the directory is inside GOPATH (and for Travis CI). - GO111MODULE := on - - ifneq (,$(wildcard vendor)) - # Always use the local vendor/ directory to satisfy the dependencies. - GOOPTS := $(GOOPTS) -mod=vendor - endif - endif -else - ifneq (,$(wildcard go.mod)) - ifneq (,$(wildcard vendor)) -$(warning This repository requires Go >= 1.11 because of Go modules) -$(warning Some recipes may not work as expected as the current Go runtime is '$(GO_VERSION_NUMBER)') - endif - else - # This repository isn't using Go modules (yet). - GOVENDOR := $(FIRST_GOPATH)/bin/govendor - endif -endif PROMU := $(FIRST_GOPATH)/bin/promu pkgs = ./... @@ -150,11 +127,7 @@ common-check_license: .PHONY: common-deps common-deps: @echo ">> getting dependencies" -ifdef GO111MODULE - GO111MODULE=$(GO111MODULE) $(GO) mod download -else - $(GO) get $(GOOPTS) -t ./... -endif + $(GO) mod download .PHONY: update-go-deps update-go-deps: @@ -162,20 +135,17 @@ update-go-deps: @for m in $$($(GO) list -mod=readonly -m -f '{{ if and (not .Indirect) (not .Main)}}{{.Path}}{{end}}' all); do \ $(GO) get -d $$m; \ done - GO111MODULE=$(GO111MODULE) $(GO) mod tidy -ifneq (,$(wildcard vendor)) - GO111MODULE=$(GO111MODULE) $(GO) mod vendor -endif + $(GO) mod tidy .PHONY: common-test-short common-test-short: $(GOTEST_DIR) @echo ">> running short tests" - GO111MODULE=$(GO111MODULE) $(GOTEST) -short $(GOOPTS) $(pkgs) + $(GOTEST) -short $(GOOPTS) $(pkgs) .PHONY: common-test common-test: $(GOTEST_DIR) @echo ">> running all tests" - GO111MODULE=$(GO111MODULE) $(GOTEST) $(test-flags) $(GOOPTS) $(pkgs) + $(GOTEST) $(test-flags) $(GOOPTS) $(pkgs) $(GOTEST_DIR): @mkdir -p $@ @@ -183,25 +153,21 @@ $(GOTEST_DIR): .PHONY: common-format common-format: @echo ">> formatting code" - GO111MODULE=$(GO111MODULE) $(GO) fmt $(pkgs) + $(GO) fmt $(pkgs) .PHONY: common-vet common-vet: @echo ">> vetting code" - GO111MODULE=$(GO111MODULE) $(GO) vet $(GOOPTS) $(pkgs) + $(GO) vet $(GOOPTS) $(pkgs) .PHONY: common-lint common-lint: $(GOLANGCI_LINT) ifdef GOLANGCI_LINT @echo ">> running golangci-lint" -ifdef GO111MODULE # 'go list' needs to be executed before staticcheck to prepopulate the modules cache. # Otherwise staticcheck might fail randomly for some reason not yet explained. - GO111MODULE=$(GO111MODULE) $(GO) list -e -compiled -test=true -export=false -deps=true -find=false -tags= -- ./... > /dev/null - GO111MODULE=$(GO111MODULE) $(GOLANGCI_LINT) run $(GOLANGCI_LINT_OPTS) $(pkgs) -else - $(GOLANGCI_LINT) run $(pkgs) -endif + $(GO) list -e -compiled -test=true -export=false -deps=true -find=false -tags= -- ./... > /dev/null + $(GOLANGCI_LINT) run $(GOLANGCI_LINT_OPTS) $(pkgs) endif .PHONY: common-yamllint @@ -218,28 +184,15 @@ endif common-staticcheck: lint .PHONY: common-unused -common-unused: $(GOVENDOR) -ifdef GOVENDOR - @echo ">> running check for unused packages" - @$(GOVENDOR) list +unused | grep . && exit 1 || echo 'No unused packages' -else -ifdef GO111MODULE +common-unused: @echo ">> running check for unused/missing packages in go.mod" - GO111MODULE=$(GO111MODULE) $(GO) mod tidy -ifeq (,$(wildcard vendor)) + $(GO) mod tidy @git diff --exit-code -- go.sum go.mod -else - @echo ">> running check for unused packages in vendor/" - GO111MODULE=$(GO111MODULE) $(GO) mod vendor - @git diff --exit-code -- go.sum go.mod vendor/ -endif -endif -endif .PHONY: common-build common-build: promu @echo ">> building binaries" - GO111MODULE=$(GO111MODULE) $(PROMU) build --prefix $(PREFIX) $(PROMU_BINARIES) + $(PROMU) build --prefix $(PREFIX) $(PROMU_BINARIES) .PHONY: common-tarball common-tarball: promu @@ -295,12 +248,6 @@ $(GOLANGCI_LINT): | sh -s -- -b $(FIRST_GOPATH)/bin $(GOLANGCI_LINT_VERSION) endif -ifdef GOVENDOR -.PHONY: $(GOVENDOR) -$(GOVENDOR): - GOOS= GOARCH= $(GO) get -u github.com/kardianos/govendor -endif - .PHONY: precheck precheck:: From 5ca7f34782934779bf78ff0a97e2bdcccf7a31ff Mon Sep 17 00:00:00 2001 From: Ben Kochie Date: Sat, 18 Jun 2022 09:12:16 +0200 Subject: [PATCH 029/176] Update build (#454) * Update minimum supported version to 1.17. * Update Go modules. * Enable dependabot. Signed-off-by: SuperQ --- .circleci/config.yml | 4 ---- .github/dependabot.yml | 6 ++++++ go.mod | 8 ++++---- go.sum | 14 ++++++-------- 4 files changed, 16 insertions(+), 16 deletions(-) create mode 100644 .github/dependabot.yml diff --git a/.circleci/config.yml b/.circleci/config.yml index b95e376f6..7e58263b2 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -54,8 +54,6 @@ workflows: matrix: parameters: go_version: - - "1.15" - - "1.16" - "1.17" - "1.18" - test: @@ -65,8 +63,6 @@ workflows: matrix: parameters: go_version: - - "1.15" - - "1.16" - "1.17" - "1.18" - codespell diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 000000000..202ae2366 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,6 @@ +version: 2 +updates: + - package-ecosystem: "gomod" + directory: "/" + schedule: + interval: "monthly" diff --git a/go.mod b/go.mod index bff0d0b9e..f34c350d8 100644 --- a/go.mod +++ b/go.mod @@ -1,9 +1,9 @@ module github.com/prometheus/procfs -go 1.15 +go 1.17 require ( - github.com/google/go-cmp v0.5.7 - golang.org/x/sync v0.0.0-20210220032951-036812b2e83c - golang.org/x/sys v0.0.0-20220412211240-33da011f77ad + github.com/google/go-cmp v0.5.8 + golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f + golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a ) diff --git a/go.sum b/go.sum index e2fe30a16..1e57810df 100644 --- a/go.sum +++ b/go.sum @@ -1,8 +1,6 @@ -github.com/google/go-cmp v0.5.7 h1:81/ik6ipDQS2aGcBfIN5dHDB36BwrStyeAQquSYCV4o= -github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= -golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ= -golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20220412211240-33da011f77ad h1:ntjMns5wyP/fN65tdBD4g8J5w8n015+iIIs9rtjXkY0= -golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= +github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f h1:Ax0t5p6N38Ga0dThY21weqDEyz2oklo4IvDkpigvkD8= +golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a h1:dGzPydgVsqGcTRVwiLJ1jVbufYwmzD3LfVPLKsKg+0k= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= From 4ba3093565a1a6c72b1a89a8234a67dc8c560177 Mon Sep 17 00:00:00 2001 From: Ben Kochie Date: Sun, 19 Jun 2022 10:47:20 +0200 Subject: [PATCH 030/176] Replace deprecation ioutil fucntions (#456) Go 1.16 deprecated several `io/ioutil` functions. * `ioutil.ReadFile` -> `os.ReadFile` * `ioutil.ReadAll` -> `io.ReadAll` * `ioutil.ReadDir` -> `os.ReadDir` Signed-off-by: SuperQ --- CONTRIBUTING.md | 4 ++-- arp.go | 4 ++-- bcache/get.go | 3 +-- blockdevice/stats.go | 5 ++--- btrfs/get.go | 5 ++--- internal/util/parse.go | 6 +++--- internal/util/readfile.go | 7 +++---- internal/util/sysreadfile.go | 4 ++-- ipvs.go | 3 +-- iscsi/get.go | 13 ++++++------- mdstat.go | 4 ++-- proc.go | 6 +++--- sysfs/class_dmi.go | 5 ++--- sysfs/class_fibrechannel.go | 7 +++---- sysfs/class_infiniband.go | 19 +++++++++---------- sysfs/class_nvme.go | 4 ++-- sysfs/class_power_supply.go | 7 +++---- sysfs/class_powercap.go | 6 +++--- sysfs/class_scsitape.go | 6 +++--- sysfs/net_class.go | 9 ++++----- sysfs/system_cpu.go | 3 +-- sysfs/vulnerability.go | 4 ++-- vm.go | 3 +-- zoneinfo.go | 4 ++-- 24 files changed, 64 insertions(+), 77 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 943de7615..853eb9d49 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -97,7 +97,7 @@ Many of the files are changing continuously and the data being read can in some reads in the same file. Also, most of the files are relatively small (less than a few KBs), and system calls to the `stat` function will often return the wrong size. Therefore, for most files it's recommended to read the full file in a single operation using an internal utility function called `util.ReadFileNoStat`. -This function is similar to `ioutil.ReadFile`, but it avoids the system call to `stat` to get the current size of +This function is similar to `os.ReadFile`, but it avoids the system call to `stat` to get the current size of the file. Note that parsing the file's contents can still be performed one line at a time. This is done by first reading @@ -113,7 +113,7 @@ the full file, and then using a scanner on the `[]byte` or `string` containing t ``` The `/sys` filesystem contains many very small files which contain only a single numeric or text value. These files -can be read using an internal function called `util.SysReadFile` which is similar to `ioutil.ReadFile` but does +can be read using an internal function called `util.SysReadFile` which is similar to `os.ReadFile` but does not bother to check the size of the file before reading. ``` data, err := util.SysReadFile("/sys/class/power_supply/BAT0/capacity") diff --git a/arp.go b/arp.go index 1f2616a96..68f36e888 100644 --- a/arp.go +++ b/arp.go @@ -15,8 +15,8 @@ package procfs import ( "fmt" - "io/ioutil" "net" + "os" "strconv" "strings" ) @@ -53,7 +53,7 @@ type ARPEntry struct { // GatherARPEntries retrieves all the ARP entries, parse the relevant columns, // and then return a slice of ARPEntry's. func (fs FS) GatherARPEntries() ([]ARPEntry, error) { - data, err := ioutil.ReadFile(fs.proc.Path("net/arp")) + data, err := os.ReadFile(fs.proc.Path("net/arp")) if err != nil { return nil, fmt.Errorf("error reading arp %q: %w", fs.proc.Path("net/arp"), err) } diff --git a/bcache/get.go b/bcache/get.go index 41ac1899c..aa380c2b4 100644 --- a/bcache/get.go +++ b/bcache/get.go @@ -16,7 +16,6 @@ package bcache import ( "bufio" "fmt" - "io/ioutil" "os" "path" "path/filepath" @@ -204,7 +203,7 @@ func (p *parser) readValue(fileName string) uint64 { return 0 } path := path.Join(p.currentDir, fileName) - byt, err := ioutil.ReadFile(path) + byt, err := os.ReadFile(path) if err != nil { if !os.IsNotExist(err) { p.err = fmt.Errorf("failed to read: %s", path) diff --git a/blockdevice/stats.go b/blockdevice/stats.go index 9b8182fab..b06ce3945 100644 --- a/blockdevice/stats.go +++ b/blockdevice/stats.go @@ -17,7 +17,6 @@ import ( "bufio" "fmt" "io" - "io/ioutil" "os" "strings" @@ -293,7 +292,7 @@ func (fs FS) ProcDiskstats() ([]Diskstats, error) { // SysBlockDevices lists the device names from /sys/block/. func (fs FS) SysBlockDevices() ([]string, error) { - deviceDirs, err := ioutil.ReadDir(fs.sys.Path(sysBlockPath)) + deviceDirs, err := os.ReadDir(fs.sys.Path(sysBlockPath)) if err != nil { return nil, err } @@ -309,7 +308,7 @@ func (fs FS) SysBlockDevices() ([]string, error) { // and 11 if they are not available. func (fs FS) SysBlockDeviceStat(device string) (IOStats, int, error) { stat := IOStats{} - bytes, err := ioutil.ReadFile(fs.sys.Path(sysBlockPath, device, "stat")) + bytes, err := os.ReadFile(fs.sys.Path(sysBlockPath, device, "stat")) if err != nil { return stat, 0, err } diff --git a/btrfs/get.go b/btrfs/get.go index cb28959e1..8c5149a62 100644 --- a/btrfs/get.go +++ b/btrfs/get.go @@ -14,7 +14,6 @@ package btrfs import ( - "io/ioutil" "os" "path" "path/filepath" @@ -122,7 +121,7 @@ func (r *reader) readValue(n string) (v uint64) { // listFiles returns a list of files for a directory of the reader. func (r *reader) listFiles(p string) []string { - files, err := ioutil.ReadDir(path.Join(r.path, p)) + files, err := os.ReadDir(path.Join(r.path, p)) if err != nil { r.err = err return nil @@ -164,7 +163,7 @@ func (r *reader) readAllocationStats(d string) (a *AllocationStats) { // readLayouts reads all Btrfs layout statistics for the current path. func (r *reader) readLayouts() map[string]*LayoutUsage { - files, err := ioutil.ReadDir(r.path) + files, err := os.ReadDir(r.path) if err != nil { r.err = err return nil diff --git a/internal/util/parse.go b/internal/util/parse.go index 22cb07a6b..b030951fa 100644 --- a/internal/util/parse.go +++ b/internal/util/parse.go @@ -14,7 +14,7 @@ package util import ( - "io/ioutil" + "os" "strconv" "strings" ) @@ -66,7 +66,7 @@ func ParsePInt64s(ss []string) ([]*int64, error) { // ReadUintFromFile reads a file and attempts to parse a uint64 from it. func ReadUintFromFile(path string) (uint64, error) { - data, err := ioutil.ReadFile(path) + data, err := os.ReadFile(path) if err != nil { return 0, err } @@ -75,7 +75,7 @@ func ReadUintFromFile(path string) (uint64, error) { // ReadIntFromFile reads a file and attempts to parse a int64 from it. func ReadIntFromFile(path string) (int64, error) { - data, err := ioutil.ReadFile(path) + data, err := os.ReadFile(path) if err != nil { return 0, err } diff --git a/internal/util/readfile.go b/internal/util/readfile.go index 8051161b2..1e9c1fbfa 100644 --- a/internal/util/readfile.go +++ b/internal/util/readfile.go @@ -15,12 +15,11 @@ package util import ( "io" - "io/ioutil" "os" ) -// ReadFileNoStat uses ioutil.ReadAll to read contents of entire file. -// This is similar to ioutil.ReadFile but without the call to os.Stat, because +// ReadFileNoStat uses io.ReadAll to read contents of entire file. +// This is similar to os.ReadFile but without the call to os.Stat, because // many files in /proc and /sys report incorrect file sizes (either 0 or 4096). // Reads a max file size of 512kB. For files larger than this, a scanner // should be used. @@ -34,5 +33,5 @@ func ReadFileNoStat(filename string) ([]byte, error) { defer f.Close() reader := io.LimitReader(f, maxBufferSize) - return ioutil.ReadAll(reader) + return io.ReadAll(reader) } diff --git a/internal/util/sysreadfile.go b/internal/util/sysreadfile.go index 38e76f920..bd6ea1ebd 100644 --- a/internal/util/sysreadfile.go +++ b/internal/util/sysreadfile.go @@ -22,7 +22,7 @@ import ( "syscall" ) -// SysReadFile is a simplified ioutil.ReadFile that invokes syscall.Read directly. +// SysReadFile is a simplified os.ReadFile that invokes syscall.Read directly. // https://github.com/prometheus/node_exporter/pull/728/files // // Note that this function will not read files larger than 128 bytes. @@ -34,7 +34,7 @@ func SysReadFile(file string) (string, error) { defer f.Close() // On some machines, hwmon drivers are broken and return EAGAIN. This causes - // Go's ioutil.ReadFile implementation to poll forever. + // Go's os.ReadFile implementation to poll forever. // // Since we either want to read data or bail immediately, do the simplest // possible read using syscall directly. diff --git a/ipvs.go b/ipvs.go index 89e447746..391c07957 100644 --- a/ipvs.go +++ b/ipvs.go @@ -20,7 +20,6 @@ import ( "errors" "fmt" "io" - "io/ioutil" "net" "os" "strconv" @@ -84,7 +83,7 @@ func parseIPVSStats(r io.Reader) (IPVSStats, error) { stats IPVSStats ) - statContent, err := ioutil.ReadAll(r) + statContent, err := io.ReadAll(r) if err != nil { return IPVSStats{}, err } diff --git a/iscsi/get.go b/iscsi/get.go index 347edd993..bee319361 100644 --- a/iscsi/get.go +++ b/iscsi/get.go @@ -17,7 +17,6 @@ package iscsi import ( "errors" "fmt" - "io/ioutil" "os" "path/filepath" "strconv" @@ -60,7 +59,7 @@ func GetStats(iqnPath string) (*Stats, error) { // isPathEnable checks if the file "enable" contain enable message. func isPathEnable(path string) (bool, error) { - enableReadout, err := ioutil.ReadFile(filepath.Join(path, "enable")) + enableReadout, err := os.ReadFile(filepath.Join(path, "enable")) if err != nil { return false, fmt.Errorf("iscsi: isPathEnable ReadFile error %w", err) } @@ -74,7 +73,7 @@ func isPathEnable(path string) (bool, error) { func getLunLinkTarget(lunPath string) (lunObject LUN, err error) { lunObject.Name = filepath.Base(lunPath) lunObject.LunPath = lunPath - files, err := ioutil.ReadDir(lunPath) + files, err := os.ReadDir(lunPath) if err != nil { return lunObject, fmt.Errorf("getLunLinkTarget: ReadDir path %q: %w", lunPath, err) } @@ -144,7 +143,7 @@ func (fs FS) GetFileioUdev(fileioNumber string, objectName string) (*FILEIO, err if _, err := os.Stat(udevPath); os.IsNotExist(err) { return nil, fmt.Errorf("iscsi: GetFileioUdev: fileio_%s is missing file name", fileio.Fnumber) } - filename, err := ioutil.ReadFile(udevPath) + filename, err := os.ReadFile(udevPath) if err != nil { return nil, fmt.Errorf("iscsi: GetFileioUdev: Cannot read filename from udev link %q", udevPath) } @@ -166,7 +165,7 @@ func (fs FS) GetIblockUdev(iblockNumber string, objectName string) (*IBLOCK, err if _, err := os.Stat(udevPath); os.IsNotExist(err) { return nil, fmt.Errorf("iscsi: GetIBlockUdev: iblock_%s is missing file name", iblock.Bnumber) } - filename, err := ioutil.ReadFile(udevPath) + filename, err := os.ReadFile(udevPath) if err != nil { return nil, fmt.Errorf("iscsi: GetIBlockUdev: Cannot read iblock from udev link %q", udevPath) } @@ -193,7 +192,7 @@ func (fs FS) GetRBDMatch(rbdNumber string, poolImage string) (*RBD, error) { if _, err := os.Stat(systemPoolPath); os.IsNotExist(err) { continue } - bSystemPool, err := ioutil.ReadFile(systemPoolPath) + bSystemPool, err := os.ReadFile(systemPoolPath) if err != nil { continue } else { @@ -204,7 +203,7 @@ func (fs FS) GetRBDMatch(rbdNumber string, poolImage string) (*RBD, error) { if _, err := os.Stat(systemImagePath); os.IsNotExist(err) { continue } - bSystemImage, err := ioutil.ReadFile(systemImagePath) + bSystemImage, err := os.ReadFile(systemImagePath) if err != nil { continue } else { diff --git a/mdstat.go b/mdstat.go index 2c7900f35..a95c889cb 100644 --- a/mdstat.go +++ b/mdstat.go @@ -15,7 +15,7 @@ package procfs import ( "fmt" - "io/ioutil" + "os" "regexp" "strconv" "strings" @@ -64,7 +64,7 @@ type MDStat struct { // structs containing the relevant info. More information available here: // https://raid.wiki.kernel.org/index.php/Mdstat func (fs FS) MDStat() ([]MDStat, error) { - data, err := ioutil.ReadFile(fs.proc.Path("mdstat")) + data, err := os.ReadFile(fs.proc.Path("mdstat")) if err != nil { return nil, err } diff --git a/proc.go b/proc.go index 5b3e1e4a9..c30223af7 100644 --- a/proc.go +++ b/proc.go @@ -16,7 +16,7 @@ package procfs import ( "bytes" "fmt" - "io/ioutil" + "io" "os" "strconv" "strings" @@ -142,7 +142,7 @@ func (p Proc) Wchan() (string, error) { } defer f.Close() - data, err := ioutil.ReadAll(f) + data, err := io.ReadAll(f) if err != nil { return "", err } @@ -311,7 +311,7 @@ func (p Proc) FileDescriptorsInfo() (ProcFDInfos, error) { // Schedstat returns task scheduling information for the process. func (p Proc) Schedstat() (ProcSchedstat, error) { - contents, err := ioutil.ReadFile(p.path("schedstat")) + contents, err := os.ReadFile(p.path("schedstat")) if err != nil { return ProcSchedstat{}, err } diff --git a/sysfs/class_dmi.go b/sysfs/class_dmi.go index e556c7462..35f8d1f39 100644 --- a/sysfs/class_dmi.go +++ b/sysfs/class_dmi.go @@ -18,7 +18,6 @@ package sysfs import ( "fmt" - "io/ioutil" "os" "path/filepath" @@ -56,14 +55,14 @@ type DMIClass struct { func (fs FS) DMIClass() (*DMIClass, error) { path := fs.sys.Path(dmiClassPath) - files, err := ioutil.ReadDir(path) + files, err := os.ReadDir(path) if err != nil { return nil, fmt.Errorf("failed to read directory %q: %w", path, err) } var dmi DMIClass for _, f := range files { - if !f.Mode().IsRegular() { + if !f.Type().IsRegular() { continue } diff --git a/sysfs/class_fibrechannel.go b/sysfs/class_fibrechannel.go index 5d898168f..28a871dd0 100644 --- a/sysfs/class_fibrechannel.go +++ b/sysfs/class_fibrechannel.go @@ -18,7 +18,6 @@ package sysfs import ( "fmt" - "io/ioutil" "os" "path/filepath" @@ -66,7 +65,7 @@ type FibreChannelClass map[string]FibreChannelHost func (fs FS) FibreChannelClass() (FibreChannelClass, error) { path := fs.sys.Path(fibrechannelClassPath) - dirs, err := ioutil.ReadDir(path) + dirs, err := os.ReadDir(path) if err != nil { return nil, err } @@ -148,13 +147,13 @@ func parseFibreChannelStatistics(hostPath string) (*FibreChannelCounters, error) var counters FibreChannelCounters path := filepath.Join(hostPath, "statistics") - files, err := ioutil.ReadDir(path) + files, err := os.ReadDir(path) if err != nil { return nil, err } for _, f := range files { - if !f.Mode().IsRegular() || f.Name() == "reset_statistics" { + if !f.Type().IsRegular() || f.Name() == "reset_statistics" { continue } diff --git a/sysfs/class_infiniband.go b/sysfs/class_infiniband.go index 17b986262..679cb9686 100644 --- a/sysfs/class_infiniband.go +++ b/sysfs/class_infiniband.go @@ -18,7 +18,6 @@ package sysfs import ( "fmt" - "io/ioutil" "os" "path/filepath" "strconv" @@ -102,7 +101,7 @@ type InfiniBandClass map[string]InfiniBandDevice func (fs FS) InfiniBandClass() (InfiniBandClass, error) { path := fs.sys.Path(infinibandClassPath) - dirs, err := ioutil.ReadDir(path) + dirs, err := os.ReadDir(path) if err != nil { return nil, err } @@ -147,7 +146,7 @@ func (fs FS) parseInfiniBandDevice(name string) (*InfiniBandDevice, error) { } portsPath := filepath.Join(path, "ports") - ports, err := ioutil.ReadDir(portsPath) + ports, err := os.ReadDir(portsPath) if err != nil { return nil, fmt.Errorf("failed to list InfiniBand ports at %q: %w", portsPath, err) } @@ -205,7 +204,7 @@ func (fs FS) parseInfiniBandPort(name string, port string) (*InfiniBandPort, err ibp := InfiniBandPort{Name: name, Port: uint(portNumber)} portPath := fs.sys.Path(infinibandClassPath, name, "ports", port) - content, err := ioutil.ReadFile(filepath.Join(portPath, "state")) + content, err := os.ReadFile(filepath.Join(portPath, "state")) if err != nil { return nil, err } @@ -216,7 +215,7 @@ func (fs FS) parseInfiniBandPort(name string, port string) (*InfiniBandPort, err ibp.State = name ibp.StateID = id - content, err = ioutil.ReadFile(filepath.Join(portPath, "phys_state")) + content, err = os.ReadFile(filepath.Join(portPath, "phys_state")) if err != nil { return nil, err } @@ -227,7 +226,7 @@ func (fs FS) parseInfiniBandPort(name string, port string) (*InfiniBandPort, err ibp.PhysState = name ibp.PhysStateID = id - content, err = ioutil.ReadFile(filepath.Join(portPath, "rate")) + content, err = os.ReadFile(filepath.Join(portPath, "rate")) if err != nil { return nil, err } @@ -249,13 +248,13 @@ func parseInfiniBandCounters(portPath string) (*InfiniBandCounters, error) { var counters InfiniBandCounters path := filepath.Join(portPath, "counters") - files, err := ioutil.ReadDir(path) + files, err := os.ReadDir(path) if err != nil { return nil, err } for _, f := range files { - if !f.Mode().IsRegular() { + if !f.Type().IsRegular() { continue } @@ -344,13 +343,13 @@ func parseInfiniBandCounters(portPath string) (*InfiniBandCounters, error) { // Parse legacy counters path = filepath.Join(portPath, "counters_ext") - files, err = ioutil.ReadDir(path) + files, err = os.ReadDir(path) if err != nil && !os.IsNotExist(err) { return nil, err } for _, f := range files { - if !f.Mode().IsRegular() { + if !f.Type().IsRegular() { continue } diff --git a/sysfs/class_nvme.go b/sysfs/class_nvme.go index 5daf15005..133f6afa1 100644 --- a/sysfs/class_nvme.go +++ b/sysfs/class_nvme.go @@ -18,7 +18,7 @@ package sysfs import ( "fmt" - "io/ioutil" + "os" "path/filepath" "github.com/prometheus/procfs/internal/util" @@ -44,7 +44,7 @@ type NVMeClass map[string]NVMeDevice func (fs FS) NVMeClass() (NVMeClass, error) { path := fs.sys.Path(nvmeClassPath) - dirs, err := ioutil.ReadDir(path) + dirs, err := os.ReadDir(path) if err != nil { return nil, fmt.Errorf("failed to list NVMe devices at %q: %w", path, err) } diff --git a/sysfs/class_power_supply.go b/sysfs/class_power_supply.go index 2199de498..9969f0114 100644 --- a/sysfs/class_power_supply.go +++ b/sysfs/class_power_supply.go @@ -18,7 +18,6 @@ package sysfs import ( "fmt" - "io/ioutil" "os" "path/filepath" @@ -109,7 +108,7 @@ type PowerSupplyClass map[string]PowerSupply func (fs FS) PowerSupplyClass() (PowerSupplyClass, error) { path := fs.sys.Path("class/power_supply") - dirs, err := ioutil.ReadDir(path) + dirs, err := os.ReadDir(path) if err != nil { return nil, err } @@ -129,14 +128,14 @@ func (fs FS) PowerSupplyClass() (PowerSupplyClass, error) { } func parsePowerSupply(path string) (*PowerSupply, error) { - files, err := ioutil.ReadDir(path) + files, err := os.ReadDir(path) if err != nil { return nil, err } var ps PowerSupply for _, f := range files { - if !f.Mode().IsRegular() { + if !f.Type().IsRegular() { continue } diff --git a/sysfs/class_powercap.go b/sysfs/class_powercap.go index d1434a2eb..256cee4ae 100644 --- a/sysfs/class_powercap.go +++ b/sysfs/class_powercap.go @@ -18,7 +18,7 @@ package sysfs import ( "fmt" - "io/ioutil" + "os" "path/filepath" "strconv" "strings" @@ -40,7 +40,7 @@ type RaplZone struct { func GetRaplZones(fs FS) ([]RaplZone, error) { raplDir := fs.sys.Path("class/powercap") - files, err := ioutil.ReadDir(raplDir) + files, err := os.ReadDir(raplDir) if err != nil { return nil, fmt.Errorf("unable to read class/powercap: %w", err) } @@ -53,7 +53,7 @@ func GetRaplZones(fs FS) ([]RaplZone, error) { // Loop through directory files searching for file "name" from subdirs. for _, f := range files { nameFile := filepath.Join(raplDir, f.Name(), "/name") - nameBytes, err := ioutil.ReadFile(nameFile) + nameBytes, err := os.ReadFile(nameFile) if err == nil { // Add new rapl zone since name file was found. name := strings.TrimSpace(string(nameBytes)) diff --git a/sysfs/class_scsitape.go b/sysfs/class_scsitape.go index b2d4ba584..7355d64a8 100644 --- a/sysfs/class_scsitape.go +++ b/sysfs/class_scsitape.go @@ -18,7 +18,7 @@ package sysfs import ( "fmt" - "io/ioutil" + "os" "path/filepath" "regexp" @@ -51,7 +51,7 @@ type SCSITapeClass map[string]SCSITape func (fs FS) SCSITapeClass() (SCSITapeClass, error) { path := fs.sys.Path(scsiTapeClassPath) - dirs, err := ioutil.ReadDir(path) + dirs, err := os.ReadDir(path) if err != nil { return nil, err } @@ -95,7 +95,7 @@ func parseSCSITapeStatistics(tapePath string) (*SCSITapeCounters, error) { var counters SCSITapeCounters path := filepath.Join(tapePath, "stats") - files, err := ioutil.ReadDir(path) + files, err := os.ReadDir(path) if err != nil { return nil, err } diff --git a/sysfs/net_class.go b/sysfs/net_class.go index 940b4e451..364906ecb 100644 --- a/sysfs/net_class.go +++ b/sysfs/net_class.go @@ -18,7 +18,6 @@ package sysfs import ( "fmt" - "io/ioutil" "os" "path/filepath" @@ -68,13 +67,13 @@ func (fs FS) NetClassDevices() ([]string, error) { var res []string path := fs.sys.Path(netclassPath) - devices, err := ioutil.ReadDir(path) + devices, err := os.ReadDir(path) if err != nil { return res, fmt.Errorf("cannot access dir %q: %w", path, err) } for _, deviceDir := range devices { - if deviceDir.Mode().IsRegular() { + if deviceDir.Type().IsRegular() { continue } res = append(res, deviceDir.Name()) @@ -122,13 +121,13 @@ func (fs FS) NetClass() (NetClass, error) { func parseNetClassIface(devicePath string) (*NetClassIface, error) { interfaceClass := NetClassIface{} - files, err := ioutil.ReadDir(devicePath) + files, err := os.ReadDir(devicePath) if err != nil { return nil, err } for _, f := range files { - if !f.Mode().IsRegular() { + if !f.Type().IsRegular() { continue } name := filepath.Join(devicePath, f.Name()) diff --git a/sysfs/system_cpu.go b/sysfs/system_cpu.go index ed975ba72..b369568a0 100644 --- a/sysfs/system_cpu.go +++ b/sysfs/system_cpu.go @@ -18,7 +18,6 @@ package sysfs import ( "fmt" - "io/ioutil" "os" "path/filepath" "strconv" @@ -243,7 +242,7 @@ func parseCpufreqCpuinfo(cpuPath string) (*SystemCPUCpufreqStats, error) { } func (fs FS) IsolatedCPUs() ([]uint16, error) { - isolcpus, err := ioutil.ReadFile(fs.sys.Path("devices/system/cpu/isolated")) + isolcpus, err := os.ReadFile(fs.sys.Path("devices/system/cpu/isolated")) if err != nil { return nil, err } diff --git a/sysfs/vulnerability.go b/sysfs/vulnerability.go index 721948faf..87e701602 100644 --- a/sysfs/vulnerability.go +++ b/sysfs/vulnerability.go @@ -18,7 +18,7 @@ package sysfs import ( "fmt" - "io/ioutil" + "os" "path/filepath" "strings" ) @@ -40,7 +40,7 @@ func (fs FS) CPUVulnerabilities() ([]Vulnerability, error) { for _, match := range matches { name := filepath.Base(match) - value, err := ioutil.ReadFile(match) + value, err := os.ReadFile(match) if err != nil { return nil, err } diff --git a/vm.go b/vm.go index a03768a6f..20ceb77e2 100644 --- a/vm.go +++ b/vm.go @@ -18,7 +18,6 @@ package procfs import ( "fmt" - "io/ioutil" "os" "path/filepath" "strings" @@ -88,7 +87,7 @@ func (fs FS) VM() (*VM, error) { return nil, fmt.Errorf("%s is not a directory", path) } - files, err := ioutil.ReadDir(path) + files, err := os.ReadDir(path) if err != nil { return nil, err } diff --git a/zoneinfo.go b/zoneinfo.go index 33ddf6838..c745a4c04 100644 --- a/zoneinfo.go +++ b/zoneinfo.go @@ -19,7 +19,7 @@ package procfs import ( "bytes" "fmt" - "io/ioutil" + "os" "regexp" "strings" @@ -73,7 +73,7 @@ var nodeZoneRE = regexp.MustCompile(`(\d+), zone\s+(\w+)`) // structs containing the relevant info. More information available here: // https://www.kernel.org/doc/Documentation/sysctl/vm.txt func (fs FS) Zoneinfo() ([]Zoneinfo, error) { - data, err := ioutil.ReadFile(fs.proc.Path("zoneinfo")) + data, err := os.ReadFile(fs.proc.Path("zoneinfo")) if err != nil { return nil, fmt.Errorf("error reading zoneinfo %q: %w", fs.proc.Path("zoneinfo"), err) } From f74c35e702150a29f3fb08221699d9466ddb7cb7 Mon Sep 17 00:00:00 2001 From: anguswilliams Date: Tue, 21 Jun 2022 11:02:51 +1200 Subject: [PATCH 031/176] Bump max buffer size to 1024kb to handle larger mountinfo files Signed-off-by: anguswilliams --- internal/util/readfile.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/util/readfile.go b/internal/util/readfile.go index 1e9c1fbfa..71b7a70eb 100644 --- a/internal/util/readfile.go +++ b/internal/util/readfile.go @@ -21,10 +21,10 @@ import ( // ReadFileNoStat uses io.ReadAll to read contents of entire file. // This is similar to os.ReadFile but without the call to os.Stat, because // many files in /proc and /sys report incorrect file sizes (either 0 or 4096). -// Reads a max file size of 512kB. For files larger than this, a scanner +// Reads a max file size of 1024kB. For files larger than this, a scanner // should be used. func ReadFileNoStat(filename string) ([]byte, error) { - const maxBufferSize = 1024 * 512 + const maxBufferSize = 1024 * 1024 f, err := os.Open(filename) if err != nil { From c66e798b9747108851db2cb03f932a67c6ebd5ee Mon Sep 17 00:00:00 2001 From: peter wang Date: Mon, 18 Jul 2022 00:22:07 +0800 Subject: [PATCH 032/176] add processor field for /proc/[pid]/stat Signed-off-by: peter wang --- proc_stat.go | 4 +++- proc_stat_test.go | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/proc_stat.go b/proc_stat.go index 06c556ef9..b278eb2c2 100644 --- a/proc_stat.go +++ b/proc_stat.go @@ -102,6 +102,8 @@ type ProcStat struct { RSS int // Soft limit in bytes on the rss of the process. RSSLimit uint64 + // CPU number last executed on. + Processor uint // Real-time scheduling priority, a number in the range 1 to 99 for processes // scheduled under a real-time policy, or 0, for non-real-time processes. RTPriority uint @@ -184,7 +186,7 @@ func (p Proc) Stat() (ProcStat, error) { &ignoreUint64, &ignoreUint64, &ignoreInt64, - &ignoreInt64, + &s.Processor, &s.RTPriority, &s.Policy, &s.DelayAcctBlkIOTicks, diff --git a/proc_stat_test.go b/proc_stat_test.go index 8be1e1318..8abd67f60 100644 --- a/proc_stat_test.go +++ b/proc_stat_test.go @@ -68,6 +68,7 @@ func TestProcStat(t *testing.T) { want uint have uint }{ + {name: "processor", want: 0, have: s.Processor}, {name: "rt_priority", want: 0, have: s.RTPriority}, {name: "policy", want: 0, have: s.Policy}, } { From 5039c8b3c9c76c614074e43a7e83e0ca7f158051 Mon Sep 17 00:00:00 2001 From: Johannes 'fish' Ziemke Date: Thu, 14 Jul 2022 18:03:06 +0200 Subject: [PATCH 033/176] Support sysreadfile on darwin Signed-off-by: Johannes Ziemke --- internal/util/sysreadfile.go | 5 +++-- internal/util/sysreadfile_compat.go | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/internal/util/sysreadfile.go b/internal/util/sysreadfile.go index bd6ea1ebd..1ab875cee 100644 --- a/internal/util/sysreadfile.go +++ b/internal/util/sysreadfile.go @@ -11,8 +11,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -//go:build linux && !appengine -// +build linux,!appengine +//go:build (linux || darwin) && !appengine +// +build linux darwin +// +build !appengine package util diff --git a/internal/util/sysreadfile_compat.go b/internal/util/sysreadfile_compat.go index 8702ab3b0..1d86f5e63 100644 --- a/internal/util/sysreadfile_compat.go +++ b/internal/util/sysreadfile_compat.go @@ -11,8 +11,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -//go:build (linux && appengine) || !linux -// +build linux,appengine !linux +//go:build (linux && appengine) || (!linux && !darwin) +// +build linux,appengine !linux,!darwin package util From 344b47c663a30bfb28ca622d488a1cb6c29d6244 Mon Sep 17 00:00:00 2001 From: Johannes 'fish' Ziemke Date: Thu, 14 Jul 2022 18:03:39 +0200 Subject: [PATCH 034/176] Add SysctlInts and SysctlStrings methods Signed-off-by: Johannes Ziemke --- proc_sys.go | 51 +++++++++++++++++++++++++ proc_sys_test.go | 84 ++++++++++++++++++++++++++++++++++++++++++ testdata/fixtures.ttar | 8 ++++ 3 files changed, 143 insertions(+) create mode 100644 proc_sys.go create mode 100644 proc_sys_test.go diff --git a/proc_sys.go b/proc_sys.go new file mode 100644 index 000000000..d46533ebf --- /dev/null +++ b/proc_sys.go @@ -0,0 +1,51 @@ +// Copyright 2022 The Prometheus Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package procfs + +import ( + "fmt" + "strings" + + "github.com/prometheus/procfs/internal/util" +) + +func sysctlToPath(sysctl string) string { + return strings.Replace(sysctl, ".", "/", -1) +} + +func (fs FS) SysctlStrings(sysctl string) ([]string, error) { + value, err := util.SysReadFile(fs.proc.Path("sys", sysctlToPath(sysctl))) + if err != nil { + return nil, err + } + return strings.Fields(value), nil + +} + +func (fs FS) SysctlInts(sysctl string) ([]int, error) { + fields, err := fs.SysctlStrings(sysctl) + if err != nil { + return nil, err + } + + values := make([]int, len(fields)) + for i, f := range fields { + vp := util.NewValueParser(f) + values[i] = vp.Int() + if err := vp.Err(); err != nil { + return nil, fmt.Errorf("field %d in sysctl %s is not a valid int: %w", i, sysctl, err) + } + } + return values, nil +} diff --git a/proc_sys_test.go b/proc_sys_test.go new file mode 100644 index 000000000..2f8b867be --- /dev/null +++ b/proc_sys_test.go @@ -0,0 +1,84 @@ +// Copyright 2022 The Prometheus Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package procfs + +import ( + "testing" + + "github.com/google/go-cmp/cmp" +) + +func TestSysctlInts(t *testing.T) { + fs := getProcFixtures(t) + + for _, tc := range []struct { + sysctl string + want []int + }{ + {"kernel.random.entropy_avail", []int{3943}}, + {"vm.lowmem_reserve_ratio", []int{256, 256, 32, 0, 0}}, + } { + t.Run(tc.sysctl, func(t *testing.T) { + got, err := fs.SysctlInts(tc.sysctl) + if err != nil { + t.Fatal(err) + } + if diff := cmp.Diff(tc.want, got); diff != "" { + t.Fatalf("unexpected syscall value(-want +got):\n%s", diff) + } + }) + } +} + +func TestSysctlStrings(t *testing.T) { + fs := getProcFixtures(t) + + for _, tc := range []struct { + sysctl string + want []string + }{ + {"kernel.seccomp.actions_avail", []string{"kill_process", "kill_thread", "trap", "errno", "trace", "log", "allow"}}, + } { + t.Run(tc.sysctl, func(t *testing.T) { + got, err := fs.SysctlStrings(tc.sysctl) + if err != nil { + t.Fatal(err) + } + if diff := cmp.Diff(tc.want, got); diff != "" { + t.Fatalf("unexpected syscall value(-want +got):\n%s", diff) + } + }) + } +} + +func TestSysctlIntsError(t *testing.T) { + fs := getProcFixtures(t) + + for _, tc := range []struct { + sysctl string + want string + }{ + {"kernel.seccomp.actions_avail", "field 0 in sysctl kernel.seccomp.actions_avail is not a valid int: strconv.ParseInt: parsing \"kill_process\": invalid syntax"}, + } { + t.Run(tc.sysctl, func(t *testing.T) { + _, err := fs.SysctlInts(tc.sysctl) + if err == nil { + t.Fatal("expected error") + } + if diff := cmp.Diff(tc.want, err.Error()); diff != "" { + t.Fatalf("unexpected syscall value(-want +got):\n%s", diff) + } + }) + } +} diff --git a/testdata/fixtures.ttar b/testdata/fixtures.ttar index bd25048a5..40b630739 100644 --- a/testdata/fixtures.ttar +++ b/testdata/fixtures.ttar @@ -2873,6 +2873,14 @@ Lines: 1 3072 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/proc/sys/kernel/seccomp +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/proc/sys/kernel/seccomp/actions_avail +Lines: 1 +kill_process kill_thread trap errno trace log allow +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: fixtures/proc/sys/vm Mode: 775 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - From aa41d1a6eb3b1c65064ca1ef27b7ba74f50c7d0f Mon Sep 17 00:00:00 2001 From: stevenpackardblp <77253966+stevenpackardblp@users.noreply.github.com> Date: Wed, 24 Aug 2022 10:58:44 -0400 Subject: [PATCH 035/176] Fix grammar error Remove an extra 'the' from the sentence. Signed-off-by: stevenpackardblp <77253966+stevenpackardblp@users.noreply.github.com> --- proc_cgroup.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proc_cgroup.go b/proc_cgroup.go index cca03327c..ea83a75ff 100644 --- a/proc_cgroup.go +++ b/proc_cgroup.go @@ -23,7 +23,7 @@ import ( "github.com/prometheus/procfs/internal/util" ) -// Cgroup models one line from /proc/[pid]/cgroup. Each Cgroup struct describes the the placement of a PID inside a +// Cgroup models one line from /proc/[pid]/cgroup. Each Cgroup struct describes the placement of a PID inside a // specific control hierarchy. The kernel has two cgroup APIs, v1 and v2. v1 has one hierarchy per available resource // controller, while v2 has one unified hierarchy shared by all controllers. Regardless of v1 or v2, all hierarchies // contain all running processes, so the question answerable with a Cgroup struct is 'where is this process in From 6f02dd1b17c7ba4e2e2862643429e5f9183f12be Mon Sep 17 00:00:00 2001 From: Nikos Kakavas Date: Sat, 24 Sep 2022 17:28:15 +0300 Subject: [PATCH 036/176] Replace float64 with *float64 for proc_netstat, proc_snmp and proc_snmp6 (#464) Signed-off-by: Nikos Kakavas Signed-off-by: Nikos Kakavas --- proc_netstat.go | 482 +++++++++++++++++++++---------------------- proc_netstat_test.go | 14 +- proc_snmp.go | 318 ++++++++++++++-------------- proc_snmp6.go | 364 ++++++++++++++++---------------- proc_snmp6_test.go | 14 +- proc_snmp_test.go | 22 +- 6 files changed, 607 insertions(+), 607 deletions(-) diff --git a/proc_netstat.go b/proc_netstat.go index 48b523819..a978c3b9e 100644 --- a/proc_netstat.go +++ b/proc_netstat.go @@ -33,139 +33,139 @@ type ProcNetstat struct { } type TcpExt struct { // nolint:revive - SyncookiesSent float64 - SyncookiesRecv float64 - SyncookiesFailed float64 - EmbryonicRsts float64 - PruneCalled float64 - RcvPruned float64 - OfoPruned float64 - OutOfWindowIcmps float64 - LockDroppedIcmps float64 - ArpFilter float64 - TW float64 - TWRecycled float64 - TWKilled float64 - PAWSActive float64 - PAWSEstab float64 - DelayedACKs float64 - DelayedACKLocked float64 - DelayedACKLost float64 - ListenOverflows float64 - ListenDrops float64 - TCPHPHits float64 - TCPPureAcks float64 - TCPHPAcks float64 - TCPRenoRecovery float64 - TCPSackRecovery float64 - TCPSACKReneging float64 - TCPSACKReorder float64 - TCPRenoReorder float64 - TCPTSReorder float64 - TCPFullUndo float64 - TCPPartialUndo float64 - TCPDSACKUndo float64 - TCPLossUndo float64 - TCPLostRetransmit float64 - TCPRenoFailures float64 - TCPSackFailures float64 - TCPLossFailures float64 - TCPFastRetrans float64 - TCPSlowStartRetrans float64 - TCPTimeouts float64 - TCPLossProbes float64 - TCPLossProbeRecovery float64 - TCPRenoRecoveryFail float64 - TCPSackRecoveryFail float64 - TCPRcvCollapsed float64 - TCPDSACKOldSent float64 - TCPDSACKOfoSent float64 - TCPDSACKRecv float64 - TCPDSACKOfoRecv float64 - TCPAbortOnData float64 - TCPAbortOnClose float64 - TCPAbortOnMemory float64 - TCPAbortOnTimeout float64 - TCPAbortOnLinger float64 - TCPAbortFailed float64 - TCPMemoryPressures float64 - TCPMemoryPressuresChrono float64 - TCPSACKDiscard float64 - TCPDSACKIgnoredOld float64 - TCPDSACKIgnoredNoUndo float64 - TCPSpuriousRTOs float64 - TCPMD5NotFound float64 - TCPMD5Unexpected float64 - TCPMD5Failure float64 - TCPSackShifted float64 - TCPSackMerged float64 - TCPSackShiftFallback float64 - TCPBacklogDrop float64 - PFMemallocDrop float64 - TCPMinTTLDrop float64 - TCPDeferAcceptDrop float64 - IPReversePathFilter float64 - TCPTimeWaitOverflow float64 - TCPReqQFullDoCookies float64 - TCPReqQFullDrop float64 - TCPRetransFail float64 - TCPRcvCoalesce float64 - TCPOFOQueue float64 - TCPOFODrop float64 - TCPOFOMerge float64 - TCPChallengeACK float64 - TCPSYNChallenge float64 - TCPFastOpenActive float64 - TCPFastOpenActiveFail float64 - TCPFastOpenPassive float64 - TCPFastOpenPassiveFail float64 - TCPFastOpenListenOverflow float64 - TCPFastOpenCookieReqd float64 - TCPFastOpenBlackhole float64 - TCPSpuriousRtxHostQueues float64 - BusyPollRxPackets float64 - TCPAutoCorking float64 - TCPFromZeroWindowAdv float64 - TCPToZeroWindowAdv float64 - TCPWantZeroWindowAdv float64 - TCPSynRetrans float64 - TCPOrigDataSent float64 - TCPHystartTrainDetect float64 - TCPHystartTrainCwnd float64 - TCPHystartDelayDetect float64 - TCPHystartDelayCwnd float64 - TCPACKSkippedSynRecv float64 - TCPACKSkippedPAWS float64 - TCPACKSkippedSeq float64 - TCPACKSkippedFinWait2 float64 - TCPACKSkippedTimeWait float64 - TCPACKSkippedChallenge float64 - TCPWinProbe float64 - TCPKeepAlive float64 - TCPMTUPFail float64 - TCPMTUPSuccess float64 - TCPWqueueTooBig float64 + SyncookiesSent *float64 + SyncookiesRecv *float64 + SyncookiesFailed *float64 + EmbryonicRsts *float64 + PruneCalled *float64 + RcvPruned *float64 + OfoPruned *float64 + OutOfWindowIcmps *float64 + LockDroppedIcmps *float64 + ArpFilter *float64 + TW *float64 + TWRecycled *float64 + TWKilled *float64 + PAWSActive *float64 + PAWSEstab *float64 + DelayedACKs *float64 + DelayedACKLocked *float64 + DelayedACKLost *float64 + ListenOverflows *float64 + ListenDrops *float64 + TCPHPHits *float64 + TCPPureAcks *float64 + TCPHPAcks *float64 + TCPRenoRecovery *float64 + TCPSackRecovery *float64 + TCPSACKReneging *float64 + TCPSACKReorder *float64 + TCPRenoReorder *float64 + TCPTSReorder *float64 + TCPFullUndo *float64 + TCPPartialUndo *float64 + TCPDSACKUndo *float64 + TCPLossUndo *float64 + TCPLostRetransmit *float64 + TCPRenoFailures *float64 + TCPSackFailures *float64 + TCPLossFailures *float64 + TCPFastRetrans *float64 + TCPSlowStartRetrans *float64 + TCPTimeouts *float64 + TCPLossProbes *float64 + TCPLossProbeRecovery *float64 + TCPRenoRecoveryFail *float64 + TCPSackRecoveryFail *float64 + TCPRcvCollapsed *float64 + TCPDSACKOldSent *float64 + TCPDSACKOfoSent *float64 + TCPDSACKRecv *float64 + TCPDSACKOfoRecv *float64 + TCPAbortOnData *float64 + TCPAbortOnClose *float64 + TCPAbortOnMemory *float64 + TCPAbortOnTimeout *float64 + TCPAbortOnLinger *float64 + TCPAbortFailed *float64 + TCPMemoryPressures *float64 + TCPMemoryPressuresChrono *float64 + TCPSACKDiscard *float64 + TCPDSACKIgnoredOld *float64 + TCPDSACKIgnoredNoUndo *float64 + TCPSpuriousRTOs *float64 + TCPMD5NotFound *float64 + TCPMD5Unexpected *float64 + TCPMD5Failure *float64 + TCPSackShifted *float64 + TCPSackMerged *float64 + TCPSackShiftFallback *float64 + TCPBacklogDrop *float64 + PFMemallocDrop *float64 + TCPMinTTLDrop *float64 + TCPDeferAcceptDrop *float64 + IPReversePathFilter *float64 + TCPTimeWaitOverflow *float64 + TCPReqQFullDoCookies *float64 + TCPReqQFullDrop *float64 + TCPRetransFail *float64 + TCPRcvCoalesce *float64 + TCPOFOQueue *float64 + TCPOFODrop *float64 + TCPOFOMerge *float64 + TCPChallengeACK *float64 + TCPSYNChallenge *float64 + TCPFastOpenActive *float64 + TCPFastOpenActiveFail *float64 + TCPFastOpenPassive *float64 + TCPFastOpenPassiveFail *float64 + TCPFastOpenListenOverflow *float64 + TCPFastOpenCookieReqd *float64 + TCPFastOpenBlackhole *float64 + TCPSpuriousRtxHostQueues *float64 + BusyPollRxPackets *float64 + TCPAutoCorking *float64 + TCPFromZeroWindowAdv *float64 + TCPToZeroWindowAdv *float64 + TCPWantZeroWindowAdv *float64 + TCPSynRetrans *float64 + TCPOrigDataSent *float64 + TCPHystartTrainDetect *float64 + TCPHystartTrainCwnd *float64 + TCPHystartDelayDetect *float64 + TCPHystartDelayCwnd *float64 + TCPACKSkippedSynRecv *float64 + TCPACKSkippedPAWS *float64 + TCPACKSkippedSeq *float64 + TCPACKSkippedFinWait2 *float64 + TCPACKSkippedTimeWait *float64 + TCPACKSkippedChallenge *float64 + TCPWinProbe *float64 + TCPKeepAlive *float64 + TCPMTUPFail *float64 + TCPMTUPSuccess *float64 + TCPWqueueTooBig *float64 } type IpExt struct { // nolint:revive - InNoRoutes float64 - InTruncatedPkts float64 - InMcastPkts float64 - OutMcastPkts float64 - InBcastPkts float64 - OutBcastPkts float64 - InOctets float64 - OutOctets float64 - InMcastOctets float64 - OutMcastOctets float64 - InBcastOctets float64 - OutBcastOctets float64 - InCsumErrors float64 - InNoECTPkts float64 - InECT1Pkts float64 - InECT0Pkts float64 - InCEPkts float64 - ReasmOverlaps float64 + InNoRoutes *float64 + InTruncatedPkts *float64 + InMcastPkts *float64 + OutMcastPkts *float64 + InBcastPkts *float64 + OutBcastPkts *float64 + InOctets *float64 + OutOctets *float64 + InMcastOctets *float64 + OutMcastOctets *float64 + InBcastOctets *float64 + OutBcastOctets *float64 + InCsumErrors *float64 + InNoECTPkts *float64 + InECT1Pkts *float64 + InECT0Pkts *float64 + InCEPkts *float64 + ReasmOverlaps *float64 } func (p Proc) Netstat() (ProcNetstat, error) { @@ -208,230 +208,230 @@ func parseNetstat(r io.Reader, fileName string) (ProcNetstat, error) { case "TcpExt": switch key { case "SyncookiesSent": - procNetstat.TcpExt.SyncookiesSent = value + procNetstat.TcpExt.SyncookiesSent = &value case "SyncookiesRecv": - procNetstat.TcpExt.SyncookiesRecv = value + procNetstat.TcpExt.SyncookiesRecv = &value case "SyncookiesFailed": - procNetstat.TcpExt.SyncookiesFailed = value + procNetstat.TcpExt.SyncookiesFailed = &value case "EmbryonicRsts": - procNetstat.TcpExt.EmbryonicRsts = value + procNetstat.TcpExt.EmbryonicRsts = &value case "PruneCalled": - procNetstat.TcpExt.PruneCalled = value + procNetstat.TcpExt.PruneCalled = &value case "RcvPruned": - procNetstat.TcpExt.RcvPruned = value + procNetstat.TcpExt.RcvPruned = &value case "OfoPruned": - procNetstat.TcpExt.OfoPruned = value + procNetstat.TcpExt.OfoPruned = &value case "OutOfWindowIcmps": - procNetstat.TcpExt.OutOfWindowIcmps = value + procNetstat.TcpExt.OutOfWindowIcmps = &value case "LockDroppedIcmps": - procNetstat.TcpExt.LockDroppedIcmps = value + procNetstat.TcpExt.LockDroppedIcmps = &value case "ArpFilter": - procNetstat.TcpExt.ArpFilter = value + procNetstat.TcpExt.ArpFilter = &value case "TW": - procNetstat.TcpExt.TW = value + procNetstat.TcpExt.TW = &value case "TWRecycled": - procNetstat.TcpExt.TWRecycled = value + procNetstat.TcpExt.TWRecycled = &value case "TWKilled": - procNetstat.TcpExt.TWKilled = value + procNetstat.TcpExt.TWKilled = &value case "PAWSActive": - procNetstat.TcpExt.PAWSActive = value + procNetstat.TcpExt.PAWSActive = &value case "PAWSEstab": - procNetstat.TcpExt.PAWSEstab = value + procNetstat.TcpExt.PAWSEstab = &value case "DelayedACKs": - procNetstat.TcpExt.DelayedACKs = value + procNetstat.TcpExt.DelayedACKs = &value case "DelayedACKLocked": - procNetstat.TcpExt.DelayedACKLocked = value + procNetstat.TcpExt.DelayedACKLocked = &value case "DelayedACKLost": - procNetstat.TcpExt.DelayedACKLost = value + procNetstat.TcpExt.DelayedACKLost = &value case "ListenOverflows": - procNetstat.TcpExt.ListenOverflows = value + procNetstat.TcpExt.ListenOverflows = &value case "ListenDrops": - procNetstat.TcpExt.ListenDrops = value + procNetstat.TcpExt.ListenDrops = &value case "TCPHPHits": - procNetstat.TcpExt.TCPHPHits = value + procNetstat.TcpExt.TCPHPHits = &value case "TCPPureAcks": - procNetstat.TcpExt.TCPPureAcks = value + procNetstat.TcpExt.TCPPureAcks = &value case "TCPHPAcks": - procNetstat.TcpExt.TCPHPAcks = value + procNetstat.TcpExt.TCPHPAcks = &value case "TCPRenoRecovery": - procNetstat.TcpExt.TCPRenoRecovery = value + procNetstat.TcpExt.TCPRenoRecovery = &value case "TCPSackRecovery": - procNetstat.TcpExt.TCPSackRecovery = value + procNetstat.TcpExt.TCPSackRecovery = &value case "TCPSACKReneging": - procNetstat.TcpExt.TCPSACKReneging = value + procNetstat.TcpExt.TCPSACKReneging = &value case "TCPSACKReorder": - procNetstat.TcpExt.TCPSACKReorder = value + procNetstat.TcpExt.TCPSACKReorder = &value case "TCPRenoReorder": - procNetstat.TcpExt.TCPRenoReorder = value + procNetstat.TcpExt.TCPRenoReorder = &value case "TCPTSReorder": - procNetstat.TcpExt.TCPTSReorder = value + procNetstat.TcpExt.TCPTSReorder = &value case "TCPFullUndo": - procNetstat.TcpExt.TCPFullUndo = value + procNetstat.TcpExt.TCPFullUndo = &value case "TCPPartialUndo": - procNetstat.TcpExt.TCPPartialUndo = value + procNetstat.TcpExt.TCPPartialUndo = &value case "TCPDSACKUndo": - procNetstat.TcpExt.TCPDSACKUndo = value + procNetstat.TcpExt.TCPDSACKUndo = &value case "TCPLossUndo": - procNetstat.TcpExt.TCPLossUndo = value + procNetstat.TcpExt.TCPLossUndo = &value case "TCPLostRetransmit": - procNetstat.TcpExt.TCPLostRetransmit = value + procNetstat.TcpExt.TCPLostRetransmit = &value case "TCPRenoFailures": - procNetstat.TcpExt.TCPRenoFailures = value + procNetstat.TcpExt.TCPRenoFailures = &value case "TCPSackFailures": - procNetstat.TcpExt.TCPSackFailures = value + procNetstat.TcpExt.TCPSackFailures = &value case "TCPLossFailures": - procNetstat.TcpExt.TCPLossFailures = value + procNetstat.TcpExt.TCPLossFailures = &value case "TCPFastRetrans": - procNetstat.TcpExt.TCPFastRetrans = value + procNetstat.TcpExt.TCPFastRetrans = &value case "TCPSlowStartRetrans": - procNetstat.TcpExt.TCPSlowStartRetrans = value + procNetstat.TcpExt.TCPSlowStartRetrans = &value case "TCPTimeouts": - procNetstat.TcpExt.TCPTimeouts = value + procNetstat.TcpExt.TCPTimeouts = &value case "TCPLossProbes": - procNetstat.TcpExt.TCPLossProbes = value + procNetstat.TcpExt.TCPLossProbes = &value case "TCPLossProbeRecovery": - procNetstat.TcpExt.TCPLossProbeRecovery = value + procNetstat.TcpExt.TCPLossProbeRecovery = &value case "TCPRenoRecoveryFail": - procNetstat.TcpExt.TCPRenoRecoveryFail = value + procNetstat.TcpExt.TCPRenoRecoveryFail = &value case "TCPSackRecoveryFail": - procNetstat.TcpExt.TCPSackRecoveryFail = value + procNetstat.TcpExt.TCPSackRecoveryFail = &value case "TCPRcvCollapsed": - procNetstat.TcpExt.TCPRcvCollapsed = value + procNetstat.TcpExt.TCPRcvCollapsed = &value case "TCPDSACKOldSent": - procNetstat.TcpExt.TCPDSACKOldSent = value + procNetstat.TcpExt.TCPDSACKOldSent = &value case "TCPDSACKOfoSent": - procNetstat.TcpExt.TCPDSACKOfoSent = value + procNetstat.TcpExt.TCPDSACKOfoSent = &value case "TCPDSACKRecv": - procNetstat.TcpExt.TCPDSACKRecv = value + procNetstat.TcpExt.TCPDSACKRecv = &value case "TCPDSACKOfoRecv": - procNetstat.TcpExt.TCPDSACKOfoRecv = value + procNetstat.TcpExt.TCPDSACKOfoRecv = &value case "TCPAbortOnData": - procNetstat.TcpExt.TCPAbortOnData = value + procNetstat.TcpExt.TCPAbortOnData = &value case "TCPAbortOnClose": - procNetstat.TcpExt.TCPAbortOnClose = value + procNetstat.TcpExt.TCPAbortOnClose = &value case "TCPDeferAcceptDrop": - procNetstat.TcpExt.TCPDeferAcceptDrop = value + procNetstat.TcpExt.TCPDeferAcceptDrop = &value case "IPReversePathFilter": - procNetstat.TcpExt.IPReversePathFilter = value + procNetstat.TcpExt.IPReversePathFilter = &value case "TCPTimeWaitOverflow": - procNetstat.TcpExt.TCPTimeWaitOverflow = value + procNetstat.TcpExt.TCPTimeWaitOverflow = &value case "TCPReqQFullDoCookies": - procNetstat.TcpExt.TCPReqQFullDoCookies = value + procNetstat.TcpExt.TCPReqQFullDoCookies = &value case "TCPReqQFullDrop": - procNetstat.TcpExt.TCPReqQFullDrop = value + procNetstat.TcpExt.TCPReqQFullDrop = &value case "TCPRetransFail": - procNetstat.TcpExt.TCPRetransFail = value + procNetstat.TcpExt.TCPRetransFail = &value case "TCPRcvCoalesce": - procNetstat.TcpExt.TCPRcvCoalesce = value + procNetstat.TcpExt.TCPRcvCoalesce = &value case "TCPOFOQueue": - procNetstat.TcpExt.TCPOFOQueue = value + procNetstat.TcpExt.TCPOFOQueue = &value case "TCPOFODrop": - procNetstat.TcpExt.TCPOFODrop = value + procNetstat.TcpExt.TCPOFODrop = &value case "TCPOFOMerge": - procNetstat.TcpExt.TCPOFOMerge = value + procNetstat.TcpExt.TCPOFOMerge = &value case "TCPChallengeACK": - procNetstat.TcpExt.TCPChallengeACK = value + procNetstat.TcpExt.TCPChallengeACK = &value case "TCPSYNChallenge": - procNetstat.TcpExt.TCPSYNChallenge = value + procNetstat.TcpExt.TCPSYNChallenge = &value case "TCPFastOpenActive": - procNetstat.TcpExt.TCPFastOpenActive = value + procNetstat.TcpExt.TCPFastOpenActive = &value case "TCPFastOpenActiveFail": - procNetstat.TcpExt.TCPFastOpenActiveFail = value + procNetstat.TcpExt.TCPFastOpenActiveFail = &value case "TCPFastOpenPassive": - procNetstat.TcpExt.TCPFastOpenPassive = value + procNetstat.TcpExt.TCPFastOpenPassive = &value case "TCPFastOpenPassiveFail": - procNetstat.TcpExt.TCPFastOpenPassiveFail = value + procNetstat.TcpExt.TCPFastOpenPassiveFail = &value case "TCPFastOpenListenOverflow": - procNetstat.TcpExt.TCPFastOpenListenOverflow = value + procNetstat.TcpExt.TCPFastOpenListenOverflow = &value case "TCPFastOpenCookieReqd": - procNetstat.TcpExt.TCPFastOpenCookieReqd = value + procNetstat.TcpExt.TCPFastOpenCookieReqd = &value case "TCPFastOpenBlackhole": - procNetstat.TcpExt.TCPFastOpenBlackhole = value + procNetstat.TcpExt.TCPFastOpenBlackhole = &value case "TCPSpuriousRtxHostQueues": - procNetstat.TcpExt.TCPSpuriousRtxHostQueues = value + procNetstat.TcpExt.TCPSpuriousRtxHostQueues = &value case "BusyPollRxPackets": - procNetstat.TcpExt.BusyPollRxPackets = value + procNetstat.TcpExt.BusyPollRxPackets = &value case "TCPAutoCorking": - procNetstat.TcpExt.TCPAutoCorking = value + procNetstat.TcpExt.TCPAutoCorking = &value case "TCPFromZeroWindowAdv": - procNetstat.TcpExt.TCPFromZeroWindowAdv = value + procNetstat.TcpExt.TCPFromZeroWindowAdv = &value case "TCPToZeroWindowAdv": - procNetstat.TcpExt.TCPToZeroWindowAdv = value + procNetstat.TcpExt.TCPToZeroWindowAdv = &value case "TCPWantZeroWindowAdv": - procNetstat.TcpExt.TCPWantZeroWindowAdv = value + procNetstat.TcpExt.TCPWantZeroWindowAdv = &value case "TCPSynRetrans": - procNetstat.TcpExt.TCPSynRetrans = value + procNetstat.TcpExt.TCPSynRetrans = &value case "TCPOrigDataSent": - procNetstat.TcpExt.TCPOrigDataSent = value + procNetstat.TcpExt.TCPOrigDataSent = &value case "TCPHystartTrainDetect": - procNetstat.TcpExt.TCPHystartTrainDetect = value + procNetstat.TcpExt.TCPHystartTrainDetect = &value case "TCPHystartTrainCwnd": - procNetstat.TcpExt.TCPHystartTrainCwnd = value + procNetstat.TcpExt.TCPHystartTrainCwnd = &value case "TCPHystartDelayDetect": - procNetstat.TcpExt.TCPHystartDelayDetect = value + procNetstat.TcpExt.TCPHystartDelayDetect = &value case "TCPHystartDelayCwnd": - procNetstat.TcpExt.TCPHystartDelayCwnd = value + procNetstat.TcpExt.TCPHystartDelayCwnd = &value case "TCPACKSkippedSynRecv": - procNetstat.TcpExt.TCPACKSkippedSynRecv = value + procNetstat.TcpExt.TCPACKSkippedSynRecv = &value case "TCPACKSkippedPAWS": - procNetstat.TcpExt.TCPACKSkippedPAWS = value + procNetstat.TcpExt.TCPACKSkippedPAWS = &value case "TCPACKSkippedSeq": - procNetstat.TcpExt.TCPACKSkippedSeq = value + procNetstat.TcpExt.TCPACKSkippedSeq = &value case "TCPACKSkippedFinWait2": - procNetstat.TcpExt.TCPACKSkippedFinWait2 = value + procNetstat.TcpExt.TCPACKSkippedFinWait2 = &value case "TCPACKSkippedTimeWait": - procNetstat.TcpExt.TCPACKSkippedTimeWait = value + procNetstat.TcpExt.TCPACKSkippedTimeWait = &value case "TCPACKSkippedChallenge": - procNetstat.TcpExt.TCPACKSkippedChallenge = value + procNetstat.TcpExt.TCPACKSkippedChallenge = &value case "TCPWinProbe": - procNetstat.TcpExt.TCPWinProbe = value + procNetstat.TcpExt.TCPWinProbe = &value case "TCPKeepAlive": - procNetstat.TcpExt.TCPKeepAlive = value + procNetstat.TcpExt.TCPKeepAlive = &value case "TCPMTUPFail": - procNetstat.TcpExt.TCPMTUPFail = value + procNetstat.TcpExt.TCPMTUPFail = &value case "TCPMTUPSuccess": - procNetstat.TcpExt.TCPMTUPSuccess = value + procNetstat.TcpExt.TCPMTUPSuccess = &value case "TCPWqueueTooBig": - procNetstat.TcpExt.TCPWqueueTooBig = value + procNetstat.TcpExt.TCPWqueueTooBig = &value } case "IpExt": switch key { case "InNoRoutes": - procNetstat.IpExt.InNoRoutes = value + procNetstat.IpExt.InNoRoutes = &value case "InTruncatedPkts": - procNetstat.IpExt.InTruncatedPkts = value + procNetstat.IpExt.InTruncatedPkts = &value case "InMcastPkts": - procNetstat.IpExt.InMcastPkts = value + procNetstat.IpExt.InMcastPkts = &value case "OutMcastPkts": - procNetstat.IpExt.OutMcastPkts = value + procNetstat.IpExt.OutMcastPkts = &value case "InBcastPkts": - procNetstat.IpExt.InBcastPkts = value + procNetstat.IpExt.InBcastPkts = &value case "OutBcastPkts": - procNetstat.IpExt.OutBcastPkts = value + procNetstat.IpExt.OutBcastPkts = &value case "InOctets": - procNetstat.IpExt.InOctets = value + procNetstat.IpExt.InOctets = &value case "OutOctets": - procNetstat.IpExt.OutOctets = value + procNetstat.IpExt.OutOctets = &value case "InMcastOctets": - procNetstat.IpExt.InMcastOctets = value + procNetstat.IpExt.InMcastOctets = &value case "OutMcastOctets": - procNetstat.IpExt.OutMcastOctets = value + procNetstat.IpExt.OutMcastOctets = &value case "InBcastOctets": - procNetstat.IpExt.InBcastOctets = value + procNetstat.IpExt.InBcastOctets = &value case "OutBcastOctets": - procNetstat.IpExt.OutBcastOctets = value + procNetstat.IpExt.OutBcastOctets = &value case "InCsumErrors": - procNetstat.IpExt.InCsumErrors = value + procNetstat.IpExt.InCsumErrors = &value case "InNoECTPkts": - procNetstat.IpExt.InNoECTPkts = value + procNetstat.IpExt.InNoECTPkts = &value case "InECT1Pkts": - procNetstat.IpExt.InECT1Pkts = value + procNetstat.IpExt.InECT1Pkts = &value case "InECT0Pkts": - procNetstat.IpExt.InECT0Pkts = value + procNetstat.IpExt.InECT0Pkts = &value case "InCEPkts": - procNetstat.IpExt.InCEPkts = value + procNetstat.IpExt.InCEPkts = &value case "ReasmOverlaps": - procNetstat.IpExt.ReasmOverlaps = value + procNetstat.IpExt.ReasmOverlaps = &value } } } diff --git a/proc_netstat_test.go b/proc_netstat_test.go index 6cb9af270..a1d20a9a4 100644 --- a/proc_netstat_test.go +++ b/proc_netstat_test.go @@ -34,14 +34,14 @@ func TestProcNetstat(t *testing.T) { have float64 }{ {name: "pid", want: 26231, have: float64(procNetstat.PID)}, - {name: "TcpExt:SyncookiesSent", want: 0, have: procNetstat.TcpExt.SyncookiesSent}, - {name: "TcpExt:EmbryonicRsts", want: 1, have: procNetstat.TcpExt.EmbryonicRsts}, - {name: "TcpExt:TW", want: 83, have: procNetstat.TcpExt.TW}, - {name: "TcpExt:PAWSEstab", want: 3640, have: procNetstat.TcpExt.PAWSEstab}, + {name: "TcpExt:SyncookiesSent", want: 0, have: *procNetstat.TcpExt.SyncookiesSent}, + {name: "TcpExt:EmbryonicRsts", want: 1, have: *procNetstat.TcpExt.EmbryonicRsts}, + {name: "TcpExt:TW", want: 83, have: *procNetstat.TcpExt.TW}, + {name: "TcpExt:PAWSEstab", want: 3640, have: *procNetstat.TcpExt.PAWSEstab}, - {name: "IpExt:InNoRoutes", want: 0, have: procNetstat.IpExt.InNoRoutes}, - {name: "IpExt:InMcastPkts", want: 208, have: procNetstat.IpExt.InMcastPkts}, - {name: "IpExt:OutMcastPkts", want: 214, have: procNetstat.IpExt.OutMcastPkts}, + {name: "IpExt:InNoRoutes", want: 0, have: *procNetstat.IpExt.InNoRoutes}, + {name: "IpExt:InMcastPkts", want: 208, have: *procNetstat.IpExt.InMcastPkts}, + {name: "IpExt:OutMcastPkts", want: 214, have: *procNetstat.IpExt.OutMcastPkts}, } { if test.want != test.have { t.Errorf("want %s %f, have %f", test.name, test.want, test.have) diff --git a/proc_snmp.go b/proc_snmp.go index ae191896c..6c46b7188 100644 --- a/proc_snmp.go +++ b/proc_snmp.go @@ -37,100 +37,100 @@ type ProcSnmp struct { } type Ip struct { // nolint:revive - Forwarding float64 - DefaultTTL float64 - InReceives float64 - InHdrErrors float64 - InAddrErrors float64 - ForwDatagrams float64 - InUnknownProtos float64 - InDiscards float64 - InDelivers float64 - OutRequests float64 - OutDiscards float64 - OutNoRoutes float64 - ReasmTimeout float64 - ReasmReqds float64 - ReasmOKs float64 - ReasmFails float64 - FragOKs float64 - FragFails float64 - FragCreates float64 + Forwarding *float64 + DefaultTTL *float64 + InReceives *float64 + InHdrErrors *float64 + InAddrErrors *float64 + ForwDatagrams *float64 + InUnknownProtos *float64 + InDiscards *float64 + InDelivers *float64 + OutRequests *float64 + OutDiscards *float64 + OutNoRoutes *float64 + ReasmTimeout *float64 + ReasmReqds *float64 + ReasmOKs *float64 + ReasmFails *float64 + FragOKs *float64 + FragFails *float64 + FragCreates *float64 } -type Icmp struct { - InMsgs float64 - InErrors float64 - InCsumErrors float64 - InDestUnreachs float64 - InTimeExcds float64 - InParmProbs float64 - InSrcQuenchs float64 - InRedirects float64 - InEchos float64 - InEchoReps float64 - InTimestamps float64 - InTimestampReps float64 - InAddrMasks float64 - InAddrMaskReps float64 - OutMsgs float64 - OutErrors float64 - OutDestUnreachs float64 - OutTimeExcds float64 - OutParmProbs float64 - OutSrcQuenchs float64 - OutRedirects float64 - OutEchos float64 - OutEchoReps float64 - OutTimestamps float64 - OutTimestampReps float64 - OutAddrMasks float64 - OutAddrMaskReps float64 +type Icmp struct { // nolint:revive + InMsgs *float64 + InErrors *float64 + InCsumErrors *float64 + InDestUnreachs *float64 + InTimeExcds *float64 + InParmProbs *float64 + InSrcQuenchs *float64 + InRedirects *float64 + InEchos *float64 + InEchoReps *float64 + InTimestamps *float64 + InTimestampReps *float64 + InAddrMasks *float64 + InAddrMaskReps *float64 + OutMsgs *float64 + OutErrors *float64 + OutDestUnreachs *float64 + OutTimeExcds *float64 + OutParmProbs *float64 + OutSrcQuenchs *float64 + OutRedirects *float64 + OutEchos *float64 + OutEchoReps *float64 + OutTimestamps *float64 + OutTimestampReps *float64 + OutAddrMasks *float64 + OutAddrMaskReps *float64 } type IcmpMsg struct { - InType3 float64 - OutType3 float64 + InType3 *float64 + OutType3 *float64 } type Tcp struct { // nolint:revive - RtoAlgorithm float64 - RtoMin float64 - RtoMax float64 - MaxConn float64 - ActiveOpens float64 - PassiveOpens float64 - AttemptFails float64 - EstabResets float64 - CurrEstab float64 - InSegs float64 - OutSegs float64 - RetransSegs float64 - InErrs float64 - OutRsts float64 - InCsumErrors float64 + RtoAlgorithm *float64 + RtoMin *float64 + RtoMax *float64 + MaxConn *float64 + ActiveOpens *float64 + PassiveOpens *float64 + AttemptFails *float64 + EstabResets *float64 + CurrEstab *float64 + InSegs *float64 + OutSegs *float64 + RetransSegs *float64 + InErrs *float64 + OutRsts *float64 + InCsumErrors *float64 } type Udp struct { // nolint:revive - InDatagrams float64 - NoPorts float64 - InErrors float64 - OutDatagrams float64 - RcvbufErrors float64 - SndbufErrors float64 - InCsumErrors float64 - IgnoredMulti float64 + InDatagrams *float64 + NoPorts *float64 + InErrors *float64 + OutDatagrams *float64 + RcvbufErrors *float64 + SndbufErrors *float64 + InCsumErrors *float64 + IgnoredMulti *float64 } type UdpLite struct { // nolint:revive - InDatagrams float64 - NoPorts float64 - InErrors float64 - OutDatagrams float64 - RcvbufErrors float64 - SndbufErrors float64 - InCsumErrors float64 - IgnoredMulti float64 + InDatagrams *float64 + NoPorts *float64 + InErrors *float64 + OutDatagrams *float64 + RcvbufErrors *float64 + SndbufErrors *float64 + InCsumErrors *float64 + IgnoredMulti *float64 } func (p Proc) Snmp() (ProcSnmp, error) { @@ -173,178 +173,178 @@ func parseSnmp(r io.Reader, fileName string) (ProcSnmp, error) { case "Ip": switch key { case "Forwarding": - procSnmp.Ip.Forwarding = value + procSnmp.Ip.Forwarding = &value case "DefaultTTL": - procSnmp.Ip.DefaultTTL = value + procSnmp.Ip.DefaultTTL = &value case "InReceives": - procSnmp.Ip.InReceives = value + procSnmp.Ip.InReceives = &value case "InHdrErrors": - procSnmp.Ip.InHdrErrors = value + procSnmp.Ip.InHdrErrors = &value case "InAddrErrors": - procSnmp.Ip.InAddrErrors = value + procSnmp.Ip.InAddrErrors = &value case "ForwDatagrams": - procSnmp.Ip.ForwDatagrams = value + procSnmp.Ip.ForwDatagrams = &value case "InUnknownProtos": - procSnmp.Ip.InUnknownProtos = value + procSnmp.Ip.InUnknownProtos = &value case "InDiscards": - procSnmp.Ip.InDiscards = value + procSnmp.Ip.InDiscards = &value case "InDelivers": - procSnmp.Ip.InDelivers = value + procSnmp.Ip.InDelivers = &value case "OutRequests": - procSnmp.Ip.OutRequests = value + procSnmp.Ip.OutRequests = &value case "OutDiscards": - procSnmp.Ip.OutDiscards = value + procSnmp.Ip.OutDiscards = &value case "OutNoRoutes": - procSnmp.Ip.OutNoRoutes = value + procSnmp.Ip.OutNoRoutes = &value case "ReasmTimeout": - procSnmp.Ip.ReasmTimeout = value + procSnmp.Ip.ReasmTimeout = &value case "ReasmReqds": - procSnmp.Ip.ReasmReqds = value + procSnmp.Ip.ReasmReqds = &value case "ReasmOKs": - procSnmp.Ip.ReasmOKs = value + procSnmp.Ip.ReasmOKs = &value case "ReasmFails": - procSnmp.Ip.ReasmFails = value + procSnmp.Ip.ReasmFails = &value case "FragOKs": - procSnmp.Ip.FragOKs = value + procSnmp.Ip.FragOKs = &value case "FragFails": - procSnmp.Ip.FragFails = value + procSnmp.Ip.FragFails = &value case "FragCreates": - procSnmp.Ip.FragCreates = value + procSnmp.Ip.FragCreates = &value } case "Icmp": switch key { case "InMsgs": - procSnmp.Icmp.InMsgs = value + procSnmp.Icmp.InMsgs = &value case "InErrors": - procSnmp.Icmp.InErrors = value + procSnmp.Icmp.InErrors = &value case "InCsumErrors": - procSnmp.Icmp.InCsumErrors = value + procSnmp.Icmp.InCsumErrors = &value case "InDestUnreachs": - procSnmp.Icmp.InDestUnreachs = value + procSnmp.Icmp.InDestUnreachs = &value case "InTimeExcds": - procSnmp.Icmp.InTimeExcds = value + procSnmp.Icmp.InTimeExcds = &value case "InParmProbs": - procSnmp.Icmp.InParmProbs = value + procSnmp.Icmp.InParmProbs = &value case "InSrcQuenchs": - procSnmp.Icmp.InSrcQuenchs = value + procSnmp.Icmp.InSrcQuenchs = &value case "InRedirects": - procSnmp.Icmp.InRedirects = value + procSnmp.Icmp.InRedirects = &value case "InEchos": - procSnmp.Icmp.InEchos = value + procSnmp.Icmp.InEchos = &value case "InEchoReps": - procSnmp.Icmp.InEchoReps = value + procSnmp.Icmp.InEchoReps = &value case "InTimestamps": - procSnmp.Icmp.InTimestamps = value + procSnmp.Icmp.InTimestamps = &value case "InTimestampReps": - procSnmp.Icmp.InTimestampReps = value + procSnmp.Icmp.InTimestampReps = &value case "InAddrMasks": - procSnmp.Icmp.InAddrMasks = value + procSnmp.Icmp.InAddrMasks = &value case "InAddrMaskReps": - procSnmp.Icmp.InAddrMaskReps = value + procSnmp.Icmp.InAddrMaskReps = &value case "OutMsgs": - procSnmp.Icmp.OutMsgs = value + procSnmp.Icmp.OutMsgs = &value case "OutErrors": - procSnmp.Icmp.OutErrors = value + procSnmp.Icmp.OutErrors = &value case "OutDestUnreachs": - procSnmp.Icmp.OutDestUnreachs = value + procSnmp.Icmp.OutDestUnreachs = &value case "OutTimeExcds": - procSnmp.Icmp.OutTimeExcds = value + procSnmp.Icmp.OutTimeExcds = &value case "OutParmProbs": - procSnmp.Icmp.OutParmProbs = value + procSnmp.Icmp.OutParmProbs = &value case "OutSrcQuenchs": - procSnmp.Icmp.OutSrcQuenchs = value + procSnmp.Icmp.OutSrcQuenchs = &value case "OutRedirects": - procSnmp.Icmp.OutRedirects = value + procSnmp.Icmp.OutRedirects = &value case "OutEchos": - procSnmp.Icmp.OutEchos = value + procSnmp.Icmp.OutEchos = &value case "OutEchoReps": - procSnmp.Icmp.OutEchoReps = value + procSnmp.Icmp.OutEchoReps = &value case "OutTimestamps": - procSnmp.Icmp.OutTimestamps = value + procSnmp.Icmp.OutTimestamps = &value case "OutTimestampReps": - procSnmp.Icmp.OutTimestampReps = value + procSnmp.Icmp.OutTimestampReps = &value case "OutAddrMasks": - procSnmp.Icmp.OutAddrMasks = value + procSnmp.Icmp.OutAddrMasks = &value case "OutAddrMaskReps": - procSnmp.Icmp.OutAddrMaskReps = value + procSnmp.Icmp.OutAddrMaskReps = &value } case "IcmpMsg": switch key { case "InType3": - procSnmp.IcmpMsg.InType3 = value + procSnmp.IcmpMsg.InType3 = &value case "OutType3": - procSnmp.IcmpMsg.OutType3 = value + procSnmp.IcmpMsg.OutType3 = &value } case "Tcp": switch key { case "RtoAlgorithm": - procSnmp.Tcp.RtoAlgorithm = value + procSnmp.Tcp.RtoAlgorithm = &value case "RtoMin": - procSnmp.Tcp.RtoMin = value + procSnmp.Tcp.RtoMin = &value case "RtoMax": - procSnmp.Tcp.RtoMax = value + procSnmp.Tcp.RtoMax = &value case "MaxConn": - procSnmp.Tcp.MaxConn = value + procSnmp.Tcp.MaxConn = &value case "ActiveOpens": - procSnmp.Tcp.ActiveOpens = value + procSnmp.Tcp.ActiveOpens = &value case "PassiveOpens": - procSnmp.Tcp.PassiveOpens = value + procSnmp.Tcp.PassiveOpens = &value case "AttemptFails": - procSnmp.Tcp.AttemptFails = value + procSnmp.Tcp.AttemptFails = &value case "EstabResets": - procSnmp.Tcp.EstabResets = value + procSnmp.Tcp.EstabResets = &value case "CurrEstab": - procSnmp.Tcp.CurrEstab = value + procSnmp.Tcp.CurrEstab = &value case "InSegs": - procSnmp.Tcp.InSegs = value + procSnmp.Tcp.InSegs = &value case "OutSegs": - procSnmp.Tcp.OutSegs = value + procSnmp.Tcp.OutSegs = &value case "RetransSegs": - procSnmp.Tcp.RetransSegs = value + procSnmp.Tcp.RetransSegs = &value case "InErrs": - procSnmp.Tcp.InErrs = value + procSnmp.Tcp.InErrs = &value case "OutRsts": - procSnmp.Tcp.OutRsts = value + procSnmp.Tcp.OutRsts = &value case "InCsumErrors": - procSnmp.Tcp.InCsumErrors = value + procSnmp.Tcp.InCsumErrors = &value } case "Udp": switch key { case "InDatagrams": - procSnmp.Udp.InDatagrams = value + procSnmp.Udp.InDatagrams = &value case "NoPorts": - procSnmp.Udp.NoPorts = value + procSnmp.Udp.NoPorts = &value case "InErrors": - procSnmp.Udp.InErrors = value + procSnmp.Udp.InErrors = &value case "OutDatagrams": - procSnmp.Udp.OutDatagrams = value + procSnmp.Udp.OutDatagrams = &value case "RcvbufErrors": - procSnmp.Udp.RcvbufErrors = value + procSnmp.Udp.RcvbufErrors = &value case "SndbufErrors": - procSnmp.Udp.SndbufErrors = value + procSnmp.Udp.SndbufErrors = &value case "InCsumErrors": - procSnmp.Udp.InCsumErrors = value + procSnmp.Udp.InCsumErrors = &value case "IgnoredMulti": - procSnmp.Udp.IgnoredMulti = value + procSnmp.Udp.IgnoredMulti = &value } case "UdpLite": switch key { case "InDatagrams": - procSnmp.UdpLite.InDatagrams = value + procSnmp.UdpLite.InDatagrams = &value case "NoPorts": - procSnmp.UdpLite.NoPorts = value + procSnmp.UdpLite.NoPorts = &value case "InErrors": - procSnmp.UdpLite.InErrors = value + procSnmp.UdpLite.InErrors = &value case "OutDatagrams": - procSnmp.UdpLite.OutDatagrams = value + procSnmp.UdpLite.OutDatagrams = &value case "RcvbufErrors": - procSnmp.UdpLite.RcvbufErrors = value + procSnmp.UdpLite.RcvbufErrors = &value case "SndbufErrors": - procSnmp.UdpLite.SndbufErrors = value + procSnmp.UdpLite.SndbufErrors = &value case "InCsumErrors": - procSnmp.UdpLite.InCsumErrors = value + procSnmp.UdpLite.InCsumErrors = &value case "IgnoredMulti": - procSnmp.UdpLite.IgnoredMulti = value + procSnmp.UdpLite.IgnoredMulti = &value } } } diff --git a/proc_snmp6.go b/proc_snmp6.go index f611992d5..3059cc6a1 100644 --- a/proc_snmp6.go +++ b/proc_snmp6.go @@ -36,106 +36,106 @@ type ProcSnmp6 struct { } type Ip6 struct { // nolint:revive - InReceives float64 - InHdrErrors float64 - InTooBigErrors float64 - InNoRoutes float64 - InAddrErrors float64 - InUnknownProtos float64 - InTruncatedPkts float64 - InDiscards float64 - InDelivers float64 - OutForwDatagrams float64 - OutRequests float64 - OutDiscards float64 - OutNoRoutes float64 - ReasmTimeout float64 - ReasmReqds float64 - ReasmOKs float64 - ReasmFails float64 - FragOKs float64 - FragFails float64 - FragCreates float64 - InMcastPkts float64 - OutMcastPkts float64 - InOctets float64 - OutOctets float64 - InMcastOctets float64 - OutMcastOctets float64 - InBcastOctets float64 - OutBcastOctets float64 - InNoECTPkts float64 - InECT1Pkts float64 - InECT0Pkts float64 - InCEPkts float64 + InReceives *float64 + InHdrErrors *float64 + InTooBigErrors *float64 + InNoRoutes *float64 + InAddrErrors *float64 + InUnknownProtos *float64 + InTruncatedPkts *float64 + InDiscards *float64 + InDelivers *float64 + OutForwDatagrams *float64 + OutRequests *float64 + OutDiscards *float64 + OutNoRoutes *float64 + ReasmTimeout *float64 + ReasmReqds *float64 + ReasmOKs *float64 + ReasmFails *float64 + FragOKs *float64 + FragFails *float64 + FragCreates *float64 + InMcastPkts *float64 + OutMcastPkts *float64 + InOctets *float64 + OutOctets *float64 + InMcastOctets *float64 + OutMcastOctets *float64 + InBcastOctets *float64 + OutBcastOctets *float64 + InNoECTPkts *float64 + InECT1Pkts *float64 + InECT0Pkts *float64 + InCEPkts *float64 } type Icmp6 struct { - InMsgs float64 - InErrors float64 - OutMsgs float64 - OutErrors float64 - InCsumErrors float64 - InDestUnreachs float64 - InPktTooBigs float64 - InTimeExcds float64 - InParmProblems float64 - InEchos float64 - InEchoReplies float64 - InGroupMembQueries float64 - InGroupMembResponses float64 - InGroupMembReductions float64 - InRouterSolicits float64 - InRouterAdvertisements float64 - InNeighborSolicits float64 - InNeighborAdvertisements float64 - InRedirects float64 - InMLDv2Reports float64 - OutDestUnreachs float64 - OutPktTooBigs float64 - OutTimeExcds float64 - OutParmProblems float64 - OutEchos float64 - OutEchoReplies float64 - OutGroupMembQueries float64 - OutGroupMembResponses float64 - OutGroupMembReductions float64 - OutRouterSolicits float64 - OutRouterAdvertisements float64 - OutNeighborSolicits float64 - OutNeighborAdvertisements float64 - OutRedirects float64 - OutMLDv2Reports float64 - InType1 float64 - InType134 float64 - InType135 float64 - InType136 float64 - InType143 float64 - OutType133 float64 - OutType135 float64 - OutType136 float64 - OutType143 float64 + InMsgs *float64 + InErrors *float64 + OutMsgs *float64 + OutErrors *float64 + InCsumErrors *float64 + InDestUnreachs *float64 + InPktTooBigs *float64 + InTimeExcds *float64 + InParmProblems *float64 + InEchos *float64 + InEchoReplies *float64 + InGroupMembQueries *float64 + InGroupMembResponses *float64 + InGroupMembReductions *float64 + InRouterSolicits *float64 + InRouterAdvertisements *float64 + InNeighborSolicits *float64 + InNeighborAdvertisements *float64 + InRedirects *float64 + InMLDv2Reports *float64 + OutDestUnreachs *float64 + OutPktTooBigs *float64 + OutTimeExcds *float64 + OutParmProblems *float64 + OutEchos *float64 + OutEchoReplies *float64 + OutGroupMembQueries *float64 + OutGroupMembResponses *float64 + OutGroupMembReductions *float64 + OutRouterSolicits *float64 + OutRouterAdvertisements *float64 + OutNeighborSolicits *float64 + OutNeighborAdvertisements *float64 + OutRedirects *float64 + OutMLDv2Reports *float64 + InType1 *float64 + InType134 *float64 + InType135 *float64 + InType136 *float64 + InType143 *float64 + OutType133 *float64 + OutType135 *float64 + OutType136 *float64 + OutType143 *float64 } type Udp6 struct { // nolint:revive - InDatagrams float64 - NoPorts float64 - InErrors float64 - OutDatagrams float64 - RcvbufErrors float64 - SndbufErrors float64 - InCsumErrors float64 - IgnoredMulti float64 + InDatagrams *float64 + NoPorts *float64 + InErrors *float64 + OutDatagrams *float64 + RcvbufErrors *float64 + SndbufErrors *float64 + InCsumErrors *float64 + IgnoredMulti *float64 } type UdpLite6 struct { // nolint:revive - InDatagrams float64 - NoPorts float64 - InErrors float64 - OutDatagrams float64 - RcvbufErrors float64 - SndbufErrors float64 - InCsumErrors float64 + InDatagrams *float64 + NoPorts *float64 + InErrors *float64 + OutDatagrams *float64 + RcvbufErrors *float64 + SndbufErrors *float64 + InCsumErrors *float64 } func (p Proc) Snmp6() (ProcSnmp6, error) { @@ -182,197 +182,197 @@ func parseSNMP6Stats(r io.Reader) (ProcSnmp6, error) { case "Ip6": switch key { case "InReceives": - procSnmp6.Ip6.InReceives = value + procSnmp6.Ip6.InReceives = &value case "InHdrErrors": - procSnmp6.Ip6.InHdrErrors = value + procSnmp6.Ip6.InHdrErrors = &value case "InTooBigErrors": - procSnmp6.Ip6.InTooBigErrors = value + procSnmp6.Ip6.InTooBigErrors = &value case "InNoRoutes": - procSnmp6.Ip6.InNoRoutes = value + procSnmp6.Ip6.InNoRoutes = &value case "InAddrErrors": - procSnmp6.Ip6.InAddrErrors = value + procSnmp6.Ip6.InAddrErrors = &value case "InUnknownProtos": - procSnmp6.Ip6.InUnknownProtos = value + procSnmp6.Ip6.InUnknownProtos = &value case "InTruncatedPkts": - procSnmp6.Ip6.InTruncatedPkts = value + procSnmp6.Ip6.InTruncatedPkts = &value case "InDiscards": - procSnmp6.Ip6.InDiscards = value + procSnmp6.Ip6.InDiscards = &value case "InDelivers": - procSnmp6.Ip6.InDelivers = value + procSnmp6.Ip6.InDelivers = &value case "OutForwDatagrams": - procSnmp6.Ip6.OutForwDatagrams = value + procSnmp6.Ip6.OutForwDatagrams = &value case "OutRequests": - procSnmp6.Ip6.OutRequests = value + procSnmp6.Ip6.OutRequests = &value case "OutDiscards": - procSnmp6.Ip6.OutDiscards = value + procSnmp6.Ip6.OutDiscards = &value case "OutNoRoutes": - procSnmp6.Ip6.OutNoRoutes = value + procSnmp6.Ip6.OutNoRoutes = &value case "ReasmTimeout": - procSnmp6.Ip6.ReasmTimeout = value + procSnmp6.Ip6.ReasmTimeout = &value case "ReasmReqds": - procSnmp6.Ip6.ReasmReqds = value + procSnmp6.Ip6.ReasmReqds = &value case "ReasmOKs": - procSnmp6.Ip6.ReasmOKs = value + procSnmp6.Ip6.ReasmOKs = &value case "ReasmFails": - procSnmp6.Ip6.ReasmFails = value + procSnmp6.Ip6.ReasmFails = &value case "FragOKs": - procSnmp6.Ip6.FragOKs = value + procSnmp6.Ip6.FragOKs = &value case "FragFails": - procSnmp6.Ip6.FragFails = value + procSnmp6.Ip6.FragFails = &value case "FragCreates": - procSnmp6.Ip6.FragCreates = value + procSnmp6.Ip6.FragCreates = &value case "InMcastPkts": - procSnmp6.Ip6.InMcastPkts = value + procSnmp6.Ip6.InMcastPkts = &value case "OutMcastPkts": - procSnmp6.Ip6.OutMcastPkts = value + procSnmp6.Ip6.OutMcastPkts = &value case "InOctets": - procSnmp6.Ip6.InOctets = value + procSnmp6.Ip6.InOctets = &value case "OutOctets": - procSnmp6.Ip6.OutOctets = value + procSnmp6.Ip6.OutOctets = &value case "InMcastOctets": - procSnmp6.Ip6.InMcastOctets = value + procSnmp6.Ip6.InMcastOctets = &value case "OutMcastOctets": - procSnmp6.Ip6.OutMcastOctets = value + procSnmp6.Ip6.OutMcastOctets = &value case "InBcastOctets": - procSnmp6.Ip6.InBcastOctets = value + procSnmp6.Ip6.InBcastOctets = &value case "OutBcastOctets": - procSnmp6.Ip6.OutBcastOctets = value + procSnmp6.Ip6.OutBcastOctets = &value case "InNoECTPkts": - procSnmp6.Ip6.InNoECTPkts = value + procSnmp6.Ip6.InNoECTPkts = &value case "InECT1Pkts": - procSnmp6.Ip6.InECT1Pkts = value + procSnmp6.Ip6.InECT1Pkts = &value case "InECT0Pkts": - procSnmp6.Ip6.InECT0Pkts = value + procSnmp6.Ip6.InECT0Pkts = &value case "InCEPkts": - procSnmp6.Ip6.InCEPkts = value + procSnmp6.Ip6.InCEPkts = &value } case "Icmp6": switch key { case "InMsgs": - procSnmp6.Icmp6.InMsgs = value + procSnmp6.Icmp6.InMsgs = &value case "InErrors": - procSnmp6.Icmp6.InErrors = value + procSnmp6.Icmp6.InErrors = &value case "OutMsgs": - procSnmp6.Icmp6.OutMsgs = value + procSnmp6.Icmp6.OutMsgs = &value case "OutErrors": - procSnmp6.Icmp6.OutErrors = value + procSnmp6.Icmp6.OutErrors = &value case "InCsumErrors": - procSnmp6.Icmp6.InCsumErrors = value + procSnmp6.Icmp6.InCsumErrors = &value case "InDestUnreachs": - procSnmp6.Icmp6.InDestUnreachs = value + procSnmp6.Icmp6.InDestUnreachs = &value case "InPktTooBigs": - procSnmp6.Icmp6.InPktTooBigs = value + procSnmp6.Icmp6.InPktTooBigs = &value case "InTimeExcds": - procSnmp6.Icmp6.InTimeExcds = value + procSnmp6.Icmp6.InTimeExcds = &value case "InParmProblems": - procSnmp6.Icmp6.InParmProblems = value + procSnmp6.Icmp6.InParmProblems = &value case "InEchos": - procSnmp6.Icmp6.InEchos = value + procSnmp6.Icmp6.InEchos = &value case "InEchoReplies": - procSnmp6.Icmp6.InEchoReplies = value + procSnmp6.Icmp6.InEchoReplies = &value case "InGroupMembQueries": - procSnmp6.Icmp6.InGroupMembQueries = value + procSnmp6.Icmp6.InGroupMembQueries = &value case "InGroupMembResponses": - procSnmp6.Icmp6.InGroupMembResponses = value + procSnmp6.Icmp6.InGroupMembResponses = &value case "InGroupMembReductions": - procSnmp6.Icmp6.InGroupMembReductions = value + procSnmp6.Icmp6.InGroupMembReductions = &value case "InRouterSolicits": - procSnmp6.Icmp6.InRouterSolicits = value + procSnmp6.Icmp6.InRouterSolicits = &value case "InRouterAdvertisements": - procSnmp6.Icmp6.InRouterAdvertisements = value + procSnmp6.Icmp6.InRouterAdvertisements = &value case "InNeighborSolicits": - procSnmp6.Icmp6.InNeighborSolicits = value + procSnmp6.Icmp6.InNeighborSolicits = &value case "InNeighborAdvertisements": - procSnmp6.Icmp6.InNeighborAdvertisements = value + procSnmp6.Icmp6.InNeighborAdvertisements = &value case "InRedirects": - procSnmp6.Icmp6.InRedirects = value + procSnmp6.Icmp6.InRedirects = &value case "InMLDv2Reports": - procSnmp6.Icmp6.InMLDv2Reports = value + procSnmp6.Icmp6.InMLDv2Reports = &value case "OutDestUnreachs": - procSnmp6.Icmp6.OutDestUnreachs = value + procSnmp6.Icmp6.OutDestUnreachs = &value case "OutPktTooBigs": - procSnmp6.Icmp6.OutPktTooBigs = value + procSnmp6.Icmp6.OutPktTooBigs = &value case "OutTimeExcds": - procSnmp6.Icmp6.OutTimeExcds = value + procSnmp6.Icmp6.OutTimeExcds = &value case "OutParmProblems": - procSnmp6.Icmp6.OutParmProblems = value + procSnmp6.Icmp6.OutParmProblems = &value case "OutEchos": - procSnmp6.Icmp6.OutEchos = value + procSnmp6.Icmp6.OutEchos = &value case "OutEchoReplies": - procSnmp6.Icmp6.OutEchoReplies = value + procSnmp6.Icmp6.OutEchoReplies = &value case "OutGroupMembQueries": - procSnmp6.Icmp6.OutGroupMembQueries = value + procSnmp6.Icmp6.OutGroupMembQueries = &value case "OutGroupMembResponses": - procSnmp6.Icmp6.OutGroupMembResponses = value + procSnmp6.Icmp6.OutGroupMembResponses = &value case "OutGroupMembReductions": - procSnmp6.Icmp6.OutGroupMembReductions = value + procSnmp6.Icmp6.OutGroupMembReductions = &value case "OutRouterSolicits": - procSnmp6.Icmp6.OutRouterSolicits = value + procSnmp6.Icmp6.OutRouterSolicits = &value case "OutRouterAdvertisements": - procSnmp6.Icmp6.OutRouterAdvertisements = value + procSnmp6.Icmp6.OutRouterAdvertisements = &value case "OutNeighborSolicits": - procSnmp6.Icmp6.OutNeighborSolicits = value + procSnmp6.Icmp6.OutNeighborSolicits = &value case "OutNeighborAdvertisements": - procSnmp6.Icmp6.OutNeighborAdvertisements = value + procSnmp6.Icmp6.OutNeighborAdvertisements = &value case "OutRedirects": - procSnmp6.Icmp6.OutRedirects = value + procSnmp6.Icmp6.OutRedirects = &value case "OutMLDv2Reports": - procSnmp6.Icmp6.OutMLDv2Reports = value + procSnmp6.Icmp6.OutMLDv2Reports = &value case "InType1": - procSnmp6.Icmp6.InType1 = value + procSnmp6.Icmp6.InType1 = &value case "InType134": - procSnmp6.Icmp6.InType134 = value + procSnmp6.Icmp6.InType134 = &value case "InType135": - procSnmp6.Icmp6.InType135 = value + procSnmp6.Icmp6.InType135 = &value case "InType136": - procSnmp6.Icmp6.InType136 = value + procSnmp6.Icmp6.InType136 = &value case "InType143": - procSnmp6.Icmp6.InType143 = value + procSnmp6.Icmp6.InType143 = &value case "OutType133": - procSnmp6.Icmp6.OutType133 = value + procSnmp6.Icmp6.OutType133 = &value case "OutType135": - procSnmp6.Icmp6.OutType135 = value + procSnmp6.Icmp6.OutType135 = &value case "OutType136": - procSnmp6.Icmp6.OutType136 = value + procSnmp6.Icmp6.OutType136 = &value case "OutType143": - procSnmp6.Icmp6.OutType143 = value + procSnmp6.Icmp6.OutType143 = &value } case "Udp6": switch key { case "InDatagrams": - procSnmp6.Udp6.InDatagrams = value + procSnmp6.Udp6.InDatagrams = &value case "NoPorts": - procSnmp6.Udp6.NoPorts = value + procSnmp6.Udp6.NoPorts = &value case "InErrors": - procSnmp6.Udp6.InErrors = value + procSnmp6.Udp6.InErrors = &value case "OutDatagrams": - procSnmp6.Udp6.OutDatagrams = value + procSnmp6.Udp6.OutDatagrams = &value case "RcvbufErrors": - procSnmp6.Udp6.RcvbufErrors = value + procSnmp6.Udp6.RcvbufErrors = &value case "SndbufErrors": - procSnmp6.Udp6.SndbufErrors = value + procSnmp6.Udp6.SndbufErrors = &value case "InCsumErrors": - procSnmp6.Udp6.InCsumErrors = value + procSnmp6.Udp6.InCsumErrors = &value case "IgnoredMulti": - procSnmp6.Udp6.IgnoredMulti = value + procSnmp6.Udp6.IgnoredMulti = &value } case "UdpLite6": switch key { case "InDatagrams": - procSnmp6.UdpLite6.InDatagrams = value + procSnmp6.UdpLite6.InDatagrams = &value case "NoPorts": - procSnmp6.UdpLite6.NoPorts = value + procSnmp6.UdpLite6.NoPorts = &value case "InErrors": - procSnmp6.UdpLite6.InErrors = value + procSnmp6.UdpLite6.InErrors = &value case "OutDatagrams": - procSnmp6.UdpLite6.OutDatagrams = value + procSnmp6.UdpLite6.OutDatagrams = &value case "RcvbufErrors": - procSnmp6.UdpLite6.RcvbufErrors = value + procSnmp6.UdpLite6.RcvbufErrors = &value case "SndbufErrors": - procSnmp6.UdpLite6.SndbufErrors = value + procSnmp6.UdpLite6.SndbufErrors = &value case "InCsumErrors": - procSnmp6.UdpLite6.InCsumErrors = value + procSnmp6.UdpLite6.InCsumErrors = &value } } } diff --git a/proc_snmp6_test.go b/proc_snmp6_test.go index aed483eb2..4850c8c30 100644 --- a/proc_snmp6_test.go +++ b/proc_snmp6_test.go @@ -32,13 +32,13 @@ func TestProcSnmp6(t *testing.T) { have float64 }{ {name: "pid", want: 26231, have: float64(procSnmp6.PID)}, - {name: "Ip6InReceives", want: 92166, have: procSnmp6.Ip6.InReceives}, - {name: "Ip6InDelivers", want: 92053, have: procSnmp6.Ip6.InDelivers}, - {name: "Ip6OutNoRoutes", want: 169, have: procSnmp6.Ip6.OutNoRoutes}, - {name: "Ip6InOctets", want: 113479132, have: procSnmp6.Ip6.InOctets}, - {name: "Icmp6InMsgs", want: 142, have: procSnmp6.Icmp6.InMsgs}, - {name: "Udp6InDatagrams", want: 2016, have: procSnmp6.Udp6.InDatagrams}, - {name: "UdpLite6InDatagrams", want: 0, have: procSnmp6.UdpLite6.InDatagrams}, + {name: "Ip6InReceives", want: 92166, have: *procSnmp6.Ip6.InReceives}, + {name: "Ip6InDelivers", want: 92053, have: *procSnmp6.Ip6.InDelivers}, + {name: "Ip6OutNoRoutes", want: 169, have: *procSnmp6.Ip6.OutNoRoutes}, + {name: "Ip6InOctets", want: 113479132, have: *procSnmp6.Ip6.InOctets}, + {name: "Icmp6InMsgs", want: 142, have: *procSnmp6.Icmp6.InMsgs}, + {name: "Udp6InDatagrams", want: 2016, have: *procSnmp6.Udp6.InDatagrams}, + {name: "UdpLite6InDatagrams", want: 0, have: *procSnmp6.UdpLite6.InDatagrams}, } { if test.want != test.have { t.Errorf("want %s %f, have %f", test.name, test.want, test.have) diff --git a/proc_snmp_test.go b/proc_snmp_test.go index 73c8a69f4..8268b433e 100644 --- a/proc_snmp_test.go +++ b/proc_snmp_test.go @@ -32,17 +32,17 @@ func TestProcSnmp(t *testing.T) { have float64 }{ {name: "pid", want: 26231, have: float64(procSnmp.PID)}, - {name: "IP:Forwarding", want: 2, have: procSnmp.Ip.Forwarding}, - {name: "IP:DefaultTTL", want: 64, have: procSnmp.Ip.DefaultTTL}, - {name: "Icmp:InMsgs", want: 45, have: procSnmp.Icmp.InMsgs}, - {name: "IcmpMsg:InType3", want: 45, have: procSnmp.IcmpMsg.InType3}, - {name: "IcmpMsg:OutType3", want: 50, have: procSnmp.IcmpMsg.OutType3}, - {name: "TCP:RtoAlgorithm", want: 1, have: procSnmp.Tcp.RtoAlgorithm}, - {name: "TCP:RtoMin", want: 200, have: procSnmp.Tcp.RtoMin}, - {name: "Udp:InDatagrams", want: 10179, have: procSnmp.Udp.InDatagrams}, - {name: "Udp:NoPorts", want: 50, have: procSnmp.Udp.NoPorts}, - {name: "UdpLite:InDatagrams", want: 0, have: procSnmp.UdpLite.NoPorts}, - {name: "UdpLite:NoPorts", want: 0, have: procSnmp.UdpLite.NoPorts}, + {name: "IP:Forwarding", want: 2, have: *procSnmp.Ip.Forwarding}, + {name: "IP:DefaultTTL", want: 64, have: *procSnmp.Ip.DefaultTTL}, + {name: "Icmp:InMsgs", want: 45, have: *procSnmp.Icmp.InMsgs}, + {name: "IcmpMsg:InType3", want: 45, have: *procSnmp.IcmpMsg.InType3}, + {name: "IcmpMsg:OutType3", want: 50, have: *procSnmp.IcmpMsg.OutType3}, + {name: "TCP:RtoAlgorithm", want: 1, have: *procSnmp.Tcp.RtoAlgorithm}, + {name: "TCP:RtoMin", want: 200, have: *procSnmp.Tcp.RtoMin}, + {name: "Udp:InDatagrams", want: 10179, have: *procSnmp.Udp.InDatagrams}, + {name: "Udp:NoPorts", want: 50, have: *procSnmp.Udp.NoPorts}, + {name: "UdpLite:InDatagrams", want: 0, have: *procSnmp.UdpLite.NoPorts}, + {name: "UdpLite:NoPorts", want: 0, have: *procSnmp.UdpLite.NoPorts}, } { if test.want != test.have { t.Errorf("want %s %f, have %f", test.name, test.want, test.have) From 254423d8d7de354d44fd7851f4f9b137165c6f21 Mon Sep 17 00:00:00 2001 From: PrometheusBot Date: Sat, 24 Sep 2022 16:33:27 +0200 Subject: [PATCH 037/176] Update common Prometheus files (#466) Signed-off-by: prombot --- Makefile.common | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Makefile.common b/Makefile.common index 6c8e3e219..7642c4485 100644 --- a/Makefile.common +++ b/Makefile.common @@ -58,16 +58,19 @@ endif PROMU_VERSION ?= 0.13.0 PROMU_URL := https://github.com/prometheus/promu/releases/download/v$(PROMU_VERSION)/promu-$(PROMU_VERSION).$(GO_BUILD_PLATFORM).tar.gz +SKIP_GOLANGCI_LINT := GOLANGCI_LINT := GOLANGCI_LINT_OPTS ?= -GOLANGCI_LINT_VERSION ?= v1.45.2 +GOLANGCI_LINT_VERSION ?= v1.49.0 # golangci-lint only supports linux, darwin and windows platforms on i386/amd64. # windows isn't included here because of the path separator being different. ifeq ($(GOHOSTOS),$(filter $(GOHOSTOS),linux darwin)) ifeq ($(GOHOSTARCH),$(filter $(GOHOSTARCH),amd64 i386)) # If we're in CI and there is an Actions file, that means the linter # is being run in Actions, so we don't need to run it here. - ifeq (,$(CIRCLE_JOB)) + ifneq (,$(SKIP_GOLANGCI_LINT)) + GOLANGCI_LINT := + else ifeq (,$(CIRCLE_JOB)) GOLANGCI_LINT := $(FIRST_GOPATH)/bin/golangci-lint else ifeq (,$(wildcard .github/workflows/golangci-lint.yml)) GOLANGCI_LINT := $(FIRST_GOPATH)/bin/golangci-lint From f5d82fa2c83349c3e3ea8587cd4f5a5983b99a9e Mon Sep 17 00:00:00 2001 From: SuperQ Date: Sat, 24 Sep 2022 16:31:54 +0200 Subject: [PATCH 038/176] Update codespell Switch to ignore file, update with new ignores. Signed-off-by: SuperQ --- .circleci/config.yml | 2 +- proc_psi_test.go | 2 +- scripts/codespell_ignore.txt | 11 +++++++++++ 3 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 scripts/codespell_ignore.txt diff --git a/.circleci/config.yml b/.circleci/config.yml index 7e58263b2..70d3887f2 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -41,7 +41,7 @@ jobs: steps: - checkout - run: sudo pip install codespell - - run: codespell --skip=".git,./vendor,ttar,fixtures.ttar,./fixtures,go.mod,go.sum" -L uint,packages\',ded,alo,als,te,sie,hart,hda + - run: codespell --skip=".git,./vendor,ttar,fixtures.ttar,./fixtures,go.mod,go.sum" -I scripts/codespell_ignore.txt workflows: version: 2 diff --git a/proc_psi_test.go b/proc_psi_test.go index bd6fb09aa..da674dc2f 100644 --- a/proc_psi_test.go +++ b/proc_psi_test.go @@ -110,7 +110,7 @@ func TestPSIStats(t *testing.T) { // TestParsePSIStats tests the edge cases that we won't run into when running TestPSIStats. func TestParsePSIStats(t *testing.T) { t.Run("unknown measurement type", func(t *testing.T) { - raw := "nonesense haha test=fake" + raw := "nonsense haha test=fake" _, err := parsePSIStats("fake", strings.NewReader(raw)) if err != nil { t.Error("unknown measurement type must be ignored") diff --git a/scripts/codespell_ignore.txt b/scripts/codespell_ignore.txt new file mode 100644 index 000000000..4b41a2391 --- /dev/null +++ b/scripts/codespell_ignore.txt @@ -0,0 +1,11 @@ +alo +als +ded +hart +hda +inflight +packages\' +ro +sie +te +uint From 800411b02cff73bb104c3a60515a23d7b6c3da18 Mon Sep 17 00:00:00 2001 From: Jia Xin Date: Tue, 15 Mar 2022 11:28:48 +0800 Subject: [PATCH 039/176] parse cpu with ID in /proc/stat Signed-off-by: Jia Xin --- stat.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/stat.go b/stat.go index 33f97caa0..2c0116ede 100644 --- a/stat.go +++ b/stat.go @@ -62,7 +62,7 @@ type Stat struct { // Summed up cpu statistics. CPUTotal CPUStat // Per-CPU statistics. - CPU []CPUStat + CPU map[int64]CPUStat // Number of times interrupts were handled, which contains numbered and unnumbered IRQs. IRQTotal uint64 // Number of times a numbered IRQ was triggered. @@ -171,7 +171,9 @@ func (fs FS) Stat() (Stat, error) { return Stat{}, err } - stat := Stat{} + stat := Stat{ + CPU: make(map[int64]CPUStat), + } scanner := bufio.NewScanner(bytes.NewReader(data)) for scanner.Scan() { @@ -228,9 +230,6 @@ func (fs FS) Stat() (Stat, error) { if cpuID == -1 { stat.CPUTotal = cpuStat } else { - for int64(len(stat.CPU)) <= cpuID { - stat.CPU = append(stat.CPU, CPUStat{}) - } stat.CPU[cpuID] = cpuStat } } From bf361025088d9df7a76662269f07facf20f8711e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 2 Oct 2022 13:46:49 +0200 Subject: [PATCH 040/176] Bump github.com/google/go-cmp from 0.5.8 to 0.5.9 (#468) Bumps [github.com/google/go-cmp](https://github.com/google/go-cmp) from 0.5.8 to 0.5.9. - [Release notes](https://github.com/google/go-cmp/releases) - [Commits](https://github.com/google/go-cmp/compare/v0.5.8...v0.5.9) --- updated-dependencies: - dependency-name: github.com/google/go-cmp dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index f34c350d8..a5c17878b 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/prometheus/procfs go 1.17 require ( - github.com/google/go-cmp v0.5.8 + github.com/google/go-cmp v0.5.9 golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a ) diff --git a/go.sum b/go.sum index 1e57810df..f80152f5f 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,5 @@ -github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= -github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f h1:Ax0t5p6N38Ga0dThY21weqDEyz2oklo4IvDkpigvkD8= golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a h1:dGzPydgVsqGcTRVwiLJ1jVbufYwmzD3LfVPLKsKg+0k= From b3d77ecba8e7aeb7b4ff946644b1013199656c42 Mon Sep 17 00:00:00 2001 From: Irvin Lim Date: Tue, 11 Oct 2022 21:11:53 +0800 Subject: [PATCH 041/176] fix: Avoid trimming characters incorrectly from ProcStatus (#469) Signed-off-by: Irvin Lim Signed-off-by: Irvin Lim --- proc_status.go | 6 ++--- proc_status_test.go | 14 ++++++++++ testdata/fixtures.ttar | 58 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 75 insertions(+), 3 deletions(-) diff --git a/proc_status.go b/proc_status.go index 594022ded..3d8c06439 100644 --- a/proc_status.go +++ b/proc_status.go @@ -96,10 +96,10 @@ func (p Proc) NewStatus() (ProcStatus, error) { kv := strings.SplitN(line, ":", 2) // removes spaces - k := string(strings.TrimSpace(kv[0])) - v := string(strings.TrimSpace(kv[1])) + k := strings.TrimSpace(kv[0]) + v := strings.TrimSpace(kv[1]) // removes "kB" - v = string(bytes.Trim([]byte(v), " kB")) + v = strings.TrimSuffix(v, " kB") // value to int when possible // we can skip error check here, 'cause vKBytes is not used when value is a string diff --git a/proc_status_test.go b/proc_status_test.go index e132848af..3c9ab5986 100644 --- a/proc_status_test.go +++ b/proc_status_test.go @@ -76,6 +76,20 @@ func TestProcStatusName(t *testing.T) { } } +func TestProcStatusNameTrim(t *testing.T) { + p, err := getProcFixtures(t).Proc(26235) + if err != nil { + t.Fatal(err) + } + s, err := p.NewStatus() + if err != nil { + t.Fatal(err) + } + if want, have := "kube-proxy", s.Name; want != have { + t.Errorf("want name %s, have %s", want, have) + } +} + func TestProcStatusUIDs(t *testing.T) { p, err := getProcFixtures(t).Proc(26231) if err != nil { diff --git a/testdata/fixtures.ttar b/testdata/fixtures.ttar index 40b630739..8400ec765 100644 --- a/testdata/fixtures.ttar +++ b/testdata/fixtures.ttar @@ -748,6 +748,64 @@ Lines: 4 40000000-40015000 r-xp 00000000 03:01 61874 /lib/ld-2.3.2.so Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/proc/26235 +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/proc/26235/status +Lines: 51 +Name: kube-proxy +Umask: 0022 +State: S (sleeping) +Tgid: 26235 +Ngid: 12345 +Pid: 26235 +PPid: 1234 +TracerPid: 0 +Uid: 0 0 0 0 +Gid: 0 0 0 0 +FDSize: 64 +Groups: +NStgid: 26235 1 +NSpid: 26235 1 +NSpgid: 26235 1 +NSsid: 26235 1 +VmPeak: 758200 kB +VmSize: 758200 kB +VmLck: 0 kB +VmPin: 0 kB +VmHWM: 61776 kB +VmRSS: 42652 kB +RssAnon: 24852 kB +RssFile: 17800 kB +RssShmem: 0 kB +VmData: 117136 kB +VmStk: 132 kB +VmExe: 21568 kB +VmLib: 4 kB +VmPTE: 264 kB +VmSwap: 0 kB +HugetlbPages: 0 kB +Threads: 51 +SigQ: 9/511324 +SigPnd: 0000000000000000 +ShdPnd: 0000000000000000 +SigBlk: 0000000000000000 +SigIgn: 0000000000000000 +SigCgt: fffffffc7fc1feff +CapInh: 0000003fffffffff +CapPrm: 0000003fffffffff +CapEff: 0000003fffffffff +CapBnd: 0000003fffffffff +CapAmb: 0000000000000000 +Seccomp: 0 +Cpus_allowed: ff +Cpus_allowed_list: 0-7 +Mems_allowed: 00000000,00000001 +Mems_allowed_list: 0 +voluntary_ctxt_switches: 4742839 +nonvoluntary_ctxt_switches: 1727500 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: fixtures/proc/584 Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - From 3a8e021c327cd0e67e074245b8571983318f2006 Mon Sep 17 00:00:00 2001 From: Furkan Date: Wed, 12 Oct 2022 16:25:12 +0300 Subject: [PATCH 042/176] Add missing TCPRcvQDrop Signed-off-by: Furkan --- proc_netstat.go | 3 +++ testdata/fixtures.ttar | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/proc_netstat.go b/proc_netstat.go index a978c3b9e..7d7b86d96 100644 --- a/proc_netstat.go +++ b/proc_netstat.go @@ -110,6 +110,7 @@ type TcpExt struct { // nolint:revive TCPReqQFullDrop *float64 TCPRetransFail *float64 TCPRcvCoalesce *float64 + TCPRcvQDrop *float64 TCPOFOQueue *float64 TCPOFODrop *float64 TCPOFOMerge *float64 @@ -323,6 +324,8 @@ func parseNetstat(r io.Reader, fileName string) (ProcNetstat, error) { procNetstat.TcpExt.TCPRetransFail = &value case "TCPRcvCoalesce": procNetstat.TcpExt.TCPRcvCoalesce = &value + case "TCPRcvQDrop": + procNetstat.TcpExt.TCPRcvQDrop = &value case "TCPOFOQueue": procNetstat.TcpExt.TCPOFOQueue = &value case "TCPOFODrop": diff --git a/testdata/fixtures.ttar b/testdata/fixtures.ttar index 8400ec765..f80877108 100644 --- a/testdata/fixtures.ttar +++ b/testdata/fixtures.ttar @@ -158,8 +158,8 @@ Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Path: fixtures/proc/26231/net/netstat Lines: 4 -TcpExt: SyncookiesSent SyncookiesRecv SyncookiesFailed EmbryonicRsts PruneCalled RcvPruned OfoPruned OutOfWindowIcmps LockDroppedIcmps ArpFilter TW TWRecycled TWKilled PAWSActive PAWSEstab DelayedACKs DelayedACKLocked DelayedACKLost ListenOverflows ListenDrops TCPHPHits TCPPureAcks TCPHPAcks TCPRenoRecovery TCPSackRecovery TCPSACKReneging TCPSACKReorder TCPRenoReorder TCPTSReorder TCPFullUndo TCPPartialUndo TCPDSACKUndo TCPLossUndo TCPLostRetransmit TCPRenoFailures TCPSackFailures TCPLossFailures TCPFastRetrans TCPSlowStartRetrans TCPTimeouts TCPLossProbes TCPLossProbeRecovery TCPRenoRecoveryFail TCPSackRecoveryFail TCPRcvCollapsed TCPDSACKOldSent TCPDSACKOfoSent TCPDSACKRecv TCPDSACKOfoRecv TCPAbortOnData TCPAbortOnClose TCPAbortOnMemory TCPAbortOnTimeout TCPAbortOnLinger TCPAbortFailed TCPMemoryPressures TCPMemoryPressuresChrono TCPSACKDiscard TCPDSACKIgnoredOld TCPDSACKIgnoredNoUndo TCPSpuriousRTOs TCPMD5NotFound TCPMD5Unexpected TCPMD5Failure TCPSackShifted TCPSackMerged TCPSackShiftFallback TCPBacklogDrop PFMemallocDrop TCPMinTTLDrop TCPDeferAcceptDrop IPReversePathFilter TCPTimeWaitOverflow TCPReqQFullDoCookies TCPReqQFullDrop TCPRetransFail TCPRcvCoalesce TCPOFOQueue TCPOFODrop TCPOFOMerge TCPChallengeACK TCPSYNChallenge TCPFastOpenActive TCPFastOpenActiveFail TCPFastOpenPassive TCPFastOpenPassiveFail TCPFastOpenListenOverflow TCPFastOpenCookieReqd TCPFastOpenBlackhole TCPSpuriousRtxHostQueues BusyPollRxPackets TCPAutoCorking TCPFromZeroWindowAdv TCPToZeroWindowAdv TCPWantZeroWindowAdv TCPSynRetrans TCPOrigDataSent TCPHystartTrainDetect TCPHystartTrainCwnd TCPHystartDelayDetect TCPHystartDelayCwnd TCPACKSkippedSynRecv TCPACKSkippedPAWS TCPACKSkippedSeq TCPACKSkippedFinWait2 TCPACKSkippedTimeWait TCPACKSkippedChallenge TCPWinProbe TCPKeepAlive TCPMTUPFail TCPMTUPSuccess TCPWqueueTooBig -TcpExt: 0 0 0 1 0 0 0 0 0 0 83 0 0 0 3640 287 1 7460 0 0 134193 1335 829 0 4 0 1 0 0 0 0 1 19 0 0 0 0 3 0 32 100 4 0 0 0 7460 2421 49 1 62 6 0 23 0 7 0 0 0 0 19 2 0 0 0 0 0 6 0 0 0 0 3 0 0 0 0 92425 65515 0 2421 4 4 0 0 0 0 0 0 0 0 0 10 0 0 0 16 2221 0 0 2 45 0 0 3 0 0 0 0 456 0 0 0 +TcpExt: SyncookiesSent SyncookiesRecv SyncookiesFailed EmbryonicRsts PruneCalled RcvPruned OfoPruned OutOfWindowIcmps LockDroppedIcmps ArpFilter TW TWRecycled TWKilled PAWSActive PAWSEstab DelayedACKs DelayedACKLocked DelayedACKLost ListenOverflows ListenDrops TCPHPHits TCPPureAcks TCPHPAcks TCPRenoRecovery TCPSackRecovery TCPSACKReneging TCPSACKReorder TCPRenoReorder TCPTSReorder TCPFullUndo TCPPartialUndo TCPDSACKUndo TCPLossUndo TCPLostRetransmit TCPRenoFailures TCPSackFailures TCPLossFailures TCPFastRetrans TCPSlowStartRetrans TCPTimeouts TCPLossProbes TCPLossProbeRecovery TCPRenoRecoveryFail TCPSackRecoveryFail TCPRcvCollapsed TCPDSACKOldSent TCPDSACKOfoSent TCPDSACKRecv TCPDSACKOfoRecv TCPAbortOnData TCPAbortOnClose TCPAbortOnMemory TCPAbortOnTimeout TCPAbortOnLinger TCPAbortFailed TCPMemoryPressures TCPMemoryPressuresChrono TCPSACKDiscard TCPDSACKIgnoredOld TCPDSACKIgnoredNoUndo TCPSpuriousRTOs TCPMD5NotFound TCPMD5Unexpected TCPMD5Failure TCPSackShifted TCPSackMerged TCPSackShiftFallback TCPBacklogDrop PFMemallocDrop TCPMinTTLDrop TCPDeferAcceptDrop IPReversePathFilter TCPTimeWaitOverflow TCPReqQFullDoCookies TCPReqQFullDrop TCPRetransFail TCPRcvCoalesce TCPRcvQDrop TCPOFOQueue TCPOFODrop TCPOFOMerge TCPChallengeACK TCPSYNChallenge TCPFastOpenActive TCPFastOpenActiveFail TCPFastOpenPassive TCPFastOpenPassiveFail TCPFastOpenListenOverflow TCPFastOpenCookieReqd TCPFastOpenBlackhole TCPSpuriousRtxHostQueues BusyPollRxPackets TCPAutoCorking TCPFromZeroWindowAdv TCPToZeroWindowAdv TCPWantZeroWindowAdv TCPSynRetrans TCPOrigDataSent TCPHystartTrainDetect TCPHystartTrainCwnd TCPHystartDelayDetect TCPHystartDelayCwnd TCPACKSkippedSynRecv TCPACKSkippedPAWS TCPACKSkippedSeq TCPACKSkippedFinWait2 TCPACKSkippedTimeWait TCPACKSkippedChallenge TCPWinProbe TCPKeepAlive TCPMTUPFail TCPMTUPSuccess TCPWqueueTooBig +TcpExt: 0 0 0 1 0 0 0 0 0 0 83 0 0 0 3640 287 1 7460 0 0 134193 1335 829 0 4 0 1 0 0 0 0 1 19 0 0 0 0 0 3 0 32 100 4 0 0 0 7460 2421 49 1 62 6 0 23 0 7 0 0 0 0 19 2 0 0 0 0 0 6 0 0 0 0 3 0 0 0 0 92425 65515 0 2421 4 4 0 0 0 0 0 0 0 0 0 10 0 0 0 16 2221 0 0 2 45 0 0 3 0 0 0 0 456 0 0 0 IpExt: InNoRoutes InTruncatedPkts InMcastPkts OutMcastPkts InBcastPkts OutBcastPkts InOctets OutOctets InMcastOctets OutMcastOctets InBcastOctets OutBcastOctets InCsumErrors InNoECTPkts InECT1Pkts InECT0Pkts InCEPkts ReasmOverlaps IpExt: 0 0 208 214 118 111 190585481 7512674 26093 25903 14546 13628 0 134215 0 0 0 0 Mode: 644 From a05e0cf2bbbc9e243034187d15909443579f47e7 Mon Sep 17 00:00:00 2001 From: Furkan Date: Thu, 13 Oct 2022 10:03:55 +0300 Subject: [PATCH 043/176] Separate NetStat parsing logic Signed-off-by: Furkan --- netstat.go | 53 ++++++++++++++++++++++++++++++++----------------- proc_netstat.go | 6 +++--- 2 files changed, 38 insertions(+), 21 deletions(-) diff --git a/netstat.go b/netstat.go index dcea9c5a6..5cc40aef5 100644 --- a/netstat.go +++ b/netstat.go @@ -15,6 +15,7 @@ package procfs import ( "bufio" + "io" "os" "path/filepath" "strconv" @@ -42,27 +43,43 @@ func (fs FS) NetStat() ([]NetStat, error) { return nil, err } - netStatFile := NetStat{ - Filename: filepath.Base(filePath), - Stats: make(map[string][]uint64), + procNetstat, err := parseNetstat(file) + if err != nil { + return nil, err + } + procNetstat.Filename = filepath.Base(filePath) + + netStatsTotal = append(netStatsTotal, procNetstat) + } + return netStatsTotal, nil +} + +// parseNetstat parses the metrics from `/proc/net/stat/` file +// and returns a NetStat structure. +func parseNetstat(r io.Reader) (NetStat, error) { + var ( + scanner = bufio.NewScanner(r) + netStat = NetStat{ + Stats: make(map[string][]uint64), } - scanner := bufio.NewScanner(file) - scanner.Scan() - // First string is always a header for stats - var headers []string - headers = append(headers, strings.Fields(scanner.Text())...) + ) + + scanner.Scan() - // Other strings represent per-CPU counters - for scanner.Scan() { - for num, counter := range strings.Fields(scanner.Text()) { - value, err := strconv.ParseUint(counter, 16, 64) - if err != nil { - return nil, err - } - netStatFile.Stats[headers[num]] = append(netStatFile.Stats[headers[num]], value) + // First string is always a header for stats + var headers []string + headers = append(headers, strings.Fields(scanner.Text())...) + + // Other strings represent per-CPU counters + for scanner.Scan() { + for num, counter := range strings.Fields(scanner.Text()) { + value, err := strconv.ParseUint(counter, 16, 64) + if err != nil { + return NetStat{}, err } + netStat.Stats[headers[num]] = append(netStat.Stats[headers[num]], value) } - netStatsTotal = append(netStatsTotal, netStatFile) } - return netStatsTotal, nil + + return netStat, nil } diff --git a/proc_netstat.go b/proc_netstat.go index a978c3b9e..400efdb19 100644 --- a/proc_netstat.go +++ b/proc_netstat.go @@ -174,14 +174,14 @@ func (p Proc) Netstat() (ProcNetstat, error) { if err != nil { return ProcNetstat{PID: p.PID}, err } - procNetstat, err := parseNetstat(bytes.NewReader(data), filename) + procNetstat, err := parseProcNetstat(bytes.NewReader(data), filename) procNetstat.PID = p.PID return procNetstat, err } -// parseNetstat parses the metrics from proc//net/netstat file +// parseProcNetstat parses the metrics from proc//net/netstat file // and returns a ProcNetstat structure. -func parseNetstat(r io.Reader, fileName string) (ProcNetstat, error) { +func parseProcNetstat(r io.Reader, fileName string) (ProcNetstat, error) { var ( scanner = bufio.NewScanner(r) procNetstat = ProcNetstat{} From 045a006fcdac304b24e56d44e2879e1dd427e258 Mon Sep 17 00:00:00 2001 From: Furkan Date: Sun, 30 Oct 2022 00:48:05 +0300 Subject: [PATCH 044/176] Separate /proc/stat parsing logic Signed-off-by: Furkan --- stat.go | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/stat.go b/stat.go index 2c0116ede..586af48af 100644 --- a/stat.go +++ b/stat.go @@ -170,12 +170,23 @@ func (fs FS) Stat() (Stat, error) { if err != nil { return Stat{}, err } - - stat := Stat{ - CPU: make(map[int64]CPUStat), + procStat, err := parseStat(bytes.NewReader(data), fileName) + if err != nil { + return Stat{}, err } + return procStat, nil +} + +// parseStat parses the metrics from /proc/[pid]/stat. +func parseStat(r io.Reader, fileName string) (Stat, error) { + var ( + scanner = bufio.NewScanner(r) + stat = Stat{ + CPU: make(map[int64]CPUStat), + } + err error + ) - scanner := bufio.NewScanner(bytes.NewReader(data)) for scanner.Scan() { line := scanner.Text() parts := strings.Fields(scanner.Text()) From 3d7fbadba76d5d5aaaee8b8099076c87ce8995ce Mon Sep 17 00:00:00 2001 From: Furkan Date: Fri, 4 Nov 2022 12:13:18 +0300 Subject: [PATCH 045/176] Separate /proc/stat disk stat parsing logic Signed-off-by: Furkan --- blockdevice/stats.go | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/blockdevice/stats.go b/blockdevice/stats.go index b06ce3945..22533002d 100644 --- a/blockdevice/stats.go +++ b/blockdevice/stats.go @@ -15,6 +15,7 @@ package blockdevice import ( "bufio" + "errors" "fmt" "io" "os" @@ -251,9 +252,15 @@ func (fs FS) ProcDiskstats() ([]Diskstats, error) { return nil, err } defer file.Close() + return parseProcDiskstats(file) +} - diskstats := []Diskstats{} - scanner := bufio.NewScanner(file) +func parseProcDiskstats(r io.Reader) ([]Diskstats, error) { + var ( + diskstats []Diskstats + scanner = bufio.NewScanner(r) + err error + ) for scanner.Scan() { d := &Diskstats{} d.IoStatsCount, err = fmt.Sscanf(scanner.Text(), procDiskstatsFormat, @@ -280,7 +287,7 @@ func (fs FS) ProcDiskstats() ([]Diskstats, error) { ) // The io.EOF error can be safely ignored because it just means we read fewer than // the full 20 fields. - if err != nil && err != io.EOF { + if err != nil && !errors.Is(err, io.EOF) { return diskstats, err } if d.IoStatsCount >= 14 { @@ -307,12 +314,16 @@ func (fs FS) SysBlockDevices() ([]string, error) { // The number of stats read will be 15 if the discard stats are available (kernel 4.18+) // and 11 if they are not available. func (fs FS) SysBlockDeviceStat(device string) (IOStats, int, error) { - stat := IOStats{} bytes, err := os.ReadFile(fs.sys.Path(sysBlockPath, device, "stat")) if err != nil { - return stat, 0, err + return IOStats{}, 0, err } - count, err := fmt.Sscanf(strings.TrimSpace(string(bytes)), sysBlockStatFormat, + return parseSysBlockDeviceStat(bytes) +} + +func parseSysBlockDeviceStat(data []byte) (IOStats, int, error) { + stat := IOStats{} + count, err := fmt.Sscanf(strings.TrimSpace(string(data)), sysBlockStatFormat, &stat.ReadIOs, &stat.ReadMerges, &stat.ReadSectors, @@ -332,7 +343,7 @@ func (fs FS) SysBlockDeviceStat(device string) (IOStats, int, error) { &stat.TimeSpentFlushing, ) // An io.EOF error is ignored because it just means we read fewer than the full 15 fields. - if err == io.EOF { + if errors.Is(err, io.EOF) { return stat, count, nil } return stat, count, err From 55dabef946dac7c864a5e416937ef6d4c8f68689 Mon Sep 17 00:00:00 2001 From: prombot Date: Mon, 12 Dec 2022 17:49:04 +0000 Subject: [PATCH 046/176] Update common Prometheus files Signed-off-by: prombot --- Makefile.common | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.common b/Makefile.common index 7642c4485..e358db69c 100644 --- a/Makefile.common +++ b/Makefile.common @@ -55,7 +55,7 @@ ifneq ($(shell which gotestsum),) endif endif -PROMU_VERSION ?= 0.13.0 +PROMU_VERSION ?= 0.14.0 PROMU_URL := https://github.com/prometheus/promu/releases/download/v$(PROMU_VERSION)/promu-$(PROMU_VERSION).$(GO_BUILD_PLATFORM).tar.gz SKIP_GOLANGCI_LINT := From 3433fa1cd232b8abff161a3758d8e5dc6e4970c6 Mon Sep 17 00:00:00 2001 From: Emy Parparita Date: Sat, 17 Dec 2022 11:18:37 -0800 Subject: [PATCH 047/176] Add support for thread data parsing. (#481) * Add support for thread data parsing. Provide access to /proc/PID/task/TID files, for thread specific values. Since such files have the same structure as /proc/PID/ ones, the data structures and the parsers for the latter may be reused. Signed-off-by: Emy Parparita --- testdata/fixtures.ttar | 51 ++++++++++++++++++ thread.go | 79 ++++++++++++++++++++++++++++ thread_test.go | 114 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 244 insertions(+) create mode 100644 thread.go create mode 100644 thread_test.go diff --git a/testdata/fixtures.ttar b/testdata/fixtures.ttar index 8400ec765..d3ba1cc3d 100644 --- a/testdata/fixtures.ttar +++ b/testdata/fixtures.ttar @@ -806,6 +806,57 @@ voluntary_ctxt_switches: 4742839 nonvoluntary_ctxt_switches: 1727500 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/proc/27079 +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/proc/27079/stat +Lines: 1 +27079 (pthread_load) S 1 27079 1 34816 27079 4194304 113 0 1 0 58125 15 0 0 20 0 5 0 4289574 36282368 138 18446744073709551615 94441498279936 94441498282741 140736878632528 0 0 0 0 0 0 0 0 0 17 2 0 0 0 0 0 94441498291504 94441498292248 94441510707200 140736878639434 140736878639460 140736878639460 140736878641129 0 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/proc/27079/task +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/proc/27079/task/27079 +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/proc/27079/task/27079/stat +Lines: 1 +27079 (pthread_load) S 1 27079 1 34816 27079 4194304 97 0 1 0 0 0 0 0 20 0 5 0 4289574 36282368 138 18446744073709551615 94441498279936 94441498282741 140736878632528 0 0 0 0 0 0 0 0 0 17 2 0 0 0 0 0 94441498291504 94441498292248 94441510707200 140736878639434 140736878639460 140736878639460 140736878641129 0 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/proc/27079/task/27080 +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/proc/27079/task/27080/stat +Lines: 1 +27080 (pthread_load) R 1 27079 1 34816 27079 4194368 7 0 0 0 34136 3 0 0 20 0 5 0 4289575 36282368 138 18446744073709551615 94441498279936 94441498282741 140736878632528 0 0 0 0 0 0 0 0 0 -1 0 0 0 0 0 0 94441498291504 94441498292248 94441510707200 140736878639434 140736878639460 140736878639460 140736878641129 0 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/proc/27079/task/27081 +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/proc/27079/task/27081/stat +Lines: 1 +27081 (pthread_load) S 1 27079 1 34816 27079 1077936192 3 0 0 0 13680 4 0 0 20 0 5 0 4289575 36282368 138 18446744073709551615 94441498279936 94441498282741 140736878632528 0 0 0 0 0 0 0 0 0 -1 5 0 0 0 0 0 94441498291504 94441498292248 94441510707200 140736878639434 140736878639460 140736878639460 140736878641129 0 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/proc/27079/task/27082 +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/proc/27079/task/27082/stat +Lines: 1 +27082 (pthread_load) S 1 27079 1 34816 27079 1077936192 3 0 0 0 6859 3 0 0 20 0 5 0 4289575 36282368 138 18446744073709551615 94441498279936 94441498282741 140736878632528 0 0 0 0 0 0 0 0 0 -1 1 0 0 0 0 0 94441498291504 94441498292248 94441510707200 140736878639434 140736878639460 140736878639460 140736878641129 0 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/proc/27079/task/27083 +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/proc/27079/task/27083/stat +Lines: 1 +27083 (pthread_load) S 1 27079 1 34816 27079 1077936192 3 0 0 0 3452 4 0 0 20 0 5 0 4289575 36282368 138 18446744073709551615 94441498279936 94441498282741 140736878632528 0 0 0 0 0 0 0 0 0 -1 4 0 0 0 0 0 94441498291504 94441498292248 94441510707200 140736878639434 140736878639460 140736878639460 140736878641129 0 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: fixtures/proc/584 Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/thread.go b/thread.go new file mode 100644 index 000000000..f08bfc769 --- /dev/null +++ b/thread.go @@ -0,0 +1,79 @@ +// Copyright 2022 The Prometheus Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package procfs + +import ( + "fmt" + "os" + "strconv" + + fsi "github.com/prometheus/procfs/internal/fs" +) + +// Provide access to /proc/PID/task/TID files, for thread specific values. Since +// such files have the same structure as /proc/PID/ ones, the data structures +// and the parsers for the latter may be reused. + +// AllThreads returns a list of all currently available threads under /proc/PID. +func AllThreads(pid int) (Procs, error) { + fs, err := NewFS(DefaultMountPoint) + if err != nil { + return Procs{}, err + } + return fs.AllThreads(pid) +} + +// AllThreads returns a list of all currently available threads for PID. +func (fs FS) AllThreads(pid int) (Procs, error) { + taskPath := fs.proc.Path(strconv.Itoa(pid), "task") + d, err := os.Open(taskPath) + if err != nil { + return Procs{}, err + } + defer d.Close() + + names, err := d.Readdirnames(-1) + if err != nil { + return Procs{}, fmt.Errorf("could not read %q: %w", d.Name(), err) + } + + t := Procs{} + for _, n := range names { + tid, err := strconv.ParseInt(n, 10, 64) + if err != nil { + continue + } + t = append(t, Proc{PID: int(tid), fs: fsi.FS(taskPath)}) + } + + return t, nil +} + +// Thread returns a process for a given PID, TID. +func (fs FS) Thread(pid, tid int) (Proc, error) { + taskPath := fs.proc.Path(strconv.Itoa(pid), "task") + if _, err := os.Stat(taskPath); err != nil { + return Proc{}, err + } + return Proc{PID: tid, fs: fsi.FS(taskPath)}, nil +} + +// Thread returns a process for a given TID of Proc. +func (proc Proc) Thread(tid int) (Proc, error) { + tfs := fsi.FS(proc.path("task")) + if _, err := os.Stat(tfs.Path(strconv.Itoa(tid))); err != nil { + return Proc{}, err + } + return Proc{PID: tid, fs: tfs}, nil +} diff --git a/thread_test.go b/thread_test.go new file mode 100644 index 000000000..503be4f2f --- /dev/null +++ b/thread_test.go @@ -0,0 +1,114 @@ +// Copyright 2022 The Prometheus Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package procfs + +import ( + "reflect" + "sort" + "strconv" + "testing" +) + +var ( + testPID = int(27079) + testTIDS = [...]int{27079, 27080, 27081, 27082, 27083} +) + +func TestAllThreads(t *testing.T) { + fixFS := getProcFixtures(t) + threads, err := fixFS.AllThreads(testPID) + if err != nil { + t.Fatal(err) + } + sort.Sort(threads) + for i, tid := range testTIDS { + if wantTID, haveTID := tid, threads[i].PID; wantTID != haveTID { + t.Errorf("want TID %d, have %d", wantTID, haveTID) + } + wantFS := fixFS.proc.Path(strconv.Itoa(testPID), "task") + haveFS := string(threads[i].fs) + if wantFS != haveFS { + t.Errorf("want fs %q, have %q", wantFS, haveFS) + } + } +} + +func TestThreadStat(t *testing.T) { + // Pull process and thread stats. + proc, err := getProcFixtures(t).Proc(testPID) + if err != nil { + t.Fatal(err) + } + procStat, err := proc.Stat() + if err != nil { + t.Fatal(err) + } + + threads, err := getProcFixtures(t).AllThreads(testPID) + if err != nil { + t.Fatal(err) + } + sort.Sort(threads) + threadStats := make([]*ProcStat, len(threads)) + for i, thread := range threads { + threadStat, err := thread.Stat() + if err != nil { + t.Fatal(err) + } + threadStats[i] = &threadStat + } + + // The following fields should be shared between the process and its thread: + procStatValue := reflect.ValueOf(procStat) + sharedFields := [...]string{ + "PPID", + "PGRP", + "Session", + "TTY", + "TPGID", + "VSize", + "RSS", + } + + for i, thread := range threads { + threadStatValue := reflect.ValueOf(threadStats[i]).Elem() + for _, f := range sharedFields { + if want, have := procStatValue.FieldByName(f), threadStatValue.FieldByName(f); want.Interface() != have.Interface() { + t.Errorf("TID %d, want %s %#v, have %#v", thread.PID, f, want, have) + } + } + } + + // Thread specific fields: + for i, thread := range threads { + if want, have := thread.PID, threadStats[i].PID; want != have { + t.Errorf("TID %d, want PID %d, have %d", thread.PID, want, have) + } + } + + // Finally exemplify the relationship between process and constituent + // threads CPU times: each the former ~ the sum of the corresponding + // latter. Require -v flag. + totalUTime, totalSTime := uint(0), uint(0) + for _, thread := range threads { + threadStat, err := thread.Stat() + if err != nil { + t.Fatal(err) + } + t.Logf("TID %d, UTime %d, STime %d", thread.PID, threadStat.UTime, threadStat.STime) + totalUTime += threadStat.UTime + totalSTime += threadStat.STime + } + t.Logf("PID %d, UTime %d, STime %d, total threads UTime %d, STime %d", proc.PID, procStat.UTime, procStat.STime, totalUTime, totalSTime) +} From b4d3f678b3ed2ce9542488a8da9722145408cd08 Mon Sep 17 00:00:00 2001 From: SuperQ Date: Tue, 11 Oct 2022 15:14:56 +0200 Subject: [PATCH 048/176] Update Go * Update build to latest two Go releases. * Bump module requirements. * Fixup go fmt. * Only make style on latest version. Signed-off-by: SuperQ --- .circleci/config.yml | 9 ++--- .github/workflows/golangci-lint.yml | 4 +-- doc.go | 51 ++++++++++++++--------------- go.mod | 6 ++-- go.sum | 8 ++--- mountstats.go | 3 +- nfs/nfs.go | 1 + proc_cgroups_test.go | 8 ++--- vm.go | 4 ++- 9 files changed, 49 insertions(+), 45 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 70d3887f2..d3ad0f9a9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -4,13 +4,14 @@ version: 2.1 jobs: lint: docker: - - image: cimg/go:1.18 + - image: cimg/go:1.19 steps: - checkout - run: make check_license - run: ./scripts/check_build_tags.sh - run: make fixtures - run: make update_fixtures + - run: make style - run: git diff --exit-code test: @@ -28,7 +29,7 @@ jobs: GOOS: "<< parameters.os >>" steps: - checkout - - run: make style lint + - run: make lint - when: condition: << parameters.run_test >> steps: @@ -54,8 +55,8 @@ workflows: matrix: parameters: go_version: - - "1.17" - "1.18" + - "1.19" - test: name: test-windows os: windows @@ -63,6 +64,6 @@ workflows: matrix: parameters: go_version: - - "1.17" - "1.18" + - "1.19" - codespell diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index 6034bcbf8..2ba5e88dd 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -25,6 +25,6 @@ jobs: run: sudo apt-get update && sudo apt-get -y install libsnmp-dev if: github.repository == 'prometheus/snmp_exporter' - name: Lint - uses: golangci/golangci-lint-action@v3.2.0 + uses: golangci/golangci-lint-action@v3.3.1 with: - version: v1.45.2 + version: v1.50.1 diff --git a/doc.go b/doc.go index d31a82600..f9d961e44 100644 --- a/doc.go +++ b/doc.go @@ -16,30 +16,29 @@ // // Example: // -// package main -// -// import ( -// "fmt" -// "log" -// -// "github.com/prometheus/procfs" -// ) -// -// func main() { -// p, err := procfs.Self() -// if err != nil { -// log.Fatalf("could not get process: %s", err) -// } -// -// stat, err := p.Stat() -// if err != nil { -// log.Fatalf("could not get process stat: %s", err) -// } -// -// fmt.Printf("command: %s\n", stat.Comm) -// fmt.Printf("cpu time: %fs\n", stat.CPUTime()) -// fmt.Printf("vsize: %dB\n", stat.VirtualMemory()) -// fmt.Printf("rss: %dB\n", stat.ResidentMemory()) -// } -// +// package main +// +// import ( +// "fmt" +// "log" +// +// "github.com/prometheus/procfs" +// ) +// +// func main() { +// p, err := procfs.Self() +// if err != nil { +// log.Fatalf("could not get process: %s", err) +// } +// +// stat, err := p.Stat() +// if err != nil { +// log.Fatalf("could not get process stat: %s", err) +// } +// +// fmt.Printf("command: %s\n", stat.Comm) +// fmt.Printf("cpu time: %fs\n", stat.CPUTime()) +// fmt.Printf("vsize: %dB\n", stat.VirtualMemory()) +// fmt.Printf("rss: %dB\n", stat.ResidentMemory()) +// } package procfs diff --git a/go.mod b/go.mod index a5c17878b..d88b4397c 100644 --- a/go.mod +++ b/go.mod @@ -1,9 +1,9 @@ module github.com/prometheus/procfs -go 1.17 +go 1.18 require ( github.com/google/go-cmp v0.5.9 - golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f - golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a + golang.org/x/sync v0.1.0 + golang.org/x/sys v0.3.0 ) diff --git a/go.sum b/go.sum index f80152f5f..f7fa868d7 100644 --- a/go.sum +++ b/go.sum @@ -1,6 +1,6 @@ github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f h1:Ax0t5p6N38Ga0dThY21weqDEyz2oklo4IvDkpigvkD8= -golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a h1:dGzPydgVsqGcTRVwiLJ1jVbufYwmzD3LfVPLKsKg+0k= -golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= +golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.3.0 h1:w8ZOecv6NaNa/zC8944JTU3vz4u6Lagfk4RPQxv92NQ= +golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= diff --git a/mountstats.go b/mountstats.go index f7a828bb1..0c482c18c 100644 --- a/mountstats.go +++ b/mountstats.go @@ -284,7 +284,8 @@ func parseMountStats(r io.Reader) ([]*Mount, error) { } // parseMount parses an entry in /proc/[pid]/mountstats in the format: -// device [device] mounted on [mount] with fstype [type] +// +// device [device] mounted on [mount] with fstype [type] func parseMount(ss []string) (*Mount, error) { if len(ss) < deviceEntryLen { return nil, fmt.Errorf("invalid device entry: %v", ss) diff --git a/nfs/nfs.go b/nfs/nfs.go index 6bf1b80c6..729210295 100644 --- a/nfs/nfs.go +++ b/nfs/nfs.go @@ -204,6 +204,7 @@ type ServerV4Stats struct { // - v4.0 https://tools.ietf.org/html/rfc3010 (38 operations) // - v4.1 https://tools.ietf.org/html/rfc5661 (58 operations) // - v4.2 https://tools.ietf.org/html/draft-ietf-nfsv4-minorversion2-41 (71 operations) +// //nolint:godot type V4Ops struct { //Values uint64 // Variable depending on v4.x sub-version. TODO: Will this always at least include the fields in this struct? diff --git a/proc_cgroups_test.go b/proc_cgroups_test.go index b0a61d24b..b2b936528 100644 --- a/proc_cgroups_test.go +++ b/proc_cgroups_test.go @@ -26,8 +26,8 @@ func TestParseCgroupSummaryString(t *testing.T) { CgroupSummary *CgroupSummary }{ { - name: "cpuset simple line", - s: "cpuset 7 148 1", + name: "cpuset simple line", + s: "cpuset 7 148 1", shouldErr: false, CgroupSummary: &CgroupSummary{ SubsysName: "cpuset", @@ -37,8 +37,8 @@ func TestParseCgroupSummaryString(t *testing.T) { }, }, { - name: "memory cgroup number mis format", - s: "memory 9 ## 1", + name: "memory cgroup number mis format", + s: "memory 9 ## 1", shouldErr: true, CgroupSummary: nil, }, diff --git a/vm.go b/vm.go index 20ceb77e2..cdedcae99 100644 --- a/vm.go +++ b/vm.go @@ -26,7 +26,9 @@ import ( ) // The VM interface is described at -// https://www.kernel.org/doc/Documentation/sysctl/vm.txt +// +// https://www.kernel.org/doc/Documentation/sysctl/vm.txt +// // Each setting is exposed as a single file. // Each file contains one line with a single numerical value, except lowmem_reserve_ratio which holds an array // and numa_zonelist_order (deprecated) which is a string. From 757109e395022a3e3723634ea7a66751d3eb5416 Mon Sep 17 00:00:00 2001 From: Scott Laird Date: Sat, 17 Dec 2022 11:31:26 -0800 Subject: [PATCH 049/176] Add support for several /sys/class/sas_* classes (#453) * Initial addition of several sysfs/class_sas* files, plus fixtures. These parse several SAS classes from /sys/class/ - sas_host - sas_device - sas_end_device - sas_expander - sas_port - sas_phy The included fixtures include examples of all of these. Signed-off-by: Scott Laird --- sysfs/class_sas_device.go | 209 ++ sysfs/class_sas_device_test.go | 228 ++ sysfs/class_sas_host.go | 122 + sysfs/class_sas_host_test.go | 125 + sysfs/class_sas_phy.go | 166 + sysfs/class_sas_phy_test.go | 242 ++ sysfs/class_sas_port.go | 139 + sysfs/class_sas_port_test.go | 163 + testdata/fixtures.ttar | 5910 ++++++++++++++++++++++++++++++++ 9 files changed, 7304 insertions(+) create mode 100644 sysfs/class_sas_device.go create mode 100644 sysfs/class_sas_device_test.go create mode 100644 sysfs/class_sas_host.go create mode 100644 sysfs/class_sas_host_test.go create mode 100644 sysfs/class_sas_phy.go create mode 100644 sysfs/class_sas_phy_test.go create mode 100644 sysfs/class_sas_port.go create mode 100644 sysfs/class_sas_port_test.go diff --git a/sysfs/class_sas_device.go b/sysfs/class_sas_device.go new file mode 100644 index 000000000..61361bef4 --- /dev/null +++ b/sysfs/class_sas_device.go @@ -0,0 +1,209 @@ +// Copyright 2022 The Prometheus Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//go:build linux +// +build linux + +package sysfs + +import ( + "io/ioutil" + "os" + "path/filepath" + "regexp" + + "github.com/prometheus/procfs/internal/util" +) + +const ( + sasDeviceClassPath = "class/sas_device" + sasEndDeviceClassPath = "class/sas_end_device" + sasExpanderClassPath = "class/sas_expander" +) + +type SASDevice struct { + Name string // /sys/class/sas_device/ + SASAddress string // /sys/class/sas_device//sas_address + SASPhys []string // /sys/class/sas_device//device/phy-* + SASPorts []string // /sys/class/sas_device//device/ports-* + BlockDevices []string // /sys/class/sas_device//device/target*/*/block/* +} + +type SASDeviceClass map[string]*SASDevice + +var ( + sasTargetDeviceRegexp = regexp.MustCompile(`^target[0-9:]+$`) + sasTargetSubDeviceRegexp = regexp.MustCompile(`[0-9]+:.*`) +) + +// sasDeviceClasses reads all of the SAS devices from a specific set +// of /sys/class/sas*/ entries. The sas_device, sas_end_device, and +// sas_expander classes are all nearly identical and can be handled by the same basic code. + +func (fs FS) parseSASDeviceClass(dir string) (SASDeviceClass, error) { + path := fs.sys.Path(dir) + + dirs, err := ioutil.ReadDir(path) + if err != nil { + return nil, err + } + + sdc := make(SASDeviceClass, len(dirs)) + + for _, d := range dirs { + device, err := fs.parseSASDevice(d.Name()) + if err != nil { + return nil, err + } + + sdc[device.Name] = device + } + + return sdc, nil +} + +// SASDeviceClass parses devices in /sys/class/sas_device. +func (fs FS) SASDeviceClass() (SASDeviceClass, error) { + return fs.parseSASDeviceClass(sasDeviceClassPath) +} + +// SASEndDeviceClass parses devices in /sys/class/sas_end_device. +// This is a subset of sas_device, and excludes expanders. +func (fs FS) SASEndDeviceClass() (SASDeviceClass, error) { + return fs.parseSASDeviceClass(sasEndDeviceClassPath) +} + +// SASExpanderClass parses devices in /sys/class/sas_expander. +// This is a subset of sas_device, but only includes expanders. +func (fs FS) SASExpanderClass() (SASDeviceClass, error) { + return fs.parseSASDeviceClass(sasExpanderClassPath) +} + +// Parse a single sas_device. This uses /sys/class/sas_device, as +// it's a superset of the other two directories so there's no reason +// to plumb the path through to here. +func (fs FS) parseSASDevice(name string) (*SASDevice, error) { + device := SASDevice{Name: name} + + devicepath := fs.sys.Path(filepath.Join(sasDeviceClassPath, name, "device")) + + dirs, err := ioutil.ReadDir(devicepath) + if err != nil { + return nil, err + } + + for _, d := range dirs { + if sasPhyDeviceRegexp.MatchString(d.Name()) { + device.SASPhys = append(device.SASPhys, d.Name()) + } + if sasPortDeviceRegexp.MatchString(d.Name()) { + device.SASPorts = append(device.SASPorts, d.Name()) + } + } + + address := fs.sys.Path(sasDeviceClassPath, name, "sas_address") + value, err := util.SysReadFile(address) + if err != nil { + return nil, err + } + device.SASAddress = value + + device.BlockDevices, err = fs.blockSASDeviceBlockDevices(name) + if err != nil { + return nil, err + } + + return &device, nil +} + +// Identify block devices that map to a specific SAS Device +// This info comes from (for example) +// /sys/class/sas_device/end_device-11:2/device/target11:0:0/11:0:0:0/block/sdp +// +// To find that, we have to look in the device directory for target$X +// subdirs, then specific subdirs of $X, then read from directory +// names in the 'block/' subdirectory under that. This really +// shouldn't be this hard. +func (fs FS) blockSASDeviceBlockDevices(name string) ([]string, error) { + var devices []string + + devicepath := fs.sys.Path(filepath.Join(sasDeviceClassPath, name, "device")) + + dirs, err := ioutil.ReadDir(devicepath) + if err != nil { + return nil, err + } + + for _, d := range dirs { + if sasTargetDeviceRegexp.MatchString(d.Name()) { + targetdir := d.Name() + + subtargets, err := ioutil.ReadDir(filepath.Join(devicepath, targetdir)) + if err != nil { + return nil, err + } + + for _, targetsubdir := range subtargets { + + if !sasTargetSubDeviceRegexp.MatchString(targetsubdir.Name()) { + // need to skip 'power', 'subsys', etc. + continue + } + + blocks, err := ioutil.ReadDir(filepath.Join(devicepath, targetdir, targetsubdir.Name(), "block")) + if err != nil { + if os.IsNotExist(err) { + continue + } else { + return nil, err + } + } + + for _, blockdevice := range blocks { + devices = append(devices, blockdevice.Name()) + } + } + } + } + + return devices, nil +} + +// GetByName returns the SASDevice with the provided name. +func (sdc *SASDeviceClass) GetByName(name string) *SASDevice { + return (*sdc)[name] +} + +// GetByPhy finds the SASDevice that contains the provided PHY name. +func (sdc *SASDeviceClass) GetByPhy(name string) *SASDevice { + for _, d := range *sdc { + for _, p := range d.SASPhys { + if p == name { + return d + } + } + } + return nil +} + +// GetByPort finds the SASDevice that contains the provided SAS Port name. +func (sdc *SASDeviceClass) GetByPort(name string) *SASDevice { + for _, d := range *sdc { + for _, p := range d.SASPorts { + if p == name { + return d + } + } + } + return nil +} diff --git a/sysfs/class_sas_device_test.go b/sysfs/class_sas_device_test.go new file mode 100644 index 000000000..0128306e1 --- /dev/null +++ b/sysfs/class_sas_device_test.go @@ -0,0 +1,228 @@ +// Copyright 2022 The Prometheus Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//go:build linux +// +build linux + +package sysfs + +import ( + "testing" + + "github.com/google/go-cmp/cmp" +) + +func TestSASDeviceClass(t *testing.T) { + fs, err := NewFS(sysTestFixtures) + if err != nil { + t.Fatal(err) + } + + got, err := fs.SASDeviceClass() + if err != nil { + t.Fatal(err) + } + + want := SASDeviceClass{ + "end_device-11:0:0": { + Name: "end_device-11:0:0", + SASAddress: "0x5000ccab02009402", + BlockDevices: []string{"sdv"}, + }, + "end_device-11:0:1": { + Name: "end_device-11:0:1", + SASAddress: "0x5000cca26128b1f5", + BlockDevices: []string{"sdw"}, + }, + "end_device-11:0:2": { + Name: "end_device-11:0:2", + SASAddress: "0x5000ccab02009406", + BlockDevices: []string{"sdx"}, + }, + "end_device-11:2": { + Name: "end_device-11:2", + SASAddress: "0x5000cca0506b5f1d", + BlockDevices: []string{"sdp"}, + }, + "expander-11:0": { + Name: "expander-11:0", + SASAddress: "0x5000ccab0200947e", + SASPhys: []string{ + "phy-11:0:10", "phy-11:0:11", "phy-11:0:12", + "phy-11:0:13", "phy-11:0:14", "phy-11:0:15", + "phy-11:0:2", "phy-11:0:4", "phy-11:0:6", + "phy-11:0:7", "phy-11:0:8", "phy-11:0:9", + }, + SASPorts: []string{ + "port-11:0:0", "port-11:0:1", + "port-11:0:2", + }, + }, + "expander-11:1": { + Name: "expander-11:1", + SASAddress: "0x5003048001e8967f", + }, + } + + if diff := cmp.Diff(want, got); diff != "" { + t.Fatalf("unexpected SASDevice class (-want +got):\n%s", diff) + } +} + +func TestSASEndDeviceClass(t *testing.T) { + fs, err := NewFS(sysTestFixtures) + if err != nil { + t.Fatal(err) + } + + got, err := fs.SASEndDeviceClass() + if err != nil { + t.Fatal(err) + } + + want := SASDeviceClass{ + "end_device-11:0:0": { + Name: "end_device-11:0:0", + SASAddress: "0x5000ccab02009402", + BlockDevices: []string{"sdv"}, + }, + "end_device-11:0:1": { + Name: "end_device-11:0:1", + SASAddress: "0x5000cca26128b1f5", + BlockDevices: []string{"sdw"}, + }, + "end_device-11:0:2": { + Name: "end_device-11:0:2", + SASAddress: "0x5000ccab02009406", + BlockDevices: []string{"sdx"}, + }, + "end_device-11:2": { + Name: "end_device-11:2", + SASAddress: "0x5000cca0506b5f1d", + BlockDevices: []string{"sdp"}, + }, + } + + if diff := cmp.Diff(want, got); diff != "" { + t.Fatalf("unexpected SASDevice class (-want +got):\n%s", diff) + } +} + +func TestSASExpanderClass(t *testing.T) { + fs, err := NewFS(sysTestFixtures) + if err != nil { + t.Fatal(err) + } + + got, err := fs.SASExpanderClass() + if err != nil { + t.Fatal(err) + } + + want := SASDeviceClass{ + "expander-11:0": { + Name: "expander-11:0", + SASAddress: "0x5000ccab0200947e", + SASPhys: []string{ + "phy-11:0:10", "phy-11:0:11", "phy-11:0:12", + "phy-11:0:13", "phy-11:0:14", "phy-11:0:15", + "phy-11:0:2", "phy-11:0:4", "phy-11:0:6", + "phy-11:0:7", "phy-11:0:8", "phy-11:0:9", + }, + SASPorts: []string{ + "port-11:0:0", "port-11:0:1", + "port-11:0:2", + }, + }, + "expander-11:1": { + Name: "expander-11:1", + SASAddress: "0x5003048001e8967f", + }, + } + + if diff := cmp.Diff(want, got); diff != "" { + t.Fatalf("unexpected SASDevice class (-want +got):\n%s", diff) + } +} + +func TestSASDeviceGetByName(t *testing.T) { + fs, err := NewFS(sysTestFixtures) + if err != nil { + t.Fatal(err) + } + + dc, err := fs.SASDeviceClass() + if err != nil { + t.Fatal(err) + } + + want := "expander-11:0" + got := dc.GetByName("expander-11:0").Name + if diff := cmp.Diff(want, got); diff != "" { + t.Fatalf("unexpected SASDevice name (-want +got):\n%s", diff) + } + + // Doesn't exist. + got2 := dc.GetByName("expander-15") + if got2 != nil { + t.Fatalf("unexpected GetByName response: got %v want nil", got2) + } +} + +func TestSASDeviceGetByPhy(t *testing.T) { + fs, err := NewFS(sysTestFixtures) + if err != nil { + t.Fatal(err) + } + + dc, err := fs.SASDeviceClass() + if err != nil { + t.Fatal(err) + } + + want := "expander-11:0" + got := dc.GetByPhy("phy-11:0:11").Name + if diff := cmp.Diff(want, got); diff != "" { + t.Fatalf("unexpected SASDevice class (-want +got):\n%s", diff) + } + + // Doesn't exist. + got2 := dc.GetByPhy("phy-12:0") + if got2 != nil { + t.Fatalf("unexpected GetByPhy response: got %v want nil", got2) + } +} + +func TestSASDeviceGetByPort(t *testing.T) { + fs, err := NewFS(sysTestFixtures) + if err != nil { + t.Fatal(err) + } + + dc, err := fs.SASDeviceClass() + if err != nil { + t.Fatal(err) + } + + want := "expander-11:0" + got := dc.GetByPort("port-11:0:0").Name + if diff := cmp.Diff(want, got); diff != "" { + t.Fatalf("unexpected SASDevice class (-want +got):\n%s", diff) + } + + // Doesn't exist. + got2 := dc.GetByPort("port-12:0") + if got2 != nil { + t.Fatalf("unexpected GetByPhy response: got %v want nil", got2) + } +} diff --git a/sysfs/class_sas_host.go b/sysfs/class_sas_host.go new file mode 100644 index 000000000..783902b35 --- /dev/null +++ b/sysfs/class_sas_host.go @@ -0,0 +1,122 @@ +// Copyright 2021 The Prometheus Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//go:build linux +// +build linux + +package sysfs + +import ( + "io/ioutil" + "path/filepath" + "regexp" +) + +const sasHostClassPath = "class/sas_host" + +type SASHost struct { + Name string // /sys/class/sas_host/ + SASPhys []string // /sys/class/sas_host//device/phy-* + SASPorts []string // /sys/class/sas_host//device/ports-* +} + +type SASHostClass map[string]*SASHost + +var ( + sasPhyDeviceRegexp = regexp.MustCompile(`^phy-[0-9:]+$`) + sasPortDeviceRegexp = regexp.MustCompile(`^port-[0-9:]+$`) +) + +// SASHostClass parses host[0-9]+ devices in /sys/class/sas_host. +// This generally only exists so that it can pull in SAS Port and SAS +// PHY entries. +// +// The sas_host class doesn't collect any obvious statistics. Each +// sas_host contains a scsi_host, which seems to collect a couple +// minor stats (ioc_reset_count and reply_queue_count), but they're +// not worth collecting at this time. There are more useful SAS stats +// in the sas_phy class. +func (fs FS) SASHostClass() (SASHostClass, error) { + path := fs.sys.Path(sasHostClassPath) + + dirs, err := ioutil.ReadDir(path) + if err != nil { + return nil, err + } + + shc := make(SASHostClass, len(dirs)) + + for _, d := range dirs { + host, err := fs.parseSASHost(d.Name()) + if err != nil { + return nil, err + } + + shc[host.Name] = host + } + + return shc, nil +} + +// Parse a single sas_host. +func (fs FS) parseSASHost(name string) (*SASHost, error) { + //path := fs.sys.Path(sasHostClassPath, name) + host := SASHost{Name: name} + + devicepath := fs.sys.Path(filepath.Join(sasHostClassPath, name, "device")) + + dirs, err := ioutil.ReadDir(devicepath) + if err != nil { + return nil, err + } + + for _, d := range dirs { + if sasPhyDeviceRegexp.MatchString(d.Name()) { + host.SASPhys = append(host.SASPhys, d.Name()) + } + if sasPortDeviceRegexp.MatchString(d.Name()) { + host.SASPorts = append(host.SASPorts, d.Name()) + } + } + + return &host, nil +} + +// GetByName returns the SASHost with the provided name. +func (shc *SASHostClass) GetByName(hostName string) *SASHost { + return (*shc)[hostName] +} + +// GetByPhy finds the SASHost that contains the provided PHY name. +func (shc *SASHostClass) GetByPhy(phyName string) *SASHost { + for _, h := range *shc { + for _, p := range h.SASPhys { + if p == phyName { + return h + } + } + } + return nil +} + +// GetByPort finds the SASHost that contains the provided SAS Port name. +func (shc *SASHostClass) GetByPort(portName string) *SASHost { + for _, h := range *shc { + for _, p := range h.SASPorts { + if p == portName { + return h + } + } + } + return nil +} diff --git a/sysfs/class_sas_host_test.go b/sysfs/class_sas_host_test.go new file mode 100644 index 000000000..8d6e067f3 --- /dev/null +++ b/sysfs/class_sas_host_test.go @@ -0,0 +1,125 @@ +// Copyright 2021 The Prometheus Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//go:build linux +// +build linux + +package sysfs + +import ( + "testing" + + "github.com/google/go-cmp/cmp" +) + +func TestSASHostClass(t *testing.T) { + fs, err := NewFS(sysTestFixtures) + if err != nil { + t.Fatal(err) + } + + got, err := fs.SASHostClass() + if err != nil { + t.Fatal(err) + } + + want := SASHostClass{ + "host11": &SASHost{ + Name: "host11", + SASPhys: []string{ + "phy-11:10", "phy-11:11", "phy-11:12", "phy-11:13", + "phy-11:14", "phy-11:15", "phy-11:7", "phy-11:8", + "phy-11:9", + }, + SASPorts: []string{ + "port-11:0", "port-11:1", "port-11:2", + }, + }, + } + + if diff := cmp.Diff(want, got); diff != "" { + t.Fatalf("unexpected SASHost class (-want +got):\n%s", diff) + } +} + +func TestSASHostGetByName(t *testing.T) { + fs, err := NewFS(sysTestFixtures) + if err != nil { + t.Fatal(err) + } + + hc, err := fs.SASHostClass() + if err != nil { + t.Fatal(err) + } + + want := "host11" + got := hc.GetByName("host11").Name + if diff := cmp.Diff(want, got); diff != "" { + t.Fatalf("unexpected SASHost class (-want +got):\n%s", diff) + } + + // Doesn't exist. + got2 := hc.GetByName("host12") + if got2 != nil { + t.Fatalf("unexpected GetByName response: got %v want nil", got2) + } +} + +func TestSASHostGetByPhy(t *testing.T) { + fs, err := NewFS(sysTestFixtures) + if err != nil { + t.Fatal(err) + } + + hc, err := fs.SASHostClass() + if err != nil { + t.Fatal(err) + } + + want := "host11" + got := hc.GetByPhy("phy-11:11").Name + if diff := cmp.Diff(want, got); diff != "" { + t.Fatalf("unexpected SASHost class (-want +got):\n%s", diff) + } + + // Doesn't exist. + got2 := hc.GetByPhy("phy-12:0") + if got2 != nil { + t.Fatalf("unexpected GetByPhy response: got %v want nil", got2) + } +} + +func TestSASHostGetByPort(t *testing.T) { + fs, err := NewFS(sysTestFixtures) + if err != nil { + t.Fatal(err) + } + + hc, err := fs.SASHostClass() + if err != nil { + t.Fatal(err) + } + + want := "host11" + got := hc.GetByPort("port-11:0").Name + if diff := cmp.Diff(want, got); diff != "" { + t.Fatalf("unexpected SASHost class (-want +got):\n%s", diff) + } + + // Doesn't exist. + got2 := hc.GetByPort("port-12:0") + if got2 != nil { + t.Fatalf("unexpected GetByPhy response: got %v want nil", got2) + } +} diff --git a/sysfs/class_sas_phy.go b/sysfs/class_sas_phy.go new file mode 100644 index 000000000..9e028db1d --- /dev/null +++ b/sysfs/class_sas_phy.go @@ -0,0 +1,166 @@ +// Copyright 2021 The Prometheus Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//go:build linux +// +build linux + +package sysfs + +import ( + "fmt" + "io/ioutil" + "os" + "path/filepath" + "strconv" + "strings" + + "github.com/prometheus/procfs/internal/util" +) + +const sasPhyClassPath = "class/sas_phy" + +type SASPhy struct { + Name string // /sys/class/sas_phy/ + SASAddress string // /sys/class/sas_phy//sas_address + SASPort string // /sys/class/sas_phy//device/ports + DeviceType string // /sys/class/sas_phy//device_type + InitiatorPortProtocols []string // /sys/class/sas_phy//initiator_port_protocols + InvalidDwordCount int // /sys/class/sas_phy//invalid_dword_count + LossOfDwordSyncCount int // /sys/class/sas_phy//loss_of_dword_sync_count + MaximumLinkrate float64 // /sys/class/sas_phy//maximum_linkrate + MaximumLinkrateHW float64 // /sys/class/sas_phy//maximum_linkrate_hw + MinimumLinkrate float64 // /sys/class/sas_phy//minimum_linkrate + MinimumLinkrateHW float64 // /sys/class/sas_phy//minimum_linkrate_hw + NegotiatedLinkrate float64 // /sys/class/sas_phy//negotiated_linkrate + PhyIdentifier string // /sys/class/sas_phy//phy_identifier + PhyResetProblemCount int // /sys/class/sas_phy//phy_reset_problem_count + RunningDisparityErrorCount int // /sys/class/sas_phy//running_disparity_error_count + TargetPortProtocols []string // /sys/class/sas_phy//target_port_protocols +} + +type SASPhyClass map[string]*SASPhy + +// SASPhyClass parses entries in /sys/class/sas_phy. +func (fs FS) SASPhyClass() (SASPhyClass, error) { + path := fs.sys.Path(sasPhyClassPath) + + dirs, err := ioutil.ReadDir(path) + if err != nil { + return nil, err + } + + spc := make(SASPhyClass, len(dirs)) + + for _, d := range dirs { + phy, err := fs.parseSASPhy(d.Name()) + if err != nil { + return nil, err + } + + spc[phy.Name] = phy + } + + return spc, nil +} + +// Parse a single sas_phy. +func (fs FS) parseSASPhy(name string) (*SASPhy, error) { + phy := SASPhy{Name: name} + + phypath := fs.sys.Path(filepath.Join(sasPhyClassPath, name)) + phydevicepath := filepath.Join(phypath, "device") + + link, err := os.Readlink(filepath.Join(phydevicepath, "port")) + + if err == nil { + if sasPortDeviceRegexp.MatchString(filepath.Base(link)) { + phy.SASPort = filepath.Base(link) + } + } + + files, err := ioutil.ReadDir(phypath) + if err != nil { + return nil, err + } + for _, f := range files { + name := filepath.Join(phypath, f.Name()) + fileinfo, _ := os.Stat(name) + if fileinfo.Mode().IsRegular() { + value, err := util.SysReadFile(name) + if err != nil { + if os.IsPermission(err) { + continue + } else { + return nil, fmt.Errorf("failed to read file %q: %w", name, err) + } + } + + vp := util.NewValueParser(value) + switch f.Name() { + case "sas_address": + phy.SASAddress = value + case "device_type": + phy.DeviceType = value + case "initiator_port_protocols": + phy.InitiatorPortProtocols = strings.Split(value, ", ") + case "invalid_dword_count": + phy.InvalidDwordCount = vp.Int() + case "loss_of_dword_sync_count": + phy.LossOfDwordSyncCount = vp.Int() + case "maximum_linkrate": + phy.MaximumLinkrate = parseLinkrate(value) + case "maximum_linkrate_hw": + phy.MaximumLinkrateHW = parseLinkrate(value) + case "minimum_linkrate": + phy.MinimumLinkrate = parseLinkrate(value) + case "minimum_linkrate_hw": + phy.MinimumLinkrateHW = parseLinkrate(value) + case "negotiated_linkrate": + phy.NegotiatedLinkrate = parseLinkrate(value) + case "phy_identifier": + phy.PhyIdentifier = value + case "phy_reset_problem_count": + phy.PhyResetProblemCount = vp.Int() + case "running_disparity_error_count": + phy.RunningDisparityErrorCount = vp.Int() + case "target_port_protocols": + phy.TargetPortProtocols = strings.Split(value, ", ") + } + + if err := vp.Err(); err != nil { + return nil, err + } + } + } + + return &phy, nil +} + +// parseLinkRate turns the kernel's SAS linkrate values into floats. +// The kernel returns values like "12.0 Gbit". Valid speeds are +// currently 1.5, 3.0, 6.0, 12.0, and up. This is a float to cover +// the 1.5 Gbps case. A value of 0 is returned if the speed can't be +// parsed. +func parseLinkrate(value string) float64 { + f := strings.Split(value, " ")[0] + gb, err := strconv.ParseFloat(f, 64) + if err != nil { + return 0 + } + return gb +} + +// GetByName returns the SASPhy with the provided name. +func (spc *SASPhyClass) GetByName(name string) *SASPhy { + return (*spc)[name] +} diff --git a/sysfs/class_sas_phy_test.go b/sysfs/class_sas_phy_test.go new file mode 100644 index 000000000..f586fb4cd --- /dev/null +++ b/sysfs/class_sas_phy_test.go @@ -0,0 +1,242 @@ +// Copyright 2021 The Prometheus Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//go:build linux +// +build linux + +package sysfs + +import ( + "testing" + + "github.com/google/go-cmp/cmp" +) + +func TestSASPhyClass(t *testing.T) { + fs, err := NewFS(sysTestFixtures) + if err != nil { + t.Fatal(err) + } + + got, err := fs.SASPhyClass() + if err != nil { + t.Fatal(err) + } + + want := SASPhyClass{ + "phy-11:0:2": { + Name: "phy-11:0:2", + SASAddress: "0x5000ccab0200947e", + SASPort: "port-11:0:0", + DeviceType: "edge expander", + InitiatorPortProtocols: []string{"smp"}, + InvalidDwordCount: 18, + LossOfDwordSyncCount: 1, + MaximumLinkrate: 12, + MaximumLinkrateHW: 12, + MinimumLinkrate: 1.5, + MinimumLinkrateHW: 1.5, + NegotiatedLinkrate: 6, + PhyIdentifier: "2", + RunningDisparityErrorCount: 18, + TargetPortProtocols: []string{"smp"}, + }, + "phy-11:0:4": { + Name: "phy-11:0:4", + SASAddress: "0x5000ccab0200947e", + SASPort: "port-11:0:1", + DeviceType: "edge expander", + InitiatorPortProtocols: []string{"smp"}, + InvalidDwordCount: 1, + MaximumLinkrate: 12, + MaximumLinkrateHW: 12, + MinimumLinkrate: 1.5, + MinimumLinkrateHW: 1.5, + NegotiatedLinkrate: 12, + PhyIdentifier: "4", + RunningDisparityErrorCount: 1, + TargetPortProtocols: []string{"smp"}, + }, + "phy-11:0:6": { + Name: "phy-11:0:6", + SASAddress: "0x5000ccab0200947e", + SASPort: "port-11:0:2", + DeviceType: "edge expander", + InitiatorPortProtocols: []string{"smp"}, + InvalidDwordCount: 19, + LossOfDwordSyncCount: 1, + MaximumLinkrate: 12, + MaximumLinkrateHW: 12, + MinimumLinkrate: 1.5, + MinimumLinkrateHW: 1.5, + NegotiatedLinkrate: 6, + PhyIdentifier: "6", + RunningDisparityErrorCount: 20, + TargetPortProtocols: []string{"smp"}, + }, + "phy-11:10": { + Name: "phy-11:10", + SASAddress: "0x500062b2047b51c4", + SASPort: "port-11:0", + DeviceType: "end device", + InitiatorPortProtocols: []string{"smp", "stp", "ssp"}, + MaximumLinkrate: 12, + MaximumLinkrateHW: 12, + MinimumLinkrate: 3, + MinimumLinkrateHW: 1.5, + NegotiatedLinkrate: 12, + PhyIdentifier: "10", + TargetPortProtocols: []string{"none"}, + }, + "phy-11:11": { + Name: "phy-11:11", + SASAddress: "0x500062b2047b51c4", + SASPort: "port-11:0", + DeviceType: "end device", + InitiatorPortProtocols: []string{"smp", "stp", "ssp"}, + MaximumLinkrate: 12, + MaximumLinkrateHW: 12, + MinimumLinkrate: 3, + MinimumLinkrateHW: 1.5, + NegotiatedLinkrate: 12, + PhyIdentifier: "11", + TargetPortProtocols: []string{"none"}, + }, + "phy-11:12": { + Name: "phy-11:12", + SASAddress: "0x500062b2047b51c4", + SASPort: "port-11:1", + DeviceType: "end device", + InitiatorPortProtocols: []string{"smp", "stp", "ssp"}, + MaximumLinkrate: 12, + MaximumLinkrateHW: 12, + MinimumLinkrate: 3, + MinimumLinkrateHW: 1.5, + NegotiatedLinkrate: 6, + PhyIdentifier: "12", + TargetPortProtocols: []string{"none"}, + }, + "phy-11:13": { + Name: "phy-11:13", + SASAddress: "0x500062b2047b51c4", + SASPort: "port-11:1", + DeviceType: "end device", + InitiatorPortProtocols: []string{"smp", "stp", "ssp"}, + MaximumLinkrate: 12, + MaximumLinkrateHW: 12, + MinimumLinkrate: 3, + MinimumLinkrateHW: 1.5, + NegotiatedLinkrate: 6, + PhyIdentifier: "13", + TargetPortProtocols: []string{"none"}, + }, + "phy-11:14": { + Name: "phy-11:14", + SASAddress: "0x500062b2047b51c4", + SASPort: "port-11:1", + DeviceType: "end device", + InitiatorPortProtocols: []string{"smp", "stp", "ssp"}, + MaximumLinkrate: 12, + MaximumLinkrateHW: 12, + MinimumLinkrate: 3, + MinimumLinkrateHW: 1.5, + NegotiatedLinkrate: 6, + PhyIdentifier: "14", + TargetPortProtocols: []string{"none"}, + }, + "phy-11:15": { + Name: "phy-11:15", + SASAddress: "0x500062b2047b51c4", + SASPort: "port-11:1", + DeviceType: "end device", + InitiatorPortProtocols: []string{"smp", "stp", "ssp"}, + MaximumLinkrate: 12, + MaximumLinkrateHW: 12, + MinimumLinkrate: 3, + MinimumLinkrateHW: 1.5, + NegotiatedLinkrate: 6, + PhyIdentifier: "15", + TargetPortProtocols: []string{"none"}, + }, + "phy-11:7": { + Name: "phy-11:7", + SASAddress: "0x500062b2047b51c4", + SASPort: "port-11:2", + DeviceType: "end device", + InitiatorPortProtocols: []string{"smp", "stp", "ssp"}, + MaximumLinkrate: 12, + MaximumLinkrateHW: 12, + MinimumLinkrate: 3, + MinimumLinkrateHW: 1.5, + NegotiatedLinkrate: 12, + PhyIdentifier: "7", + TargetPortProtocols: []string{"none"}, + }, + "phy-11:8": { + Name: "phy-11:8", + SASAddress: "0x500062b2047b51c4", + SASPort: "port-11:0", + DeviceType: "end device", + InitiatorPortProtocols: []string{"smp", "stp", "ssp"}, + MaximumLinkrate: 12, + MaximumLinkrateHW: 12, + MinimumLinkrate: 3, + MinimumLinkrateHW: 1.5, + NegotiatedLinkrate: 12, + PhyIdentifier: "8", + TargetPortProtocols: []string{"none"}, + }, + "phy-11:9": { + Name: "phy-11:9", + SASAddress: "0x500062b2047b51c4", + SASPort: "port-11:0", + DeviceType: "end device", + InitiatorPortProtocols: []string{"smp", "stp", "ssp"}, + MaximumLinkrate: 12, + MaximumLinkrateHW: 12, + MinimumLinkrate: 3, + MinimumLinkrateHW: 1.5, + NegotiatedLinkrate: 12, + PhyIdentifier: "9", + TargetPortProtocols: []string{"none"}, + }, + } + + if diff := cmp.Diff(want, got); diff != "" { + t.Fatalf("unexpected SASPhy class (-want +got):\n%s", diff) + } +} + +func TestSASPhyGetByName(t *testing.T) { + fs, err := NewFS(sysTestFixtures) + if err != nil { + t.Fatal(err) + } + + pc, err := fs.SASPhyClass() + if err != nil { + t.Fatal(err) + } + + want := "phy-11:9" + got := pc.GetByName("phy-11:9").Name + if diff := cmp.Diff(want, got); diff != "" { + t.Fatalf("unexpected SASPhy class (-want +got):\n%s", diff) + } + + // Doesn't exist. + got2 := pc.GetByName("phy-12:0") + if got2 != nil { + t.Fatalf("unexpected GetByName response: got %v want nil", got2) + } +} diff --git a/sysfs/class_sas_port.go b/sysfs/class_sas_port.go new file mode 100644 index 000000000..6d625bc9b --- /dev/null +++ b/sysfs/class_sas_port.go @@ -0,0 +1,139 @@ +// Copyright 2021 The Prometheus Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//go:build linux +// +build linux + +package sysfs + +import ( + "io/ioutil" + "path/filepath" + "regexp" +) + +const sasPortClassPath = "class/sas_port" + +type SASPort struct { + Name string // /sys/class/sas_device/ + SASPhys []string // /sys/class/sas_device//device/phy-* + Expanders []string // /sys/class/sas_port//device/expander-* + EndDevices []string // /sys/class/sas_port//device/end_device-* +} + +type SASPortClass map[string]*SASPort + +var ( + sasExpanderDeviceRegexp = regexp.MustCompile(`^expander-[0-9:]+$`) + sasEndDeviceRegexp = regexp.MustCompile(`^end_device-[0-9:]+$`) +) + +// SASPortClass parses ports in /sys/class/sas_port. +// +// A SAS port in this context is a collection of SAS PHYs operating +// together. For example, it's common to have 8-lane SAS cards that +// have 2 external connectors, each of which carries 4 SAS lanes over +// a SFF-8088 or SFF-8644 connector. While it's possible to split +// those 4 lanes into 4 different cables wired directly into +// individual drives, it's more common to connect them all to a SAS +// expander. This gives you 4x the bandwidth between the expander and +// the SAS host, and is represented by a sas-port object which +// contains 4 sas-phy objects. +func (fs FS) SASPortClass() (SASPortClass, error) { + path := fs.sys.Path(sasPortClassPath) + + dirs, err := ioutil.ReadDir(path) + if err != nil { + return nil, err + } + + spc := make(SASPortClass, len(dirs)) + + for _, d := range dirs { + port, err := fs.parseSASPort(d.Name()) + if err != nil { + return nil, err + } + + spc[port.Name] = port + } + + return spc, nil +} + +// Parse a single sas_port. +func (fs FS) parseSASPort(name string) (*SASPort, error) { + port := SASPort{Name: name} + + portpath := fs.sys.Path(filepath.Join(sasPortClassPath, name, "device")) + + dirs, err := ioutil.ReadDir(portpath) + if err != nil { + return nil, err + } + + for _, d := range dirs { + if sasPhyDeviceRegexp.MatchString(d.Name()) { + port.SASPhys = append(port.SASPhys, d.Name()) + } + if sasExpanderDeviceRegexp.MatchString(d.Name()) { + port.Expanders = append(port.Expanders, d.Name()) + } + if sasEndDeviceRegexp.MatchString(d.Name()) { + port.EndDevices = append(port.EndDevices, d.Name()) + } + } + + return &port, nil +} + +// GetByName returns the SASPort with the provided name. +func (spc *SASPortClass) GetByName(name string) *SASPort { + return (*spc)[name] +} + +// GetByPhy finds the SASPort that contains the provided PHY name. +func (spc *SASPortClass) GetByPhy(name string) *SASPort { + for _, d := range *spc { + for _, p := range d.SASPhys { + if p == name { + return d + } + } + } + return nil +} + +// GetByExpander finds the SASPort that contains the provided SAS expander name. +func (spc *SASPortClass) GetByExpander(name string) *SASPort { + for _, d := range *spc { + for _, e := range d.Expanders { + if e == name { + return d + } + } + } + return nil +} + +// GetByEndDevice finds the SASPort that contains the provided SAS end device name. +func (spc *SASPortClass) GetByEndDevice(name string) *SASPort { + for _, d := range *spc { + for _, e := range d.EndDevices { + if e == name { + return d + } + } + } + return nil +} diff --git a/sysfs/class_sas_port_test.go b/sysfs/class_sas_port_test.go new file mode 100644 index 000000000..56668b1fe --- /dev/null +++ b/sysfs/class_sas_port_test.go @@ -0,0 +1,163 @@ +// Copyright 2021 The Prometheus Authors +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//go:build linux +// +build linux + +package sysfs + +import ( + "testing" + + "github.com/google/go-cmp/cmp" +) + +func TestSASPortClass(t *testing.T) { + fs, err := NewFS(sysTestFixtures) + if err != nil { + t.Fatal(err) + } + + got, err := fs.SASPortClass() + if err != nil { + t.Fatal(err) + } + + want := SASPortClass{ + "port-11:0": { + Name: "port-11:0", + SASPhys: []string{"phy-11:10", "phy-11:11", "phy-11:8", "phy-11:9"}, + Expanders: []string{"expander-11:0"}, + }, + "port-11:0:0": { + Name: "port-11:0:0", + SASPhys: []string{"phy-11:0:2"}, + EndDevices: []string{"end_device-11:0:0"}, + }, + "port-11:0:1": { + Name: "port-11:0:1", + SASPhys: []string{"phy-11:0:4"}, + EndDevices: []string{"end_device-11:0:1"}, + }, + "port-11:0:2": { + Name: "port-11:0:2", + SASPhys: []string{"phy-11:0:6"}, + EndDevices: []string{"end_device-11:0:2"}, + }, + "port-11:1": { + Name: "port-11:1", + SASPhys: []string{"phy-11:12", "phy-11:13", "phy-11:14", "phy-11:15"}, + Expanders: []string{"expander-11:1"}, + }, + } + + if diff := cmp.Diff(want, got); diff != "" { + t.Fatalf("unexpected SASDevice class (-want +got):\n%s", diff) + } +} + +func TestSASPortGetByName(t *testing.T) { + fs, err := NewFS(sysTestFixtures) + if err != nil { + t.Fatal(err) + } + + dc, err := fs.SASPortClass() + if err != nil { + t.Fatal(err) + } + + want := "port-11:0:0" + got := dc.GetByName("port-11:0:0").Name + if diff := cmp.Diff(want, got); diff != "" { + t.Fatalf("unexpected SASPort name (-want +got):\n%s", diff) + } + + // Doesn't exist. + got2 := dc.GetByName("port-15") + if got2 != nil { + t.Fatalf("unexpected GetByName response: got %v want nil", got2) + } +} + +func TestSASPortGetByPhy(t *testing.T) { + fs, err := NewFS(sysTestFixtures) + if err != nil { + t.Fatal(err) + } + + dc, err := fs.SASPortClass() + if err != nil { + t.Fatal(err) + } + + want := "port-11:0:2" + got := dc.GetByPhy("phy-11:0:6").Name + if diff := cmp.Diff(want, got); diff != "" { + t.Fatalf("unexpected SASPort class (-want +got):\n%s", diff) + } + + // Doesn't exist. + got2 := dc.GetByPhy("phy-12:0") + if got2 != nil { + t.Fatalf("unexpected GetByPhy response: got %v want nil", got2) + } +} + +func TestSASPortGetByExpander(t *testing.T) { + fs, err := NewFS(sysTestFixtures) + if err != nil { + t.Fatal(err) + } + + dc, err := fs.SASPortClass() + if err != nil { + t.Fatal(err) + } + + want := "port-11:0" + got := dc.GetByExpander("expander-11:0").Name + if diff := cmp.Diff(want, got); diff != "" { + t.Fatalf("unexpected SASPort class (-want +got):\n%s", diff) + } + + // Doesn't exist. + got2 := dc.GetByExpander("expander-12:0") + if got2 != nil { + t.Fatalf("unexpected GetByPhy response: got %v want nil", got2) + } +} + +func TestSASPortGetByEndDevice(t *testing.T) { + fs, err := NewFS(sysTestFixtures) + if err != nil { + t.Fatal(err) + } + + dc, err := fs.SASPortClass() + if err != nil { + t.Fatal(err) + } + + want := "port-11:0:2" + got := dc.GetByEndDevice("end_device-11:0:2").Name + if diff := cmp.Diff(want, got); diff != "" { + t.Fatalf("unexpected SASPort class (-want +got):\n%s", diff) + } + + // Doesn't exist. + got2 := dc.GetByEndDevice("end_device-12:0") + if got2 != nil { + t.Fatalf("unexpected GetByPhy response: got %v want nil", got2) + } +} diff --git a/testdata/fixtures.ttar b/testdata/fixtures.ttar index 43c896567..9caaa084a 100644 --- a/testdata/fixtures.ttar +++ b/testdata/fixtures.ttar @@ -5213,6 +5213,114 @@ Path: fixtures/sys/class/powercap/intel-rapl:a/uevent Lines: 0 Mode: 644 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/class/sas_device +Mode: 775 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/class/sas_device/end_device-11:0:0 +SymlinkTo: ../../devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/sas_device/end_device-11:0:0 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/class/sas_device/end_device-11:0:1 +SymlinkTo: ../../devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:1/end_device-11:0:1/sas_device/end_device-11:0:1 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/class/sas_device/end_device-11:0:2 +SymlinkTo: ../../devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:2/end_device-11:0:2/sas_device/end_device-11:0:2 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/class/sas_device/end_device-11:2 +SymlinkTo: ../../devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:2/end_device-11:2/sas_device/end_device-11:2 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/class/sas_device/expander-11:0 +SymlinkTo: ../../devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/sas_device/expander-11:0 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/class/sas_device/expander-11:1 +SymlinkTo: ../../devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:1/expander-11:1/sas_device/expander-11:1 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/class/sas_end_device +Mode: 775 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/class/sas_end_device/end_device-11:0:0 +SymlinkTo: ../../devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/sas_device/end_device-11:0:0 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/class/sas_end_device/end_device-11:0:1 +SymlinkTo: ../../devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:1/end_device-11:0:1/sas_device/end_device-11:0:1 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/class/sas_end_device/end_device-11:0:2 +SymlinkTo: ../../devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:2/end_device-11:0:2/sas_device/end_device-11:0:2 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/class/sas_end_device/end_device-11:2 +SymlinkTo: ../../devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:2/end_device-11:2/sas_device/end_device-11:2 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/class/sas_expander +Mode: 775 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/class/sas_expander/expander-11:0 +SymlinkTo: ../../devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/sas_expander/expander-11:0 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/class/sas_expander/expander-11:1 +SymlinkTo: ../../devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:1/expander-11:1/sas_expander/expander-11:1 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/class/sas_host +Mode: 775 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/class/sas_host/host11 +SymlinkTo: ../../devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/sas_host/host11 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/class/sas_phy +Mode: 775 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/class/sas_phy/phy-11:0:2 +SymlinkTo: ../../devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:2/sas_phy/phy-11:0:2 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/class/sas_phy/phy-11:0:4 +SymlinkTo: ../../devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:4/sas_phy/phy-11:0:4 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/class/sas_phy/phy-11:0:6 +SymlinkTo: ../../devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:6/sas_phy/phy-11:0:6 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/class/sas_phy/phy-11:10 +SymlinkTo: ../../devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:10/sas_phy/phy-11:10 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/class/sas_phy/phy-11:11 +SymlinkTo: ../../devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:11/sas_phy/phy-11:11 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/class/sas_phy/phy-11:12 +SymlinkTo: ../../devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:12/sas_phy/phy-11:12 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/class/sas_phy/phy-11:13 +SymlinkTo: ../../devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:13/sas_phy/phy-11:13 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/class/sas_phy/phy-11:14 +SymlinkTo: ../../devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:14/sas_phy/phy-11:14 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/class/sas_phy/phy-11:15 +SymlinkTo: ../../devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:15/sas_phy/phy-11:15 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/class/sas_phy/phy-11:7 +SymlinkTo: ../../devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:7/sas_phy/phy-11:7 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/class/sas_phy/phy-11:8 +SymlinkTo: ../../devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:8/sas_phy/phy-11:8 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/class/sas_phy/phy-11:9 +SymlinkTo: ../../devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:9/sas_phy/phy-11:9 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/class/sas_port +Mode: 775 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/class/sas_port/port-11:0 +SymlinkTo: ../../devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/sas_port/port-11:0 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/class/sas_port/port-11:0:0 +SymlinkTo: ../../devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/sas_port/port-11:0:0 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/class/sas_port/port-11:0:1 +SymlinkTo: ../../devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:1/sas_port/port-11:0:1 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/class/sas_port/port-11:0:2 +SymlinkTo: ../../devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:2/sas_port/port-11:0:2 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/class/sas_port/port-11:1 +SymlinkTo: ../../devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:1/sas_port/port-11:1 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Directory: fixtures/sys/class/scsi_tape Mode: 755 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -6120,6 +6228,5808 @@ Lines: 1 5233597394395EOF Mode: 444 # ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/pci0000:00/0000:00:03.0 +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:00:03.0:pcie001 +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:00:03.0:pcie001/driver +SymlinkTo: ../../../../bus/pci_express/drivers/pcie_pme +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:00:03.0:pcie001/subsystem +SymlinkTo: ../../../../bus/pci_express +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:00:03.0:pcie001/uevent +Lines: 1 +DRIVER=pcie_pme +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:00:03.0:pcie010 +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:00:03.0:pcie010/subsystem +SymlinkTo: ../../../../bus/pci_express +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:00:03.0:pcie010/uevent +Lines: 0 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0 +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/aer_dev_correctable +Lines: 9 +RxErr 0 +BadTLP 0 +BadDLLP 0 +Rollover 0 +Timeout 0 +NonFatalErr 0 +CorrIntErr 0 +HeaderOF 0 +TOTAL_ERR_COR 0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/aer_dev_fatal +Lines: 19 +Undefined 0 +DLP 0 +SDES 0 +TLP 0 +FCP 0 +CmpltTO 0 +CmpltAbrt 0 +UnxCmplt 0 +RxOF 0 +MalfTLP 0 +ECRC 0 +UnsupReq 0 +ACSViol 0 +UncorrIntErr 0 +BlockedTLP 0 +AtomicOpBlocked 0 +TLPBlockedErr 0 +PoisonTLPBlocked 0 +TOTAL_ERR_FATAL 0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/aer_dev_nonfatal +Lines: 19 +Undefined 0 +DLP 0 +SDES 0 +TLP 0 +FCP 0 +CmpltTO 0 +CmpltAbrt 0 +UnxCmplt 0 +RxOF 0 +MalfTLP 0 +ECRC 0 +UnsupReq 0 +ACSViol 0 +UncorrIntErr 0 +BlockedTLP 0 +AtomicOpBlocked 0 +TLPBlockedErr 0 +PoisonTLPBlocked 0 +TOTAL_ERR_NONFATAL 0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/ari_enabled +Lines: 1 +1 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/broken_parity_status +Lines: 1 +0 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/class +Lines: 1 +0x010700 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/config +Lines: 1 +NULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTE NULLBYTENULLBYTENULLBYTENULLBYTENULLBYTE NULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTE NULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTE@0NULLBYTENULLBYTE@NULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTE NULLBYTENULLBYTEPNULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTEpNULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTE#d ) NULLBYTE|CNULLBYTE@NULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTE NULLBYTENULLBYTENULLBYTE0NULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTE@NULLBYTE0 FNULLBYTENULLBYTE NULLBYTENULLBYTENULLBYTE`NULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTEA%NULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTE'NULLBYTE'NULLBYTE'NULLBYTE'NULLBYTE'NULLBYTE'NULLBYTE'NULLBYTE'NULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTESNULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTEA%NULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTEA(NULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTE NULLBYTEA8NULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTE@NULLBYTENULLBYTENULLBYTEC1NULLBYTEK0NULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTECDT?NULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTE NULLBYTE;NULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTE'NULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTE@NULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTEEOF +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/consistent_dma_mask_bits +Lines: 1 +63 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/current_link_speed +Lines: 1 +8.0 GT/s PCIe +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/current_link_width +Lines: 1 +8 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/d3cold_allowed +Lines: 1 +1 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/device +Lines: 1 +0x00ab +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/dma_mask_bits +Lines: 1 +63 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/driver +SymlinkTo: ../../../../bus/pci/drivers/mpt3sas +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/driver_override +Lines: 1 +(null) +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/enable +Lines: 1 +1 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/firmware_node +SymlinkTo: ../../../LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:a6/device:a7 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11 +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/bsg +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/bsg/sas_host11 +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/bsg/sas_host11/dev +Lines: 1 +243:4 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/bsg/sas_host11/device +SymlinkTo: ../../../host11 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/bsg/sas_host11/subsystem +SymlinkTo: ../../../../../../../class/bsg +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/bsg/sas_host11/uevent +Lines: 3 +MAJOR=243 +MINOR=4 +DEVNAME=bsg/sas_host11 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:10 +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:10/port +SymlinkTo: ../port-11:0 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:10/sas_phy +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:10/sas_phy/phy-11:10 +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:10/sas_phy/phy-11:10/device +SymlinkTo: ../../../phy-11:10 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:10/sas_phy/phy-11:10/device_type +Lines: 1 +end device +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:10/sas_phy/phy-11:10/enable +Lines: 1 +1 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:10/sas_phy/phy-11:10/initiator_port_protocols +Lines: 1 +smp, stp, ssp +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:10/sas_phy/phy-11:10/invalid_dword_count +Lines: 1 +0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:10/sas_phy/phy-11:10/loss_of_dword_sync_count +Lines: 1 +0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:10/sas_phy/phy-11:10/maximum_linkrate +Lines: 1 +12.0 Gbit +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:10/sas_phy/phy-11:10/maximum_linkrate_hw +Lines: 1 +12.0 Gbit +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:10/sas_phy/phy-11:10/minimum_linkrate +Lines: 1 +3.0 Gbit +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:10/sas_phy/phy-11:10/minimum_linkrate_hw +Lines: 1 +1.5 Gbit +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:10/sas_phy/phy-11:10/negotiated_linkrate +Lines: 1 +12.0 Gbit +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:10/sas_phy/phy-11:10/phy_identifier +Lines: 1 +10 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:10/sas_phy/phy-11:10/phy_reset_problem_count +Lines: 1 +0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:10/sas_phy/phy-11:10/running_disparity_error_count +Lines: 1 +0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:10/sas_phy/phy-11:10/sas_address +Lines: 1 +0x500062b2047b51c4 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:10/sas_phy/phy-11:10/subsystem +SymlinkTo: ../../../../../../../../class/sas_phy +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:10/sas_phy/phy-11:10/target_port_protocols +Lines: 1 +none +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:10/sas_phy/phy-11:10/uevent +Lines: 0 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:10/uevent +Lines: 0 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:11 +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:11/port +SymlinkTo: ../port-11:0 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:11/sas_phy +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:11/sas_phy/phy-11:11 +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:11/sas_phy/phy-11:11/device +SymlinkTo: ../../../phy-11:11 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:11/sas_phy/phy-11:11/device_type +Lines: 1 +end device +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:11/sas_phy/phy-11:11/enable +Lines: 1 +1 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:11/sas_phy/phy-11:11/initiator_port_protocols +Lines: 1 +smp, stp, ssp +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:11/sas_phy/phy-11:11/invalid_dword_count +Lines: 1 +0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:11/sas_phy/phy-11:11/loss_of_dword_sync_count +Lines: 1 +0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:11/sas_phy/phy-11:11/maximum_linkrate +Lines: 1 +12.0 Gbit +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:11/sas_phy/phy-11:11/maximum_linkrate_hw +Lines: 1 +12.0 Gbit +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:11/sas_phy/phy-11:11/minimum_linkrate +Lines: 1 +3.0 Gbit +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:11/sas_phy/phy-11:11/minimum_linkrate_hw +Lines: 1 +1.5 Gbit +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:11/sas_phy/phy-11:11/negotiated_linkrate +Lines: 1 +12.0 Gbit +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:11/sas_phy/phy-11:11/phy_identifier +Lines: 1 +11 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:11/sas_phy/phy-11:11/phy_reset_problem_count +Lines: 1 +0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:11/sas_phy/phy-11:11/running_disparity_error_count +Lines: 1 +0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:11/sas_phy/phy-11:11/sas_address +Lines: 1 +0x500062b2047b51c4 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:11/sas_phy/phy-11:11/subsystem +SymlinkTo: ../../../../../../../../class/sas_phy +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:11/sas_phy/phy-11:11/target_port_protocols +Lines: 1 +none +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:11/sas_phy/phy-11:11/uevent +Lines: 0 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:11/uevent +Lines: 0 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:12 +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:12/port +SymlinkTo: ../port-11:1 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:12/sas_phy +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:12/sas_phy/phy-11:12 +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:12/sas_phy/phy-11:12/device +SymlinkTo: ../../../phy-11:12 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:12/sas_phy/phy-11:12/device_type +Lines: 1 +end device +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:12/sas_phy/phy-11:12/enable +Lines: 1 +1 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:12/sas_phy/phy-11:12/initiator_port_protocols +Lines: 1 +smp, stp, ssp +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:12/sas_phy/phy-11:12/invalid_dword_count +Lines: 1 +0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:12/sas_phy/phy-11:12/loss_of_dword_sync_count +Lines: 1 +0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:12/sas_phy/phy-11:12/maximum_linkrate +Lines: 1 +12.0 Gbit +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:12/sas_phy/phy-11:12/maximum_linkrate_hw +Lines: 1 +12.0 Gbit +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:12/sas_phy/phy-11:12/minimum_linkrate +Lines: 1 +3.0 Gbit +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:12/sas_phy/phy-11:12/minimum_linkrate_hw +Lines: 1 +1.5 Gbit +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:12/sas_phy/phy-11:12/negotiated_linkrate +Lines: 1 +6.0 Gbit +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:12/sas_phy/phy-11:12/phy_identifier +Lines: 1 +12 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:12/sas_phy/phy-11:12/phy_reset_problem_count +Lines: 1 +0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:12/sas_phy/phy-11:12/running_disparity_error_count +Lines: 1 +0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:12/sas_phy/phy-11:12/sas_address +Lines: 1 +0x500062b2047b51c4 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:12/sas_phy/phy-11:12/subsystem +SymlinkTo: ../../../../../../../../class/sas_phy +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:12/sas_phy/phy-11:12/target_port_protocols +Lines: 1 +none +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:12/sas_phy/phy-11:12/uevent +Lines: 0 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:12/uevent +Lines: 0 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:13 +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:13/port +SymlinkTo: ../port-11:1 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:13/sas_phy +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:13/sas_phy/phy-11:13 +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:13/sas_phy/phy-11:13/device +SymlinkTo: ../../../phy-11:13 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:13/sas_phy/phy-11:13/device_type +Lines: 1 +end device +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:13/sas_phy/phy-11:13/enable +Lines: 1 +1 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:13/sas_phy/phy-11:13/initiator_port_protocols +Lines: 1 +smp, stp, ssp +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:13/sas_phy/phy-11:13/invalid_dword_count +Lines: 1 +0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:13/sas_phy/phy-11:13/loss_of_dword_sync_count +Lines: 1 +0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:13/sas_phy/phy-11:13/maximum_linkrate +Lines: 1 +12.0 Gbit +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:13/sas_phy/phy-11:13/maximum_linkrate_hw +Lines: 1 +12.0 Gbit +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:13/sas_phy/phy-11:13/minimum_linkrate +Lines: 1 +3.0 Gbit +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:13/sas_phy/phy-11:13/minimum_linkrate_hw +Lines: 1 +1.5 Gbit +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:13/sas_phy/phy-11:13/negotiated_linkrate +Lines: 1 +6.0 Gbit +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:13/sas_phy/phy-11:13/phy_identifier +Lines: 1 +13 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:13/sas_phy/phy-11:13/phy_reset_problem_count +Lines: 1 +0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:13/sas_phy/phy-11:13/running_disparity_error_count +Lines: 1 +0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:13/sas_phy/phy-11:13/sas_address +Lines: 1 +0x500062b2047b51c4 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:13/sas_phy/phy-11:13/subsystem +SymlinkTo: ../../../../../../../../class/sas_phy +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:13/sas_phy/phy-11:13/target_port_protocols +Lines: 1 +none +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:13/sas_phy/phy-11:13/uevent +Lines: 0 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:13/uevent +Lines: 0 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:14 +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:14/port +SymlinkTo: ../port-11:1 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:14/sas_phy +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:14/sas_phy/phy-11:14 +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:14/sas_phy/phy-11:14/device +SymlinkTo: ../../../phy-11:14 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:14/sas_phy/phy-11:14/device_type +Lines: 1 +end device +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:14/sas_phy/phy-11:14/enable +Lines: 1 +1 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:14/sas_phy/phy-11:14/initiator_port_protocols +Lines: 1 +smp, stp, ssp +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:14/sas_phy/phy-11:14/invalid_dword_count +Lines: 1 +0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:14/sas_phy/phy-11:14/loss_of_dword_sync_count +Lines: 1 +0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:14/sas_phy/phy-11:14/maximum_linkrate +Lines: 1 +12.0 Gbit +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:14/sas_phy/phy-11:14/maximum_linkrate_hw +Lines: 1 +12.0 Gbit +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:14/sas_phy/phy-11:14/minimum_linkrate +Lines: 1 +3.0 Gbit +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:14/sas_phy/phy-11:14/minimum_linkrate_hw +Lines: 1 +1.5 Gbit +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:14/sas_phy/phy-11:14/negotiated_linkrate +Lines: 1 +6.0 Gbit +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:14/sas_phy/phy-11:14/phy_identifier +Lines: 1 +14 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:14/sas_phy/phy-11:14/phy_reset_problem_count +Lines: 1 +0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:14/sas_phy/phy-11:14/running_disparity_error_count +Lines: 1 +0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:14/sas_phy/phy-11:14/sas_address +Lines: 1 +0x500062b2047b51c4 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:14/sas_phy/phy-11:14/subsystem +SymlinkTo: ../../../../../../../../class/sas_phy +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:14/sas_phy/phy-11:14/target_port_protocols +Lines: 1 +none +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:14/sas_phy/phy-11:14/uevent +Lines: 0 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:14/uevent +Lines: 0 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:15 +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:15/port +SymlinkTo: ../port-11:1 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:15/sas_phy +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:15/sas_phy/phy-11:15 +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:15/sas_phy/phy-11:15/device +SymlinkTo: ../../../phy-11:15 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:15/sas_phy/phy-11:15/device_type +Lines: 1 +end device +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:15/sas_phy/phy-11:15/enable +Lines: 1 +1 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:15/sas_phy/phy-11:15/initiator_port_protocols +Lines: 1 +smp, stp, ssp +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:15/sas_phy/phy-11:15/invalid_dword_count +Lines: 1 +0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:15/sas_phy/phy-11:15/loss_of_dword_sync_count +Lines: 1 +0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:15/sas_phy/phy-11:15/maximum_linkrate +Lines: 1 +12.0 Gbit +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:15/sas_phy/phy-11:15/maximum_linkrate_hw +Lines: 1 +12.0 Gbit +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:15/sas_phy/phy-11:15/minimum_linkrate +Lines: 1 +3.0 Gbit +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:15/sas_phy/phy-11:15/minimum_linkrate_hw +Lines: 1 +1.5 Gbit +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:15/sas_phy/phy-11:15/negotiated_linkrate +Lines: 1 +6.0 Gbit +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:15/sas_phy/phy-11:15/phy_identifier +Lines: 1 +15 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:15/sas_phy/phy-11:15/phy_reset_problem_count +Lines: 1 +0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:15/sas_phy/phy-11:15/running_disparity_error_count +Lines: 1 +0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:15/sas_phy/phy-11:15/sas_address +Lines: 1 +0x500062b2047b51c4 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:15/sas_phy/phy-11:15/subsystem +SymlinkTo: ../../../../../../../../class/sas_phy +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:15/sas_phy/phy-11:15/target_port_protocols +Lines: 1 +none +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:15/sas_phy/phy-11:15/uevent +Lines: 0 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:15/uevent +Lines: 0 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:7 +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:7/port +SymlinkTo: ../port-11:2 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:7/sas_phy +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:7/sas_phy/phy-11:7 +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:7/sas_phy/phy-11:7/device +SymlinkTo: ../../../phy-11:7 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:7/sas_phy/phy-11:7/device_type +Lines: 1 +end device +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:7/sas_phy/phy-11:7/enable +Lines: 1 +1 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:7/sas_phy/phy-11:7/initiator_port_protocols +Lines: 1 +smp, stp, ssp +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:7/sas_phy/phy-11:7/invalid_dword_count +Lines: 1 +0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:7/sas_phy/phy-11:7/loss_of_dword_sync_count +Lines: 1 +0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:7/sas_phy/phy-11:7/maximum_linkrate +Lines: 1 +12.0 Gbit +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:7/sas_phy/phy-11:7/maximum_linkrate_hw +Lines: 1 +12.0 Gbit +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:7/sas_phy/phy-11:7/minimum_linkrate +Lines: 1 +3.0 Gbit +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:7/sas_phy/phy-11:7/minimum_linkrate_hw +Lines: 1 +1.5 Gbit +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:7/sas_phy/phy-11:7/negotiated_linkrate +Lines: 1 +12.0 Gbit +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:7/sas_phy/phy-11:7/phy_identifier +Lines: 1 +7 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:7/sas_phy/phy-11:7/phy_reset_problem_count +Lines: 1 +0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:7/sas_phy/phy-11:7/running_disparity_error_count +Lines: 1 +0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:7/sas_phy/phy-11:7/sas_address +Lines: 1 +0x500062b2047b51c4 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:7/sas_phy/phy-11:7/subsystem +SymlinkTo: ../../../../../../../../class/sas_phy +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:7/sas_phy/phy-11:7/target_port_protocols +Lines: 1 +none +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:7/sas_phy/phy-11:7/uevent +Lines: 0 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:7/uevent +Lines: 0 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:8 +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:8/port +SymlinkTo: ../port-11:0 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:8/sas_phy +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:8/sas_phy/phy-11:8 +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:8/sas_phy/phy-11:8/device +SymlinkTo: ../../../phy-11:8 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:8/sas_phy/phy-11:8/device_type +Lines: 1 +end device +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:8/sas_phy/phy-11:8/enable +Lines: 1 +1 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:8/sas_phy/phy-11:8/initiator_port_protocols +Lines: 1 +smp, stp, ssp +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:8/sas_phy/phy-11:8/invalid_dword_count +Lines: 1 +0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:8/sas_phy/phy-11:8/loss_of_dword_sync_count +Lines: 1 +0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:8/sas_phy/phy-11:8/maximum_linkrate +Lines: 1 +12.0 Gbit +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:8/sas_phy/phy-11:8/maximum_linkrate_hw +Lines: 1 +12.0 Gbit +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:8/sas_phy/phy-11:8/minimum_linkrate +Lines: 1 +3.0 Gbit +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:8/sas_phy/phy-11:8/minimum_linkrate_hw +Lines: 1 +1.5 Gbit +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:8/sas_phy/phy-11:8/negotiated_linkrate +Lines: 1 +12.0 Gbit +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:8/sas_phy/phy-11:8/phy_identifier +Lines: 1 +8 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:8/sas_phy/phy-11:8/phy_reset_problem_count +Lines: 1 +0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:8/sas_phy/phy-11:8/running_disparity_error_count +Lines: 1 +0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:8/sas_phy/phy-11:8/sas_address +Lines: 1 +0x500062b2047b51c4 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:8/sas_phy/phy-11:8/subsystem +SymlinkTo: ../../../../../../../../class/sas_phy +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:8/sas_phy/phy-11:8/target_port_protocols +Lines: 1 +none +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:8/sas_phy/phy-11:8/uevent +Lines: 0 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:8/uevent +Lines: 0 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:9 +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:9/port +SymlinkTo: ../port-11:0 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:9/sas_phy +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:9/sas_phy/phy-11:9 +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:9/sas_phy/phy-11:9/device +SymlinkTo: ../../../phy-11:9 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:9/sas_phy/phy-11:9/device_type +Lines: 1 +end device +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:9/sas_phy/phy-11:9/enable +Lines: 1 +1 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:9/sas_phy/phy-11:9/initiator_port_protocols +Lines: 1 +smp, stp, ssp +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:9/sas_phy/phy-11:9/invalid_dword_count +Lines: 1 +0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:9/sas_phy/phy-11:9/loss_of_dword_sync_count +Lines: 1 +0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:9/sas_phy/phy-11:9/maximum_linkrate +Lines: 1 +12.0 Gbit +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:9/sas_phy/phy-11:9/maximum_linkrate_hw +Lines: 1 +12.0 Gbit +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:9/sas_phy/phy-11:9/minimum_linkrate +Lines: 1 +3.0 Gbit +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:9/sas_phy/phy-11:9/minimum_linkrate_hw +Lines: 1 +1.5 Gbit +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:9/sas_phy/phy-11:9/negotiated_linkrate +Lines: 1 +12.0 Gbit +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:9/sas_phy/phy-11:9/phy_identifier +Lines: 1 +9 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:9/sas_phy/phy-11:9/phy_reset_problem_count +Lines: 1 +0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:9/sas_phy/phy-11:9/running_disparity_error_count +Lines: 1 +0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:9/sas_phy/phy-11:9/sas_address +Lines: 1 +0x500062b2047b51c4 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:9/sas_phy/phy-11:9/subsystem +SymlinkTo: ../../../../../../../../class/sas_phy +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:9/sas_phy/phy-11:9/target_port_protocols +Lines: 1 +none +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:9/sas_phy/phy-11:9/uevent +Lines: 0 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/phy-11:9/uevent +Lines: 0 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0 +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0 +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/bsg +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/bsg/expander-11:0 +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/bsg/expander-11:0/dev +Lines: 1 +243:8 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/bsg/expander-11:0/device +SymlinkTo: ../../../expander-11:0 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/bsg/expander-11:0/subsystem +SymlinkTo: ../../../../../../../../../class/bsg +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/bsg/expander-11:0/uevent +Lines: 3 +MAJOR=243 +MINOR=8 +DEVNAME=bsg/expander-11:0 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:10 +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:10/port +SymlinkTo: ../port-11:0:4 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:10/sas_phy +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:10/sas_phy/phy-11:0:10 +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:10/sas_phy/phy-11:0:10/device +SymlinkTo: ../../../phy-11:0:10 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:10/sas_phy/phy-11:0:10/device_type +Lines: 1 +edge expander +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:10/sas_phy/phy-11:0:10/enable +Lines: 1 +1 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:10/sas_phy/phy-11:0:10/initiator_port_protocols +Lines: 1 +smp +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:10/sas_phy/phy-11:0:10/invalid_dword_count +Lines: 1 +20 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:10/sas_phy/phy-11:0:10/loss_of_dword_sync_count +Lines: 1 +1 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:10/sas_phy/phy-11:0:10/maximum_linkrate +Lines: 1 +12.0 Gbit +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:10/sas_phy/phy-11:0:10/maximum_linkrate_hw +Lines: 1 +12.0 Gbit +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:10/sas_phy/phy-11:0:10/minimum_linkrate +Lines: 1 +1.5 Gbit +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:10/sas_phy/phy-11:0:10/minimum_linkrate_hw +Lines: 1 +1.5 Gbit +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:10/sas_phy/phy-11:0:10/negotiated_linkrate +Lines: 1 +6.0 Gbit +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:10/sas_phy/phy-11:0:10/phy_identifier +Lines: 1 +10 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:10/sas_phy/phy-11:0:10/phy_reset_problem_count +Lines: 1 +0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:10/sas_phy/phy-11:0:10/running_disparity_error_count +Lines: 1 +21 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:10/sas_phy/phy-11:0:10/sas_address +Lines: 1 +0x5000ccab0200947e +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:10/sas_phy/phy-11:0:10/subsystem +SymlinkTo: ../../../../../../../../../../class/sas_phy +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:10/sas_phy/phy-11:0:10/target_port_protocols +Lines: 1 +smp +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:10/sas_phy/phy-11:0:10/uevent +Lines: 0 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:10/uevent +Lines: 0 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:11 +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:11/port +SymlinkTo: ../port-11:0:5 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:11/sas_phy +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:11/sas_phy/phy-11:0:11 +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:11/sas_phy/phy-11:0:11/device +SymlinkTo: ../../../phy-11:0:11 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:11/sas_phy/phy-11:0:11/device_type +Lines: 1 +edge expander +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:11/sas_phy/phy-11:0:11/enable +Lines: 1 +1 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:11/sas_phy/phy-11:0:11/initiator_port_protocols +Lines: 1 +smp +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:11/sas_phy/phy-11:0:11/invalid_dword_count +Lines: 1 +0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:11/sas_phy/phy-11:0:11/loss_of_dword_sync_count +Lines: 1 +0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:11/sas_phy/phy-11:0:11/maximum_linkrate +Lines: 1 +12.0 Gbit +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:11/sas_phy/phy-11:0:11/maximum_linkrate_hw +Lines: 1 +12.0 Gbit +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:11/sas_phy/phy-11:0:11/minimum_linkrate +Lines: 1 +1.5 Gbit +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:11/sas_phy/phy-11:0:11/minimum_linkrate_hw +Lines: 1 +1.5 Gbit +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:11/sas_phy/phy-11:0:11/negotiated_linkrate +Lines: 1 +12.0 Gbit +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:11/sas_phy/phy-11:0:11/phy_identifier +Lines: 1 +11 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:11/sas_phy/phy-11:0:11/phy_reset_problem_count +Lines: 1 +0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:11/sas_phy/phy-11:0:11/running_disparity_error_count +Lines: 1 +0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:11/sas_phy/phy-11:0:11/sas_address +Lines: 1 +0x5000ccab0200947e +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:11/sas_phy/phy-11:0:11/subsystem +SymlinkTo: ../../../../../../../../../../class/sas_phy +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:11/sas_phy/phy-11:0:11/target_port_protocols +Lines: 1 +smp +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:11/sas_phy/phy-11:0:11/uevent +Lines: 0 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:11/uevent +Lines: 0 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:12 +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:12/port +SymlinkTo: ../port-11:0:6 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:12/sas_phy +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:12/sas_phy/phy-11:0:12 +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:12/sas_phy/phy-11:0:12/device +SymlinkTo: ../../../phy-11:0:12 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:12/sas_phy/phy-11:0:12/device_type +Lines: 1 +edge expander +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:12/sas_phy/phy-11:0:12/enable +Lines: 1 +1 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:12/sas_phy/phy-11:0:12/initiator_port_protocols +Lines: 1 +smp +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:12/sas_phy/phy-11:0:12/invalid_dword_count +Lines: 1 +0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:12/sas_phy/phy-11:0:12/loss_of_dword_sync_count +Lines: 1 +0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:12/sas_phy/phy-11:0:12/maximum_linkrate +Lines: 1 +12.0 Gbit +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:12/sas_phy/phy-11:0:12/maximum_linkrate_hw +Lines: 1 +12.0 Gbit +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:12/sas_phy/phy-11:0:12/minimum_linkrate +Lines: 1 +1.5 Gbit +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:12/sas_phy/phy-11:0:12/minimum_linkrate_hw +Lines: 1 +1.5 Gbit +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:12/sas_phy/phy-11:0:12/negotiated_linkrate +Lines: 1 +12.0 Gbit +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:12/sas_phy/phy-11:0:12/phy_identifier +Lines: 1 +12 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:12/sas_phy/phy-11:0:12/phy_reset_problem_count +Lines: 1 +0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:12/sas_phy/phy-11:0:12/running_disparity_error_count +Lines: 1 +0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:12/sas_phy/phy-11:0:12/sas_address +Lines: 1 +0x5000ccab0200947e +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:12/sas_phy/phy-11:0:12/subsystem +SymlinkTo: ../../../../../../../../../../class/sas_phy +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:12/sas_phy/phy-11:0:12/target_port_protocols +Lines: 1 +smp +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:12/sas_phy/phy-11:0:12/uevent +Lines: 0 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:12/uevent +Lines: 0 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:13 +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:13/sas_phy +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:13/sas_phy/phy-11:0:13 +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:13/sas_phy/phy-11:0:13/device +SymlinkTo: ../../../phy-11:0:13 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:13/sas_phy/phy-11:0:13/device_type +Lines: 1 +edge expander +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:13/sas_phy/phy-11:0:13/enable +Lines: 1 +1 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:13/sas_phy/phy-11:0:13/initiator_port_protocols +Lines: 1 +smp +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:13/sas_phy/phy-11:0:13/invalid_dword_count +Lines: 1 +0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:13/sas_phy/phy-11:0:13/loss_of_dword_sync_count +Lines: 1 +0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:13/sas_phy/phy-11:0:13/maximum_linkrate +Lines: 1 +12.0 Gbit +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:13/sas_phy/phy-11:0:13/maximum_linkrate_hw +Lines: 1 +12.0 Gbit +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:13/sas_phy/phy-11:0:13/minimum_linkrate +Lines: 1 +1.5 Gbit +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:13/sas_phy/phy-11:0:13/minimum_linkrate_hw +Lines: 1 +1.5 Gbit +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:13/sas_phy/phy-11:0:13/negotiated_linkrate +Lines: 1 +Unknown +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:13/sas_phy/phy-11:0:13/phy_identifier +Lines: 1 +13 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:13/sas_phy/phy-11:0:13/phy_reset_problem_count +Lines: 1 +0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:13/sas_phy/phy-11:0:13/running_disparity_error_count +Lines: 1 +0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:13/sas_phy/phy-11:0:13/sas_address +Lines: 1 +0x5000ccab0200947e +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:13/sas_phy/phy-11:0:13/subsystem +SymlinkTo: ../../../../../../../../../../class/sas_phy +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:13/sas_phy/phy-11:0:13/target_port_protocols +Lines: 1 +smp +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:13/sas_phy/phy-11:0:13/uevent +Lines: 0 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:13/uevent +Lines: 0 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:14 +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:14/port +SymlinkTo: ../port-11:0:7 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:14/sas_phy +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:14/sas_phy/phy-11:0:14 +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:14/sas_phy/phy-11:0:14/device +SymlinkTo: ../../../phy-11:0:14 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:14/sas_phy/phy-11:0:14/device_type +Lines: 1 +edge expander +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:14/sas_phy/phy-11:0:14/enable +Lines: 1 +1 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:14/sas_phy/phy-11:0:14/initiator_port_protocols +Lines: 1 +smp +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:14/sas_phy/phy-11:0:14/invalid_dword_count +Lines: 1 +1 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:14/sas_phy/phy-11:0:14/loss_of_dword_sync_count +Lines: 1 +0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:14/sas_phy/phy-11:0:14/maximum_linkrate +Lines: 1 +12.0 Gbit +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:14/sas_phy/phy-11:0:14/maximum_linkrate_hw +Lines: 1 +12.0 Gbit +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:14/sas_phy/phy-11:0:14/minimum_linkrate +Lines: 1 +1.5 Gbit +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:14/sas_phy/phy-11:0:14/minimum_linkrate_hw +Lines: 1 +1.5 Gbit +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:14/sas_phy/phy-11:0:14/negotiated_linkrate +Lines: 1 +12.0 Gbit +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:14/sas_phy/phy-11:0:14/phy_identifier +Lines: 1 +14 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:14/sas_phy/phy-11:0:14/phy_reset_problem_count +Lines: 1 +0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:14/sas_phy/phy-11:0:14/running_disparity_error_count +Lines: 1 +1 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:14/sas_phy/phy-11:0:14/sas_address +Lines: 1 +0x5000ccab0200947e +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:14/sas_phy/phy-11:0:14/subsystem +SymlinkTo: ../../../../../../../../../../class/sas_phy +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:14/sas_phy/phy-11:0:14/target_port_protocols +Lines: 1 +smp +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:14/sas_phy/phy-11:0:14/uevent +Lines: 0 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:14/uevent +Lines: 0 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:15 +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:15/port +SymlinkTo: ../port-11:0:8 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:15/sas_phy +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:15/sas_phy/phy-11:0:15 +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:15/sas_phy/phy-11:0:15/device +SymlinkTo: ../../../phy-11:0:15 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:15/sas_phy/phy-11:0:15/device_type +Lines: 1 +edge expander +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:15/sas_phy/phy-11:0:15/enable +Lines: 1 +1 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:15/sas_phy/phy-11:0:15/initiator_port_protocols +Lines: 1 +smp +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:15/sas_phy/phy-11:0:15/invalid_dword_count +Lines: 1 +19 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:15/sas_phy/phy-11:0:15/loss_of_dword_sync_count +Lines: 1 +1 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:15/sas_phy/phy-11:0:15/maximum_linkrate +Lines: 1 +12.0 Gbit +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:15/sas_phy/phy-11:0:15/maximum_linkrate_hw +Lines: 1 +12.0 Gbit +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:15/sas_phy/phy-11:0:15/minimum_linkrate +Lines: 1 +1.5 Gbit +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:15/sas_phy/phy-11:0:15/minimum_linkrate_hw +Lines: 1 +1.5 Gbit +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:15/sas_phy/phy-11:0:15/negotiated_linkrate +Lines: 1 +12.0 Gbit +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:15/sas_phy/phy-11:0:15/phy_identifier +Lines: 1 +15 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:15/sas_phy/phy-11:0:15/phy_reset_problem_count +Lines: 1 +0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:15/sas_phy/phy-11:0:15/running_disparity_error_count +Lines: 1 +18 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:15/sas_phy/phy-11:0:15/sas_address +Lines: 1 +0x5000ccab0200947e +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:15/sas_phy/phy-11:0:15/subsystem +SymlinkTo: ../../../../../../../../../../class/sas_phy +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:15/sas_phy/phy-11:0:15/target_port_protocols +Lines: 1 +smp +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:15/sas_phy/phy-11:0:15/uevent +Lines: 0 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:15/uevent +Lines: 0 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:2 +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:2/port +SymlinkTo: ../port-11:0:0 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:2/sas_phy +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:2/sas_phy/phy-11:0:2 +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:2/sas_phy/phy-11:0:2/device +SymlinkTo: ../../../phy-11:0:2 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:2/sas_phy/phy-11:0:2/device_type +Lines: 1 +edge expander +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:2/sas_phy/phy-11:0:2/enable +Lines: 1 +1 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:2/sas_phy/phy-11:0:2/initiator_port_protocols +Lines: 1 +smp +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:2/sas_phy/phy-11:0:2/invalid_dword_count +Lines: 1 +18 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:2/sas_phy/phy-11:0:2/loss_of_dword_sync_count +Lines: 1 +1 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:2/sas_phy/phy-11:0:2/maximum_linkrate +Lines: 1 +12.0 Gbit +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:2/sas_phy/phy-11:0:2/maximum_linkrate_hw +Lines: 1 +12.0 Gbit +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:2/sas_phy/phy-11:0:2/minimum_linkrate +Lines: 1 +1.5 Gbit +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:2/sas_phy/phy-11:0:2/minimum_linkrate_hw +Lines: 1 +1.5 Gbit +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:2/sas_phy/phy-11:0:2/negotiated_linkrate +Lines: 1 +6.0 Gbit +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:2/sas_phy/phy-11:0:2/phy_identifier +Lines: 1 +2 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:2/sas_phy/phy-11:0:2/phy_reset_problem_count +Lines: 1 +0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:2/sas_phy/phy-11:0:2/running_disparity_error_count +Lines: 1 +18 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:2/sas_phy/phy-11:0:2/sas_address +Lines: 1 +0x5000ccab0200947e +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:2/sas_phy/phy-11:0:2/subsystem +SymlinkTo: ../../../../../../../../../../class/sas_phy +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:2/sas_phy/phy-11:0:2/target_port_protocols +Lines: 1 +smp +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:2/sas_phy/phy-11:0:2/uevent +Lines: 0 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:2/uevent +Lines: 0 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:4 +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:4/port +SymlinkTo: ../port-11:0:1 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:4/sas_phy +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:4/sas_phy/phy-11:0:4 +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:4/sas_phy/phy-11:0:4/device +SymlinkTo: ../../../phy-11:0:4 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:4/sas_phy/phy-11:0:4/device_type +Lines: 1 +edge expander +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:4/sas_phy/phy-11:0:4/enable +Lines: 1 +1 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:4/sas_phy/phy-11:0:4/initiator_port_protocols +Lines: 1 +smp +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:4/sas_phy/phy-11:0:4/invalid_dword_count +Lines: 1 +1 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:4/sas_phy/phy-11:0:4/loss_of_dword_sync_count +Lines: 1 +0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:4/sas_phy/phy-11:0:4/maximum_linkrate +Lines: 1 +12.0 Gbit +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:4/sas_phy/phy-11:0:4/maximum_linkrate_hw +Lines: 1 +12.0 Gbit +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:4/sas_phy/phy-11:0:4/minimum_linkrate +Lines: 1 +1.5 Gbit +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:4/sas_phy/phy-11:0:4/minimum_linkrate_hw +Lines: 1 +1.5 Gbit +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:4/sas_phy/phy-11:0:4/negotiated_linkrate +Lines: 1 +12.0 Gbit +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:4/sas_phy/phy-11:0:4/phy_identifier +Lines: 1 +4 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:4/sas_phy/phy-11:0:4/phy_reset_problem_count +Lines: 1 +0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:4/sas_phy/phy-11:0:4/running_disparity_error_count +Lines: 1 +1 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:4/sas_phy/phy-11:0:4/sas_address +Lines: 1 +0x5000ccab0200947e +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:4/sas_phy/phy-11:0:4/subsystem +SymlinkTo: ../../../../../../../../../../class/sas_phy +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:4/sas_phy/phy-11:0:4/target_port_protocols +Lines: 1 +smp +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:4/sas_phy/phy-11:0:4/uevent +Lines: 0 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:4/uevent +Lines: 0 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:6 +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:6/port +SymlinkTo: ../port-11:0:2 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:6/sas_phy +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:6/sas_phy/phy-11:0:6 +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:6/sas_phy/phy-11:0:6/device +SymlinkTo: ../../../phy-11:0:6 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:6/sas_phy/phy-11:0:6/device_type +Lines: 1 +edge expander +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:6/sas_phy/phy-11:0:6/enable +Lines: 1 +1 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:6/sas_phy/phy-11:0:6/initiator_port_protocols +Lines: 1 +smp +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:6/sas_phy/phy-11:0:6/invalid_dword_count +Lines: 1 +19 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:6/sas_phy/phy-11:0:6/loss_of_dword_sync_count +Lines: 1 +1 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:6/sas_phy/phy-11:0:6/maximum_linkrate +Lines: 1 +12.0 Gbit +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:6/sas_phy/phy-11:0:6/maximum_linkrate_hw +Lines: 1 +12.0 Gbit +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:6/sas_phy/phy-11:0:6/minimum_linkrate +Lines: 1 +1.5 Gbit +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:6/sas_phy/phy-11:0:6/minimum_linkrate_hw +Lines: 1 +1.5 Gbit +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:6/sas_phy/phy-11:0:6/negotiated_linkrate +Lines: 1 +6.0 Gbit +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:6/sas_phy/phy-11:0:6/phy_identifier +Lines: 1 +6 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:6/sas_phy/phy-11:0:6/phy_reset_problem_count +Lines: 1 +0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:6/sas_phy/phy-11:0:6/running_disparity_error_count +Lines: 1 +20 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:6/sas_phy/phy-11:0:6/sas_address +Lines: 1 +0x5000ccab0200947e +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:6/sas_phy/phy-11:0:6/subsystem +SymlinkTo: ../../../../../../../../../../class/sas_phy +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:6/sas_phy/phy-11:0:6/target_port_protocols +Lines: 1 +smp +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:6/sas_phy/phy-11:0:6/uevent +Lines: 0 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:6/uevent +Lines: 0 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:7 +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:7/sas_phy +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:7/sas_phy/phy-11:0:7 +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:7/sas_phy/phy-11:0:7/device +SymlinkTo: ../../../phy-11:0:7 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:7/sas_phy/phy-11:0:7/device_type +Lines: 1 +edge expander +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:7/sas_phy/phy-11:0:7/enable +Lines: 1 +1 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:7/sas_phy/phy-11:0:7/initiator_port_protocols +Lines: 1 +smp +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:7/sas_phy/phy-11:0:7/invalid_dword_count +Lines: 1 +0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:7/sas_phy/phy-11:0:7/loss_of_dword_sync_count +Lines: 1 +0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:7/sas_phy/phy-11:0:7/maximum_linkrate +Lines: 1 +12.0 Gbit +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:7/sas_phy/phy-11:0:7/maximum_linkrate_hw +Lines: 1 +12.0 Gbit +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:7/sas_phy/phy-11:0:7/minimum_linkrate +Lines: 1 +1.5 Gbit +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:7/sas_phy/phy-11:0:7/minimum_linkrate_hw +Lines: 1 +1.5 Gbit +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:7/sas_phy/phy-11:0:7/negotiated_linkrate +Lines: 1 +Unknown +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:7/sas_phy/phy-11:0:7/phy_identifier +Lines: 1 +7 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:7/sas_phy/phy-11:0:7/phy_reset_problem_count +Lines: 1 +0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:7/sas_phy/phy-11:0:7/running_disparity_error_count +Lines: 1 +0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:7/sas_phy/phy-11:0:7/sas_address +Lines: 1 +0x5000ccab0200947e +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:7/sas_phy/phy-11:0:7/subsystem +SymlinkTo: ../../../../../../../../../../class/sas_phy +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:7/sas_phy/phy-11:0:7/target_port_protocols +Lines: 1 +smp +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:7/sas_phy/phy-11:0:7/uevent +Lines: 0 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:7/uevent +Lines: 0 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:8 +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:8/port +SymlinkTo: ../port-11:0:3 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:8/sas_phy +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:8/sas_phy/phy-11:0:8 +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:8/sas_phy/phy-11:0:8/device +SymlinkTo: ../../../phy-11:0:8 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:8/sas_phy/phy-11:0:8/device_type +Lines: 1 +edge expander +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:8/sas_phy/phy-11:0:8/enable +Lines: 1 +1 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:8/sas_phy/phy-11:0:8/initiator_port_protocols +Lines: 1 +smp +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:8/sas_phy/phy-11:0:8/invalid_dword_count +Lines: 1 +0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:8/sas_phy/phy-11:0:8/loss_of_dword_sync_count +Lines: 1 +0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:8/sas_phy/phy-11:0:8/maximum_linkrate +Lines: 1 +12.0 Gbit +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:8/sas_phy/phy-11:0:8/maximum_linkrate_hw +Lines: 1 +12.0 Gbit +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:8/sas_phy/phy-11:0:8/minimum_linkrate +Lines: 1 +1.5 Gbit +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:8/sas_phy/phy-11:0:8/minimum_linkrate_hw +Lines: 1 +1.5 Gbit +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:8/sas_phy/phy-11:0:8/negotiated_linkrate +Lines: 1 +12.0 Gbit +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:8/sas_phy/phy-11:0:8/phy_identifier +Lines: 1 +8 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:8/sas_phy/phy-11:0:8/phy_reset_problem_count +Lines: 1 +0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:8/sas_phy/phy-11:0:8/running_disparity_error_count +Lines: 1 +0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:8/sas_phy/phy-11:0:8/sas_address +Lines: 1 +0x5000ccab0200947e +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:8/sas_phy/phy-11:0:8/subsystem +SymlinkTo: ../../../../../../../../../../class/sas_phy +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:8/sas_phy/phy-11:0:8/target_port_protocols +Lines: 1 +smp +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:8/sas_phy/phy-11:0:8/uevent +Lines: 0 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:8/uevent +Lines: 0 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:9 +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:9/sas_phy +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:9/sas_phy/phy-11:0:9 +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:9/sas_phy/phy-11:0:9/device +SymlinkTo: ../../../phy-11:0:9 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:9/sas_phy/phy-11:0:9/device_type +Lines: 1 +edge expander +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:9/sas_phy/phy-11:0:9/enable +Lines: 1 +1 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:9/sas_phy/phy-11:0:9/initiator_port_protocols +Lines: 1 +smp +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:9/sas_phy/phy-11:0:9/invalid_dword_count +Lines: 1 +0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:9/sas_phy/phy-11:0:9/loss_of_dword_sync_count +Lines: 1 +0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:9/sas_phy/phy-11:0:9/maximum_linkrate +Lines: 1 +12.0 Gbit +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:9/sas_phy/phy-11:0:9/maximum_linkrate_hw +Lines: 1 +12.0 Gbit +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:9/sas_phy/phy-11:0:9/minimum_linkrate +Lines: 1 +1.5 Gbit +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:9/sas_phy/phy-11:0:9/minimum_linkrate_hw +Lines: 1 +1.5 Gbit +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:9/sas_phy/phy-11:0:9/negotiated_linkrate +Lines: 1 +Unknown +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:9/sas_phy/phy-11:0:9/phy_identifier +Lines: 1 +9 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:9/sas_phy/phy-11:0:9/phy_reset_problem_count +Lines: 1 +0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:9/sas_phy/phy-11:0:9/running_disparity_error_count +Lines: 1 +0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:9/sas_phy/phy-11:0:9/sas_address +Lines: 1 +0x5000ccab0200947e +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:9/sas_phy/phy-11:0:9/subsystem +SymlinkTo: ../../../../../../../../../../class/sas_phy +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:9/sas_phy/phy-11:0:9/target_port_protocols +Lines: 1 +smp +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:9/sas_phy/phy-11:0:9/uevent +Lines: 0 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/phy-11:0:9/uevent +Lines: 0 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0 +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0 +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/bsg +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/bsg/end_device-11:0:0 +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/bsg/end_device-11:0:0/dev +Lines: 1 +243:28 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/bsg/end_device-11:0:0/device +SymlinkTo: ../../../end_device-11:0:0 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/bsg/end_device-11:0:0/subsystem +SymlinkTo: ../../../../../../../../../../../class/bsg +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/bsg/end_device-11:0:0/uevent +Lines: 3 +MAJOR=243 +MINOR=28 +DEVNAME=bsg/end_device-11:0:0 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/sas_device +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/sas_device/end_device-11:0:0 +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/sas_device/end_device-11:0:0/bay_identifier +Lines: 1 +58 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/sas_device/end_device-11:0:0/device +SymlinkTo: ../../../end_device-11:0:0 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/sas_device/end_device-11:0:0/device_type +Lines: 1 +end device +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/sas_device/end_device-11:0:0/enclosure_identifier +Lines: 1 +0x5000ccab020094ff +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/sas_device/end_device-11:0:0/initiator_port_protocols +Lines: 1 +none +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/sas_device/end_device-11:0:0/phy_identifier +Lines: 1 +2 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/sas_device/end_device-11:0:0/sas_address +Lines: 1 +0x5000ccab02009402 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/sas_device/end_device-11:0:0/scsi_target_id +Lines: 1 +7 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/sas_device/end_device-11:0:0/subsystem +SymlinkTo: ../../../../../../../../../../../class/sas_device +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/sas_device/end_device-11:0:0/target_port_protocols +Lines: 1 +sata +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/sas_device/end_device-11:0:0/uevent +Lines: 0 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/sas_end_device +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/sas_end_device/end_device-11:0:0 +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/sas_end_device/end_device-11:0:0/I_T_nexus_loss_timeout +Lines: 1 +0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/sas_end_device/end_device-11:0:0/device +SymlinkTo: ../../../end_device-11:0:0 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/sas_end_device/end_device-11:0:0/initiator_response_timeout +Lines: 1 +0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/sas_end_device/end_device-11:0:0/ready_led_meaning +Lines: 1 +0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/sas_end_device/end_device-11:0:0/subsystem +SymlinkTo: ../../../../../../../../../../../class/sas_end_device +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/sas_end_device/end_device-11:0:0/tlr_enabled +Lines: 1 +0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/sas_end_device/end_device-11:0:0/tlr_supported +Lines: 1 +0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/sas_end_device/end_device-11:0:0/uevent +Lines: 0 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/target11:0:7 +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/target11:0:7/11:0:7:0 +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/target11:0:7/11:0:7:0/blacklist +Lines: 0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/target11:0:7/11:0:7:0/block +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/target11:0:7/11:0:7:0/block/sdv +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/target11:0:7/11:0:7:0/block/sdv/alignment_offset +Lines: 1 +0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/target11:0:7/11:0:7:0/block/sdv/bdi +SymlinkTo: ../../../../../../../../../../../../virtual/bdi/65:80 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/target11:0:7/11:0:7:0/block/sdv/capability +Lines: 1 +40 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/target11:0:7/11:0:7:0/block/sdv/dev +Lines: 1 +65:80 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/target11:0:7/11:0:7:0/block/sdv/device +SymlinkTo: ../../../11:0:7:0 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/target11:0:7/11:0:7:0/block/sdv/discard_alignment +Lines: 1 +0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/target11:0:7/11:0:7:0/block/sdv/diskseq +Lines: 1 +30 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/target11:0:7/11:0:7:0/block/sdv/events +Lines: 0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/target11:0:7/11:0:7:0/block/sdv/events_async +Lines: 0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/target11:0:7/11:0:7:0/block/sdv/events_poll_msecs +Lines: 1 +-1 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/target11:0:7/11:0:7:0/block/sdv/ext_range +Lines: 1 +256 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/target11:0:7/11:0:7:0/block/sdv/hidden +Lines: 1 +0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/target11:0:7/11:0:7:0/block/sdv/holders +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/target11:0:7/11:0:7:0/block/sdv/inflight +Lines: 1 + 0 0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/target11:0:7/11:0:7:0/block/sdv/range +Lines: 1 +16 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/target11:0:7/11:0:7:0/block/sdv/removable +Lines: 1 +0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/target11:0:7/11:0:7:0/block/sdv/ro +Lines: 1 +0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/target11:0:7/11:0:7:0/block/sdv/size +Lines: 1 +15628053168 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/target11:0:7/11:0:7:0/block/sdv/slaves +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/target11:0:7/11:0:7:0/block/sdv/stat +Lines: 1 + 4943710 80 5731521173 123364688 448389 952 7964552 336708 0 44594772 125478500 0 0 0 0 44059 1777103 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/target11:0:7/11:0:7:0/block/sdv/subsystem +SymlinkTo: ../../../../../../../../../../../../../class/block +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/target11:0:7/11:0:7:0/block/sdv/uevent +Lines: 5 +MAJOR=65 +MINOR=80 +DEVNAME=sdv +DEVTYPE=disk +DISKSEQ=30 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/target11:0:7/11:0:7:0/bsg +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/target11:0:7/11:0:7:0/bsg/11:0:7:0 +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/target11:0:7/11:0:7:0/bsg/11:0:7:0/dev +Lines: 1 +243:105 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/target11:0:7/11:0:7:0/bsg/11:0:7:0/device +SymlinkTo: ../../../11:0:7:0 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/target11:0:7/11:0:7:0/bsg/11:0:7:0/subsystem +SymlinkTo: ../../../../../../../../../../../../../class/bsg +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/target11:0:7/11:0:7:0/bsg/11:0:7:0/uevent +Lines: 3 +MAJOR=243 +MINOR=105 +DEVNAME=bsg/11:0:7:0 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/target11:0:7/11:0:7:0/device_blocked +Lines: 1 +0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/target11:0:7/11:0:7:0/device_busy +Lines: 1 +0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/target11:0:7/11:0:7:0/dh_state +Lines: 1 +detached +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/target11:0:7/11:0:7:0/driver +SymlinkTo: ../../../../../../../../../../../bus/scsi/drivers/sd +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/target11:0:7/11:0:7:0/eh_timeout +Lines: 1 +10 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/target11:0:7/11:0:7:0/evt_capacity_change_reported +Lines: 1 +0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/target11:0:7/11:0:7:0/evt_inquiry_change_reported +Lines: 1 +0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/target11:0:7/11:0:7:0/evt_lun_change_reported +Lines: 1 +0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/target11:0:7/11:0:7:0/evt_media_change +Lines: 1 +0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/target11:0:7/11:0:7:0/evt_mode_parameter_change_reported +Lines: 1 +0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/target11:0:7/11:0:7:0/evt_soft_threshold_reached +Lines: 1 +0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/target11:0:7/11:0:7:0/generic +SymlinkTo: scsi_generic/sg23 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/target11:0:7/11:0:7:0/inquiry +Lines: 1 +NULLBYTENULLBYTEENULLBYTENULLBYTEATA ST8000DM004-2CX10001 ZCT0CQLKNULLBYTENULLBYTENULLBYTE` # NULLBYTENULLBYTEEOF +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/target11:0:7/11:0:7:0/iocounterbits +Lines: 1 +32 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/target11:0:7/11:0:7:0/iodone_cnt +Lines: 1 +0x52470f +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/target11:0:7/11:0:7:0/ioerr_cnt +Lines: 1 +0x261 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/target11:0:7/11:0:7:0/iorequest_cnt +Lines: 1 +0x524caa +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/target11:0:7/11:0:7:0/modalias +Lines: 1 +scsi:t-0x00 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/target11:0:7/11:0:7:0/model +Lines: 1 +ST8000DM004-2CX1 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/target11:0:7/11:0:7:0/queue_depth +Lines: 1 +128 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/target11:0:7/11:0:7:0/queue_ramp_up_period +Lines: 1 +120000 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/target11:0:7/11:0:7:0/queue_type +Lines: 1 +simple +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/target11:0:7/11:0:7:0/rev +Lines: 1 +0001 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/target11:0:7/11:0:7:0/sas_address +Lines: 1 +0x5000ccab02009402 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/target11:0:7/11:0:7:0/sas_device_handle +Lines: 1 +0x002d +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/target11:0:7/11:0:7:0/sas_ncq_prio_enable +Lines: 1 +0 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/target11:0:7/11:0:7:0/sas_ncq_prio_supported +Lines: 1 +0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/target11:0:7/11:0:7:0/scsi_device +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/target11:0:7/11:0:7:0/scsi_device/11:0:7:0 +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/target11:0:7/11:0:7:0/scsi_device/11:0:7:0/device +SymlinkTo: ../../../11:0:7:0 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/target11:0:7/11:0:7:0/scsi_device/11:0:7:0/subsystem +SymlinkTo: ../../../../../../../../../../../../../class/scsi_device +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/target11:0:7/11:0:7:0/scsi_device/11:0:7:0/uevent +Lines: 0 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/target11:0:7/11:0:7:0/scsi_disk +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/target11:0:7/11:0:7:0/scsi_disk/11:0:7:0 +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/target11:0:7/11:0:7:0/scsi_disk/11:0:7:0/FUA +Lines: 1 +1 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/target11:0:7/11:0:7:0/scsi_disk/11:0:7:0/allow_restart +Lines: 1 +1 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/target11:0:7/11:0:7:0/scsi_disk/11:0:7:0/app_tag_own +Lines: 1 +0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/target11:0:7/11:0:7:0/scsi_disk/11:0:7:0/cache_type +Lines: 1 +write back +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/target11:0:7/11:0:7:0/scsi_disk/11:0:7:0/device +SymlinkTo: ../../../11:0:7:0 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/target11:0:7/11:0:7:0/scsi_disk/11:0:7:0/manage_start_stop +Lines: 1 +0 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/target11:0:7/11:0:7:0/scsi_disk/11:0:7:0/max_medium_access_timeouts +Lines: 1 +2 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/target11:0:7/11:0:7:0/scsi_disk/11:0:7:0/max_retries +Lines: 1 +5 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/target11:0:7/11:0:7:0/scsi_disk/11:0:7:0/max_write_same_blocks +Lines: 1 +0 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/target11:0:7/11:0:7:0/scsi_disk/11:0:7:0/protection_mode +Lines: 1 +none +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/target11:0:7/11:0:7:0/scsi_disk/11:0:7:0/protection_type +Lines: 1 +0 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/target11:0:7/11:0:7:0/scsi_disk/11:0:7:0/provisioning_mode +Lines: 1 +full +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/target11:0:7/11:0:7:0/scsi_disk/11:0:7:0/subsystem +SymlinkTo: ../../../../../../../../../../../../../class/scsi_disk +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/target11:0:7/11:0:7:0/scsi_disk/11:0:7:0/thin_provisioning +Lines: 1 +0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/target11:0:7/11:0:7:0/scsi_disk/11:0:7:0/uevent +Lines: 0 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/target11:0:7/11:0:7:0/scsi_disk/11:0:7:0/zeroing_mode +Lines: 1 +write +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/target11:0:7/11:0:7:0/scsi_disk/11:0:7:0/zoned_cap +Lines: 1 +none +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/target11:0:7/11:0:7:0/scsi_generic +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Directory: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/target11:0:7/11:0:7:0/scsi_generic/sg23 +Mode: 755 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/target11:0:7/11:0:7:0/scsi_generic/sg23/dev +Lines: 1 +21:23 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/target11:0:7/11:0:7:0/scsi_generic/sg23/device +SymlinkTo: ../../../11:0:7:0 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/target11:0:7/11:0:7:0/scsi_generic/sg23/subsystem +SymlinkTo: ../../../../../../../../../../../../../class/scsi_generic +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/target11:0:7/11:0:7:0/scsi_generic/sg23/uevent +Lines: 3 +MAJOR=21 +MINOR=23 +DEVNAME=sg23 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/target11:0:7/11:0:7:0/scsi_level +Lines: 1 +7 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/target11:0:7/11:0:7:0/state +Lines: 1 +running +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/target11:0:7/11:0:7:0/subsystem +SymlinkTo: ../../../../../../../../../../../bus/scsi +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/target11:0:7/11:0:7:0/timeout +Lines: 1 +30 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/target11:0:7/11:0:7:0/type +Lines: 1 +0 +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/target11:0:7/11:0:7:0/uevent +Lines: 3 +DEVTYPE=scsi_device +DRIVER=sd +MODALIAS=scsi:t-0x00 +Mode: 644 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/target11:0:7/11:0:7:0/vendor +Lines: 1 +ATA +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/target11:0:7/11:0:7:0/vpd_pg0 +Lines: 1 +NULLBYTENULLBYTENULLBYTE NULLBYTEEOF +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/target11:0:7/11:0:7:0/vpd_pg80 +Lines: 1 +NULLBYTENULLBYTE ZCT0CQLKEOF +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/target11:0:7/11:0:7:0/vpd_pg83 +Lines: 1 +NULLBYTENULLBYTE NULLBYTEPNULLBYTENULLBYTE-aNULLBYTEPNULLBYTE̫NULLBYTENULLBYTENULLBYTENULLBYTENULLBYTEEOF +Mode: 444 +# ttar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +Path: fixtures/sys/devices/pci0000:00/0000:00:03.0/0000:03:00.0/host11/port-11:0/expander-11:0/port-11:0:0/end_device-11:0:0/target11:0:7/11:0:7:0/vpd_pg89 +Lines: 2 +NULLBYTE8NULLBYTENULLBYTENULLBYTENULLBYTELSI LSI SATL 00084@PNULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTEZ ?7NULLBYTENULLBYTENULLBYTENULLBYTENULLBYTE?NULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTE CZ0TQCKLNULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTE0010 TS0800MD00-4C21X88 NULLBYTE@NULLBYTE/NULLBYTE@NULLBYTENULLBYTENULLBYTE?NULLBYTE?NULLBYTENULLBYTE NULLBYTENULLBYTENULLBYTENULLBYTExNULLBYTExNULLBYTExNULLBYTExNULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTEDNULLBYTEmNULLBYTEk4a}cAi4AcA@NULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTE*NULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTE`NULLBYTENULLBYTENULLBYTEPNULLBYTE-NULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTE@@NULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTENULLBYTE!NULLBYTE** NULLBYTE@NULLBYTENULLBYTEP< +