diff --git a/source/cpu/cstate.go b/source/cpu/cstate_amd64.go similarity index 100% rename from source/cpu/cstate.go rename to source/cpu/cstate_amd64.go diff --git a/source/cpu/cstate_stub.go b/source/cpu/cstate_stub.go new file mode 100644 index 000000000..9a94f9d35 --- /dev/null +++ b/source/cpu/cstate_stub.go @@ -0,0 +1,24 @@ +// +build !amd64 + +/* +Copyright 2021 The Kubernetes 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 cpu + +// Discover if c-states are enabled +func detectCstate() (bool, bool, error) { + return false, false, nil +} diff --git a/source/cpu/pstate.go b/source/cpu/pstate_amd64.go similarity index 93% rename from source/cpu/pstate.go rename to source/cpu/pstate_amd64.go index f100f7bd1..8337217bc 100644 --- a/source/cpu/pstate.go +++ b/source/cpu/pstate_amd64.go @@ -21,7 +21,6 @@ import ( "io/ioutil" "os" "path/filepath" - "runtime" "strings" "k8s.io/klog/v2" @@ -31,12 +30,6 @@ import ( // Discover p-state related features such as turbo boost. func detectPstate() (map[string]string, error) { - // On other platforms, the frequency boost mechanism is software-based. - // So skip pstate detection on other architectures. - if runtime.GOARCH != "amd64" && runtime.GOARCH != "386" { - return nil, nil - } - // Check that sysfs is available sysfsBase := source.SysfsDir.Path("devices/system/cpu") if _, err := os.Stat(sysfsBase); err != nil { diff --git a/source/cpu/pstate_stub.go b/source/cpu/pstate_stub.go new file mode 100644 index 000000000..713aaa0f2 --- /dev/null +++ b/source/cpu/pstate_stub.go @@ -0,0 +1,24 @@ +// +build !amd64 + +/* +Copyright 2017 The Kubernetes 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 cpu + +// Discover p-state related features such as turbo boost. +func detectPstate() (map[string]string, error) { + return nil, nil +}