From e8f8192a8b660f706172550cf1aee1e8b4a7b3cf Mon Sep 17 00:00:00 2001 From: Paul Gier Date: Wed, 6 May 2020 15:02:06 -0500 Subject: [PATCH] cpuinfo: fix platform constraints Signed-off-by: Paul Gier --- cpuinfo_amd64.go => cpuinfo_default.go | 2 +- cpuinfo_ppc64.go | 1 - cpuinfo_ppc64le.go | 18 ++++++++++++++++++ cpuinfo_s390x.go | 3 +-- 4 files changed, 20 insertions(+), 4 deletions(-) rename cpuinfo_amd64.go => cpuinfo_default.go (97%) create mode 100644 cpuinfo_ppc64le.go diff --git a/cpuinfo_amd64.go b/cpuinfo_default.go similarity index 97% rename from cpuinfo_amd64.go rename to cpuinfo_default.go index 42e995ef1..d5bedf97f 100644 --- a/cpuinfo_amd64.go +++ b/cpuinfo_default.go @@ -12,7 +12,7 @@ // limitations under the License. // +build linux -// +build amd64 +// +build 386 amd64 package procfs diff --git a/cpuinfo_ppc64.go b/cpuinfo_ppc64.go index 31841510f..64aee9c63 100644 --- a/cpuinfo_ppc64.go +++ b/cpuinfo_ppc64.go @@ -12,7 +12,6 @@ // limitations under the License. // +build linux -// +build ppc64,ppc64le package procfs diff --git a/cpuinfo_ppc64le.go b/cpuinfo_ppc64le.go new file mode 100644 index 000000000..64aee9c63 --- /dev/null +++ b/cpuinfo_ppc64le.go @@ -0,0 +1,18 @@ +// Copyright 2020 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 procfs + +var parseCPUInfo = parseCPUInfoPPC diff --git a/cpuinfo_s390x.go b/cpuinfo_s390x.go index 1d7019deb..26814eeba 100644 --- a/cpuinfo_s390x.go +++ b/cpuinfo_s390x.go @@ -12,8 +12,7 @@ // limitations under the License. // +build linux -// +build s390x package procfs -var parseCPUInfo = parseCPUInfoS390x +var parseCPUInfo = parseCPUInfoS390X