crosperf: Add check core online in PinGovernerFrequency().

Due to Hyper-Threading is disabled, not all cpus in
/sys/devices/system/cpu/cpu* are online on the x86 DUTs. Our
PinGovernerFrequency() functions need to write performance to
scaling_governor and it fails if the cpu is offline. This patches
adds checks before writing to make sure the core is not offline.

BUG=None
TEST=Local tests.

Change-Id: I5dee6851848c18ff9caac0fb5bf5a6a18741a3c8
Reviewed-on: https://chromium-review.googlesource.com/1618095
Commit-Ready: Tiancong Wang <tcwang@google.com>
Tested-by: Tiancong Wang <tcwang@google.com>
Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org>
Reviewed-by: Manoj Gupta <manojgupta@chromium.org>
2 files changed