Update go to 1.17 (#2159)

Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
This commit is contained in:
Julien Pivotto 2021-10-03 13:35:24 +02:00 committed by GitHub
parent 68f1e952c8
commit 68a6c78c0d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
115 changed files with 164 additions and 61 deletions

View File

@ -9,7 +9,7 @@ executors:
# should also be updated.
golang:
docker:
- image: circleci/golang:1.16
- image: circleci/golang:1.17
jobs:
test:

View File

@ -1,7 +1,7 @@
go:
# Whenever the Go version is updated here, .circle/config.yml and
# .promu.yml should also be updated.
version: 1.16
version: 1.17
cgo: true
repository:
path: github.com/prometheus/node_exporter

View File

@ -1,7 +1,7 @@
go:
# Whenever the Go version is updated here, .circle/config.yml and
# .promu-cgo.yml should also be updated.
version: 1.16
version: 1.17
repository:
path: github.com/prometheus/node_exporter
build:

View File

@ -11,6 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build !noarp
// +build !noarp
package collector

View File

@ -11,6 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build !nobcache
// +build !nobcache
package collector

View File

@ -11,6 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build !nobonding
// +build !nobonding
package collector

View File

@ -11,6 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build (freebsd || dragonfly || (openbsd && !amd64) || netbsd || darwin) && !noboottime
// +build freebsd dragonfly openbsd,!amd64 netbsd darwin
// +build !noboottime

View File

@ -11,6 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build !noboottime
// +build !noboottime
package collector

View File

@ -11,8 +11,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
// +build solaris
// +build !noboottime
//go:build solaris && !noboottime
// +build solaris,!noboottime
package collector

View File

@ -11,6 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build !nobtrfs
// +build !nobtrfs
package collector

View File

@ -11,6 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build !nobtrfs
// +build !nobtrfs
package collector

View File

@ -11,8 +11,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
// +build !nobuddyinfo
// +build !netbsd
//go:build !nobuddyinfo && !netbsd
// +build !nobuddyinfo,!netbsd
package collector

View File

@ -11,6 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build !noconntrack
// +build !noconntrack
package collector

View File

@ -11,6 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build !nocpu
// +build !nocpu
package collector

View File

@ -14,6 +14,7 @@
// Based on gopsutil/cpu/cpu_darwin_cgo.go @ ae251eb which is licensed under
// BSD. See https://github.com/shirou/gopsutil/blob/master/LICENSE for details.
//go:build !nocpu
// +build !nocpu
package collector

View File

@ -11,6 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build !nocpu
// +build !nocpu
package collector

View File

@ -11,6 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build !nocpu
// +build !nocpu
package collector

View File

@ -11,6 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build !nocpu
// +build !nocpu
package collector

View File

@ -11,6 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build !nocpu
// +build !nocpu
package collector

View File

@ -11,6 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build !nocpu
// +build !nocpu
package collector

View File

@ -11,8 +11,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
// +build openbsd,!amd64
// +build !nocpu
//go:build openbsd && !amd64 && !nocpu
// +build openbsd,!amd64,!nocpu
package collector

View File

@ -11,6 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build !nocpu
// +build !nocpu
package collector

View File

@ -11,8 +11,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
// +build solaris
// +build !nocpu
//go:build solaris && !nocpu
// +build solaris,!nocpu
package collector

View File

@ -11,6 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build !nocpu
// +build !nocpu
package collector

View File

@ -11,8 +11,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
// +build solaris
// +build !nocpu
//go:build solaris && !nocpu
// +build solaris,!nocpu
package collector

View File

@ -11,6 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build !nodevstat
// +build !nodevstat
package collector

View File

@ -11,6 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build !nodevstat
// +build !nodevstat
package collector

View File

@ -11,6 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build !nodiskstats && (openbsd || linux || darwin)
// +build !nodiskstats
// +build openbsd linux darwin

View File

@ -11,6 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build !nodiskstats
// +build !nodiskstats
package collector

View File

@ -11,6 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build !nodiskstats
// +build !nodiskstats
package collector

View File

@ -11,8 +11,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
// +build openbsd,!amd64
// +build !nodiskstats
//go:build openbsd && !amd64 && !nodiskstats
// +build openbsd,!amd64,!nodiskstats
package collector

View File

@ -11,6 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build !nodiskstats
// +build !nodiskstats
package collector

View File

@ -11,6 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build !nodrbd
// +build !nodrbd
package collector

View File

@ -11,6 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build !noedac
// +build !noedac
package collector

View File

@ -11,6 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build !noentropy
// +build !noentropy
package collector

View File

@ -11,6 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build !noethtool
// +build !noethtool
// The hard work of collecting data from the kernel via the ethtool interfaces is done by

View File

@ -11,6 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build (freebsd || dragonfly) && !noexec
// +build freebsd dragonfly
// +build !noexec

View File

@ -11,8 +11,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
// +build linux
// +build !nofibrechannel
//go:build linux && !nofibrechannel
// +build linux,!nofibrechannel
package collector

View File

@ -11,6 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build !nofilefd
// +build !nofilefd
package collector

View File

@ -11,6 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build ((openbsd && !amd64) || darwin || dragonfly) && !nofilesystem
// +build openbsd,!amd64 darwin dragonfly
// +build !nofilesystem

View File

@ -11,6 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build !nofilesystem && (linux || freebsd || openbsd || darwin || dragonfly)
// +build !nofilesystem
// +build linux freebsd openbsd darwin dragonfly

View File

@ -11,6 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build !nofilesystem
// +build !nofilesystem
package collector

View File

@ -11,6 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build !nofilesystem
// +build !nofilesystem
package collector

View File

@ -11,8 +11,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
// +build openbsd
// +build !nofilesystem
//go:build openbsd && !nofilesystem
// +build openbsd,!nofilesystem
package collector

View File

@ -11,6 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build !nohwmon
// +build !nohwmon
package collector

View File

@ -11,8 +11,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
// +build linux
// +build !noinfiniband
//go:build linux && !noinfiniband
// +build linux,!noinfiniband
package collector

View File

@ -11,6 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build (linux || openbsd) && !nointerrupts
// +build linux openbsd
// +build !nointerrupts

View File

@ -11,6 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build !nointerrupts
// +build !nointerrupts
package collector

View File

@ -11,8 +11,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
// +build openbsd,!amd64
// +build !nointerrupts
//go:build openbsd && !amd64 && !nointerrupts
// +build openbsd,!amd64,!nointerrupts
package collector

View File

@ -11,6 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build !nointerrupts
// +build !nointerrupts
package collector

View File

@ -11,6 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build !noipvs
// +build !noipvs
package collector

View File

@ -11,6 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build !noksmd
// +build !noksmd
package collector

View File

@ -11,6 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build !nokvm && (freebsd || dragonfly)
// +build !nokvm
// +build freebsd dragonfly

View File

@ -11,6 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build !nolnstat
// +build !nolnstat
package collector

View File

@ -11,6 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build (darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris) && !noloadavg
// +build darwin dragonfly freebsd linux netbsd openbsd solaris
// +build !noloadavg

View File

@ -11,6 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build (darwin || dragonfly || freebsd || netbsd || openbsd) && !noloadavg
// +build darwin dragonfly freebsd netbsd openbsd
// +build !noloadavg

View File

@ -11,6 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build !noloadavg
// +build !noloadavg
package collector

View File

@ -11,6 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build !noloadavg
// +build !noloadavg
package collector

View File

@ -11,6 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build !nologind
// +build !nologind
package collector

View File

@ -11,6 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build !nomdadm
// +build !nomdadm
package collector

View File

@ -11,6 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build (darwin || linux || openbsd) && !nomeminfo
// +build darwin linux openbsd
// +build !nomeminfo

View File

@ -11,6 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build !nomeminfo
// +build !nomeminfo
package collector

View File

@ -11,6 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build !nomeminfo
// +build !nomeminfo
package collector

View File

@ -11,6 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build !nomeminfo_numa
// +build !nomeminfo_numa
package collector

View File

@ -11,8 +11,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
// +build openbsd,!amd64
// +build !nomeminfo
//go:build openbsd && !amd64 && !nomeminfo
// +build openbsd,!amd64,!nomeminfo
package collector

View File

@ -11,6 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build !nomeminfo
// +build !nomeminfo
package collector

View File

@ -11,6 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build (freebsd || dragonfly) && !nomeminfo
// +build freebsd dragonfly
// +build !nomeminfo

View File

@ -11,6 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build !nomountstats
// +build !nomountstats
package collector

View File

@ -11,8 +11,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
// +build !nonetclass
// +build linux
//go:build !nonetclass && linux
// +build !nonetclass,linux
package collector

View File

@ -11,6 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build !nonetdev && (freebsd || dragonfly)
// +build !nonetdev
// +build freebsd dragonfly

View File

@ -11,6 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build !nonetdev
// +build !nonetdev
package collector

View File

@ -11,6 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build !nonetdev
// +build !nonetdev
package collector

View File

@ -11,8 +11,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
// +build openbsd,!amd64
// +build !nonetdev
//go:build openbsd && !amd64 && !nonetdev
// +build openbsd,!amd64,!nonetdev
package collector

View File

@ -11,6 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build !nonetdev
// +build !nonetdev
package collector

View File

@ -11,6 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build !nonetstat
// +build !nonetstat
package collector

View File

@ -11,6 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build !nonetworkroute
// +build !nonetworkroute
package collector

View File

@ -11,6 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build !nonfs
// +build !nonfs
package collector

View File

@ -11,6 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build !nonfsd
// +build !nonfsd
package collector

View File

@ -11,6 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build !nontp
// +build !nontp
package collector

View File

@ -11,8 +11,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
// +build linux
// +build !nonvme
//go:build linux && !nonvme
// +build linux,!nonvme
package collector

View File

@ -11,6 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build !noperf
// +build !noperf
package collector
@ -284,21 +285,30 @@ func NewPerfCollector(logger log.Logger) (Collector, error) {
for _, cpu := range cpus {
// Use -1 to profile all processes on the CPU, see:
// man perf_event_open
hwProf := perf.NewHardwareProfiler(-1, cpu)
hwProf, err := perf.NewHardwareProfiler(-1, cpu)
if err != nil {
return nil, err
}
if err := hwProf.Start(); err != nil {
return nil, err
}
collector.perfHwProfilers[cpu] = &hwProf
collector.hwProfilerCPUMap[&hwProf] = cpu
swProf := perf.NewSoftwareProfiler(-1, cpu)
swProf, err := perf.NewSoftwareProfiler(-1, cpu)
if err != nil {
return nil, err
}
if err := swProf.Start(); err != nil {
return nil, err
}
collector.perfSwProfilers[cpu] = &swProf
collector.swProfilerCPUMap[&swProf] = cpu
cacheProf := perf.NewCacheProfiler(-1, cpu)
cacheProf, err := perf.NewCacheProfiler(-1, cpu)
if err != nil {
return nil, err
}
if err := cacheProf.Start(); err != nil {
return nil, err
}

View File

@ -11,6 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build !noprocesses
// +build !noprocesses
package collector

View File

@ -11,8 +11,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
// +build !nopowersupplyclass
// +build linux
//go:build !nopowersupplyclass && linux
// +build !nopowersupplyclass,linux
package collector

View File

@ -11,6 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build !nopressure
// +build !nopressure
package collector

View File

@ -11,6 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build !noprocesses
// +build !noprocesses
package collector

View File

@ -11,6 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build !noprocesses
// +build !noprocesses
package collector

View File

@ -11,6 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build !noqdisc
// +build !noqdisc
package collector

View File

@ -11,6 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build !norunit
// +build !norunit
package collector

View File

@ -11,6 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build !noshedstat
// +build !noshedstat
package collector

View File

@ -11,6 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build !nosockstat
// +build !nosockstat
package collector

View File

@ -11,6 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build !nosoftnet
// +build !nosoftnet
package collector

View File

@ -11,6 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build !nostat
// +build !nostat
package collector

View File

@ -11,6 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build !nosupervisord
// +build !nosupervisord
package collector

View File

@ -11,6 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build (freebsd || dragonfly || openbsd || netbsd || darwin) && cgo
// +build freebsd dragonfly openbsd netbsd darwin
// +build cgo

View File

@ -11,6 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build !nosystemd
// +build !nosystemd
package collector

View File

@ -11,6 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build !notapestats
// +build !notapestats
package collector

View File

@ -11,6 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build !notcpstat
// +build !notcpstat
package collector

View File

@ -11,6 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build !notextfile
// +build !notextfile
package collector

View File

@ -11,6 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build !nothermalzone
// +build !nothermalzone
package collector

View File

@ -11,6 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build !notime
// +build !notime
package collector

Some files were not shown because too many files have changed in this diff Show More