1//
2// Copyright (c) 2010-2022 Antmicro
3//
4// This file is licensed under the MIT License.
5// Full license text is available in 'licenses/MIT.txt'.
6//
7
8// Minimal version of the TracePacket used by Perfetto
9// Orginal definitions can be found here:
10// https://cs.android.com/android/platform/superproject/+/f5c4cacbe57e1ab7c5dfed53852ad67d9352b1ed:external/perfetto/protos/perfetto/trace/trace_packet.proto
11
12syntax = "proto2";
13option csharp_namespace = "Antmicro.Renode.Peripherals.CPU.GuestProfiling.ProtoBuf";
14
15// Special message used for describing a track
16message TrackDescriptor {
17    optional uint64 uuid = 1;
18    optional string name = 2;
19    message CounterDescriptor{}
20    optional CounterDescriptor counter = 8;
21}
22
23// Event that can be logged on the track
24message TrackEvent {
25    optional string name = 23;
26    enum Type {
27        TYPE_UNSPECIFIED = 0;
28        TYPE_SLICE_BEGIN = 1;
29        TYPE_SLICE_END = 2;
30        TYPE_INSTANT = 3;
31        TYPE_COUNTER = 4;
32    }
33    optional Type type = 9;
34    optional uint64 track_uuid = 11;
35
36    oneof counter_value_field {
37        int64 counter_value = 30;
38        double double_counter_value = 44;
39    }
40}
41
42// Main packet that describles a event on the track
43message TracePacket {
44    optional uint64 timestamp = 8;
45
46    oneof data {
47        TrackEvent track_event = 11;
48        TrackDescriptor track_descriptor = 60;
49        bytes synchronization_marker = 36;
50    }
51
52    optional uint32 trusted_packet_sequence_id = 10;
53}
54
55// Used for holding multiple trace packets
56message Trace {
57    repeated TracePacket packets = 1;
58}
59