| // Copyright 2017 The Fuchsia Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| #include "garnet/lib/measure/test_events.h" |
| |
| namespace tracing { |
| namespace measure { |
| namespace test { |
| |
| trace::Record::Event DurationBegin(fbl::String name, fbl::String category, |
| uint64_t timestamp) { |
| return trace::Record::Event{ |
| timestamp, {}, category, |
| name, {}, trace::EventData(trace::EventData::DurationBegin{})}; |
| } |
| |
| trace::Record::Event DurationEnd(fbl::String name, fbl::String category, |
| uint64_t timestamp) { |
| return trace::Record::Event{ |
| timestamp, {}, category, |
| name, {}, trace::EventData(trace::EventData::DurationEnd{})}; |
| } |
| |
| trace::Record::Event DurationComplete(fbl::String name, fbl::String category, |
| uint64_t timestamp, uint64_t end_time) { |
| return trace::Record::Event{ |
| timestamp, {}, category, |
| name, {}, |
| trace::EventData(trace::EventData::DurationComplete{end_time})}; |
| } |
| |
| trace::Record::Event AsyncBegin(uint64_t id, fbl::String name, |
| fbl::String category, uint64_t timestamp) { |
| return trace::Record::Event{ |
| timestamp, {}, category, |
| name, {}, trace::EventData(trace::EventData::AsyncBegin{id})}; |
| } |
| |
| trace::Record::Event AsyncEnd(uint64_t id, fbl::String name, |
| fbl::String category, uint64_t timestamp) { |
| return trace::Record::Event{ |
| timestamp, {}, category, |
| name, {}, trace::EventData(trace::EventData::AsyncEnd{id})}; |
| } |
| |
| trace::Record::Event FlowBegin(uint64_t id, fbl::String name, |
| fbl::String category, uint64_t timestamp) { |
| return trace::Record::Event{ |
| timestamp, {}, category, |
| name, {}, trace::EventData(trace::EventData::FlowBegin{id})}; |
| } |
| |
| trace::Record::Event FlowEnd(uint64_t id, fbl::String name, |
| fbl::String category, uint64_t timestamp) { |
| return trace::Record::Event{ |
| timestamp, {}, category, |
| name, {}, trace::EventData(trace::EventData::FlowEnd{id})}; |
| } |
| |
| trace::Record::Event Instant(fbl::String name, fbl::String category, |
| uint64_t timestamp, |
| fbl::Vector<trace::Argument> args) { |
| return trace::Record::Event{ |
| timestamp, {}, |
| category, name, |
| std::move(args), trace::EventData(trace::EventData::Instant{})}; |
| } |
| } // namespace test |
| |
| } // namespace measure |
| } // namespace tracing |