summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/XRay/FDRProducerConsumerTest.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [XRay] Add TSC to NewCPUId RecordsDean Michael Berris2018-09-111-1/+1
| | | | | | | | | | | | | | | Summary: This more correctly reflects the data written by the FDR mode runtime. This is a continuation of the work in D50441. Reviewers: mboerger, eizan Subscribers: hiraditya, llvm-commits Differential Revision: https://reviews.llvm.org/D51911 llvm-svn: 341905
* [XRay] Make the FDRTraceWriter Endian-awareDean Michael Berris2018-08-311-1/+1
| | | | | | | | | Before this patch, the FDRTraceWriter would not take endianness into account when writing data into the output stream. This is a follow-up to D51289 and D51210. llvm-svn: 341223
* [XRay] FDRProducerConsumerTest: unbreak (gcc?) buildRoman Lebedev2018-08-311-3/+3
| | | | | | | | | | | | | /build/llvm/unittests/XRay/FDRProducerConsumerTest.cpp:90:27: error: declaration of ‘std::unique_ptr<llvm::xray::Record> llvm::xray::{anonymous}::RoundTripTest<T>::Record’ [-fpermissive] std::unique_ptr<Record> Record; ^~~~~~ In file included from /build/llvm/include/llvm/XRay/FDRLogBuilder.h:12, from /build/llvm/unittests/XRay/FDRProducerConsumerTest.cpp:15: /build/llvm/include/llvm/XRay/FDRRecords.h:28:7: error: changes meaning of ‘Record’ from ‘class llvm::xray::Record’ [-fpermissive] class Record { ^~~~~~ llvm-svn: 341189
* [XRay] FDR Record Producer/Consumer ImplementationDean Michael Berris2018-08-311-0/+141
Summary: This patch defines two new base types called `RecordProducer` and `RecordConsumer` which have default implementations for convenience (particularly for testing). A `RecordProducer` implementation has one member function called `produce()` which serves as a factory constructor for `Record` instances. This code exercises the `RecordInitializer` code path in the implementation for `FileBasedRecordProducer`. A `RecordConsumer` has a single member function called `consume(...)` which, as the name implies, consumes instances of `std::unique_ptr<Record>`. We have two implementations, one of which is used in the test to generate a vector of `std::unique_ptr<Record>` similar to how the `LogBuilder` implementation works. We introduce a test in `FDRProducerConsumerTest` which ensures that records we write through the `FDRTraceWriter` can be loaded by the `FileBasedRecordProducer`. The record(s) loaded this way are written again through the `FDRTraceWriter` into a separate string, which we then compare. This ensures that the read-in bytes to create the `Record` instances in memory can be replicated when written out through the `FDRTraceWriter`. This change depends on D51210 and is part of the refactoring of D50441 into smaller, more focused changes. Reviewers: eizan, kpw Subscribers: mgorny, hiraditya, llvm-commits Differential Revision: https://reviews.llvm.org/D51289 llvm-svn: 341180
OpenPOWER on IntegriCloud