Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(156)

Side by Side Diff: base/sys_info_posix.cc

Issue 999623002: metrics/base: log whether drives have seek penalties. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: slightly after rush hour Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/sys_info.h" 5 #include "base/sys_info.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 #include <string.h> 8 #include <string.h>
9 #include <sys/param.h> 9 #include <sys/param.h>
10 #include <sys/resource.h> 10 #include <sys/resource.h>
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 // static 89 // static
90 int64 SysInfo::AmountOfFreeDiskSpace(const FilePath& path) { 90 int64 SysInfo::AmountOfFreeDiskSpace(const FilePath& path) {
91 base::ThreadRestrictions::AssertIOAllowed(); 91 base::ThreadRestrictions::AssertIOAllowed();
92 92
93 struct statvfs stats; 93 struct statvfs stats;
94 if (HANDLE_EINTR(statvfs(path.value().c_str(), &stats)) != 0) 94 if (HANDLE_EINTR(statvfs(path.value().c_str(), &stats)) != 0)
95 return -1; 95 return -1;
96 return static_cast<int64>(stats.f_bavail) * stats.f_frsize; 96 return static_cast<int64>(stats.f_bavail) * stats.f_frsize;
97 } 97 }
98 98
99 bool SysInfo::HasSeekPenalty(const FilePath& path, bool* has_seek_penalty) {
100 return false;
101 }
102
99 #if !defined(OS_MACOSX) && !defined(OS_ANDROID) 103 #if !defined(OS_MACOSX) && !defined(OS_ANDROID)
100 // static 104 // static
101 std::string SysInfo::OperatingSystemName() { 105 std::string SysInfo::OperatingSystemName() {
102 struct utsname info; 106 struct utsname info;
103 if (uname(&info) < 0) { 107 if (uname(&info) < 0) {
104 NOTREACHED(); 108 NOTREACHED();
105 return std::string(); 109 return std::string();
106 } 110 }
107 return std::string(info.sysname); 111 return std::string(info.sysname);
108 } 112 }
(...skipping 26 matching lines...) Expand all
135 } 139 }
136 return arch; 140 return arch;
137 } 141 }
138 142
139 // static 143 // static
140 size_t SysInfo::VMAllocationGranularity() { 144 size_t SysInfo::VMAllocationGranularity() {
141 return getpagesize(); 145 return getpagesize();
142 } 146 }
143 147
144 } // namespace base 148 } // namespace base
OLDNEW
« no previous file with comments | « base/sys_info.h ('k') | base/sys_info_unittest.cc » ('j') | base/sys_info_win.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698