summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorRoman Lebedev <lebedev.ri@gmail.com>2018-05-16 18:15:56 +0000
committerRoman Lebedev <lebedev.ri@gmail.com>2018-05-16 18:15:56 +0000
commitd9ade38d4eda40dba34e545c47f121fc1d95e517 (patch)
tree0b8806fb1382021013bece88ffb7a5ae96ff130f /llvm
parentddfefc3538f6e501e8dd62441546880ce4190695 (diff)
downloadbcm5719-llvm-d9ade38d4eda40dba34e545c47f121fc1d95e517.tar.gz
bcm5719-llvm-d9ade38d4eda40dba34e545c47f121fc1d95e517.zip
[Timers] TimerGroup: make printJSONValues() method public
Summary: This is needed for the continuation of D46504, to be able to store the timings. Reviewers: george.karpenkov, NoQ, alexfh, sbenza Reviewed By: alexfh Subscribers: llvm-commits, cfe-commits Differential Revision: https://reviews.llvm.org/D46938 llvm-svn: 332505
Diffstat (limited to 'llvm')
-rw-r--r--llvm/include/llvm/Support/Timer.h3
-rw-r--r--llvm/lib/Support/Timer.cpp2
2 files changed, 4 insertions, 1 deletions
diff --git a/llvm/include/llvm/Support/Timer.h b/llvm/include/llvm/Support/Timer.h
index 198855ae037..41f1b81a804 100644
--- a/llvm/include/llvm/Support/Timer.h
+++ b/llvm/include/llvm/Support/Timer.h
@@ -207,6 +207,8 @@ public:
/// This static method prints all timers and clears them all out.
static void printAll(raw_ostream &OS);
+ const char *printJSONValues(raw_ostream &OS, const char *delim);
+
/// Prints all timers as JSON key/value pairs, and clears them all out.
static const char *printAllJSONValues(raw_ostream &OS, const char *delim);
@@ -223,7 +225,6 @@ private:
void PrintQueuedTimers(raw_ostream &OS);
void printJSONValue(raw_ostream &OS, const PrintRecord &R,
const char *suffix, double Value);
- const char *printJSONValues(raw_ostream &OS, const char *delim);
};
} // end namespace llvm
diff --git a/llvm/lib/Support/Timer.cpp b/llvm/lib/Support/Timer.cpp
index 4dbc8ed034d..fd587fb80bb 100644
--- a/llvm/lib/Support/Timer.cpp
+++ b/llvm/lib/Support/Timer.cpp
@@ -378,6 +378,8 @@ void TimerGroup::printJSONValue(raw_ostream &OS, const PrintRecord &R,
}
const char *TimerGroup::printJSONValues(raw_ostream &OS, const char *delim) {
+ sys::SmartScopedLock<true> L(*TimerLock);
+
prepareToPrintList();
for (const PrintRecord &R : TimersToPrint) {
OS << delim;
OpenPOWER on IntegriCloud