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

Unified Diff: tools/cygprofile/cygprofile.cc

Issue 272393004: Make cygprofile use clock_gettime() instead of gettimeofday(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address Egor's comment Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tools/cygprofile/mergetraces.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/cygprofile/cygprofile.cc
diff --git a/tools/cygprofile/cygprofile.cc b/tools/cygprofile/cygprofile.cc
index 2086bea5ec9b458074e1cf737043e61e923701c7..980fa9e070010413793d70637665281de6fa2c3f 100644
--- a/tools/cygprofile/cygprofile.cc
+++ b/tools/cygprofile/cygprofile.cc
@@ -208,7 +208,7 @@ CygCommon::CygCommon() {
}
}
mapsfile.close();
- header_line_.append("\nsecs\tmsecs\tpid:threadid\tfunc\n");
+ header_line_.append("\nsecs\tusecs\tpid:threadid\tfunc\n");
}
void CygTlsLog::LogEnter(void* this_fn) {
@@ -222,9 +222,9 @@ void CygTlsLog::LogEnter(void* this_fn) {
base::AutoLock lock(log_mutex_);
if (buf_.capacity() < kBufMaxSize)
buf_.reserve(kBufMaxSize);
- struct timeval timestamp;
- gettimeofday(&timestamp, NULL);
- buf_.push_back(CygLogEntry(time(NULL), timestamp.tv_usec,
+ struct timespec timestamp;
+ clock_gettime(CLOCK_MONOTONIC, &timestamp);
+ buf_.push_back(CygLogEntry(timestamp.tv_sec, timestamp.tv_nsec / 1000,
getpid(), pthread_self(), this_fn));
if (buf_.size() == kBufMaxSize) {
FlushLog();
« no previous file with comments | « no previous file | tools/cygprofile/mergetraces.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698