Fix wrong sysfs pathname.
This bug was introduced while adding test code
which was supposed to improve the reliability
of this program.
BUG=chromium:238890
TEST=verified that about:histograms contains samples
Change-Id: I66323292f9261f5715760d7c884f91aca1f7e453
Reviewed-on: https://gerrit.chromium.org/gerrit/57501
Reviewed-by: Sonny Rao <sonnyrao@chromium.org>
Tested-by: Luigi Semenzato <semenzato@chromium.org>
Commit-Queue: Luigi Semenzato <semenzato@chromium.org>
diff --git a/metrics/metrics_daemon.cc b/metrics/metrics_daemon.cc
index 3b9e9db..ad6bf94 100644
--- a/metrics/metrics_daemon.cc
+++ b/metrics/metrics_daemon.cc
@@ -692,9 +692,7 @@
}
bool MetricsDaemon::ReadFreqToInt(const string& sysfs_file_name, int* value) {
- const string sysfs_dirpath(testing_ ?
- "./" : "/sys/devices/system/cpu/cpu0/cpufreq/");
- const FilePath sysfs_path(sysfs_dirpath + sysfs_file_name);
+ const FilePath sysfs_path(sysfs_file_name);
string value_string;
if (!file_util::ReadFileToString(sysfs_path, &value_string)) {
LOG(WARNING) << "cannot read " << sysfs_path.value().c_str();