aboutsummaryrefslogtreecommitdiff
path: root/unittests
diff options
context:
space:
mode:
authorDean Michael Berris <dberris@google.com>2018-11-01 00:18:52 +0000
committerDean Michael Berris <dberris@google.com>2018-11-01 00:18:52 +0000
commit3fe1b12fca949399a3334a072ee7f96e2b6f557e (patch)
tree87d96883abaea57d0f348a89d9bb04e6f1d88e77 /unittests
parentf4bf727b25104cc8b0682f1eaf21865ff7dbf05c (diff)
[XRay] Add CPU ID in Custom Event FDR Records
Summary: This change cuts across compiler-rt and llvm, to increment the FDR log version number to 4, and include the CPU ID in the custom event records. This is a step towards allowing us to change the `llvm::xray::Trace` object to start representing both custom and typed events in the stream of records. Follow-on changes will allow us to change the kinds of records we're presenting in the stream of traces, to incorporate the data in custom/typed events. A follow-on change will handle the typed event case, where it may not fit within the 15-byte buffer for metadata records. This work is part of the larger effort to enable writing analysis and processing tools using a common in-memory representation of the events found in traces. The work will focus on porting existing tools in LLVM to use the common representation and informing the design of a library/framework for expressing trace event analysis as C++ programs. Reviewers: mboerger, eizan Subscribers: hiraditya, mgrang, llvm-commits Differential Revision: https://reviews.llvm.org/D53920 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@345798 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests')
-rw-r--r--unittests/XRay/FDRProducerConsumerTest.cpp2
-rw-r--r--unittests/XRay/FDRRecordPrinterTest.cpp4
2 files changed, 3 insertions, 3 deletions
diff --git a/unittests/XRay/FDRProducerConsumerTest.cpp b/unittests/XRay/FDRProducerConsumerTest.cpp
index 838e6ca9bf1..09ec44db26e 100644
--- a/unittests/XRay/FDRProducerConsumerTest.cpp
+++ b/unittests/XRay/FDRProducerConsumerTest.cpp
@@ -54,7 +54,7 @@ template <> std::unique_ptr<Record> MakeRecord<WallclockRecord>() {
}
template <> std::unique_ptr<Record> MakeRecord<CustomEventRecord>() {
- return make_unique<CustomEventRecord>(4, 1, "data");
+ return make_unique<CustomEventRecord>(4, 1, 2, "data");
}
template <> std::unique_ptr<Record> MakeRecord<CallArgRecord>() {
diff --git a/unittests/XRay/FDRRecordPrinterTest.cpp b/unittests/XRay/FDRRecordPrinterTest.cpp
index 339d4b0d428..321892e7240 100644
--- a/unittests/XRay/FDRRecordPrinterTest.cpp
+++ b/unittests/XRay/FDRRecordPrinterTest.cpp
@@ -55,11 +55,11 @@ template <> struct Helper<TSCWrapRecord> {
template <> struct Helper<CustomEventRecord> {
static std::unique_ptr<Record> construct() {
- return make_unique<CustomEventRecord>(4, 1, "data");
+ return make_unique<CustomEventRecord>(4, 1, 2, "data");
}
static const char *expected() {
- return "<Custom Event: tsc = 1, size = 4, data = 'data'>";
+ return "<Custom Event: tsc = 1, cpu = 2, size = 4, data = 'data'>";
}
};