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>
This commit is contained in:
Luigi Semenzato 2013-06-04 13:24:21 -07:00 committed by ChromeBot
parent 0672655fa6
commit d92d18c935

View file

@ -692,9 +692,7 @@ bool MetricsDaemon::VmStatsReadStats(long int* page_faults) {
}
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();