Coverage Report

Created: 2024-02-25 06:23

/work/build/gen/protos/perfetto/trace/ftrace/test_bundle_wrapper.gen.cc
Line
Count
Source (jump to first uncovered line)
1
#include "perfetto/protozero/gen_field_helpers.h"
2
#include "perfetto/protozero/message.h"
3
#include "perfetto/protozero/packed_repeated_fields.h"
4
#include "perfetto/protozero/proto_decoder.h"
5
#include "perfetto/protozero/scattered_heap_buffer.h"
6
// DO NOT EDIT. Autogenerated by Perfetto cppgen_plugin
7
#if defined(__GNUC__) || defined(__clang__)
8
#pragma GCC diagnostic push
9
#pragma GCC diagnostic ignored "-Wfloat-equal"
10
#endif
11
#include "protos/perfetto/trace/ftrace/test_bundle_wrapper.gen.h"
12
#include "protos/perfetto/trace/ftrace/ftrace_event_bundle.gen.h"
13
#include "protos/perfetto/trace/ftrace/ftrace_stats.gen.h"
14
#include "protos/perfetto/trace/ftrace/ftrace_event.gen.h"
15
#include "protos/perfetto/trace/ftrace/generic.gen.h"
16
#include "protos/perfetto/trace/ftrace/workqueue.gen.h"
17
#include "protos/perfetto/trace/ftrace/vmscan.gen.h"
18
#include "protos/perfetto/trace/ftrace/virtio_video.gen.h"
19
#include "protos/perfetto/trace/ftrace/virtio_gpu.gen.h"
20
#include "protos/perfetto/trace/ftrace/v4l2.gen.h"
21
#include "protos/perfetto/trace/ftrace/ufs.gen.h"
22
#include "protos/perfetto/trace/ftrace/trusty.gen.h"
23
#include "protos/perfetto/trace/ftrace/thermal.gen.h"
24
#include "protos/perfetto/trace/ftrace/tcp.gen.h"
25
#include "protos/perfetto/trace/ftrace/task.gen.h"
26
#include "protos/perfetto/trace/ftrace/systrace.gen.h"
27
#include "protos/perfetto/trace/ftrace/synthetic.gen.h"
28
#include "protos/perfetto/trace/ftrace/sync.gen.h"
29
#include "protos/perfetto/trace/ftrace/sock.gen.h"
30
#include "protos/perfetto/trace/ftrace/skb.gen.h"
31
#include "protos/perfetto/trace/ftrace/signal.gen.h"
32
#include "protos/perfetto/trace/ftrace/sde.gen.h"
33
#include "protos/perfetto/trace/ftrace/scm.gen.h"
34
#include "protos/perfetto/trace/ftrace/sched.gen.h"
35
#include "protos/perfetto/trace/ftrace/samsung.gen.h"
36
#include "protos/perfetto/trace/ftrace/regulator.gen.h"
37
#include "protos/perfetto/trace/ftrace/raw_syscalls.gen.h"
38
#include "protos/perfetto/trace/ftrace/printk.gen.h"
39
#include "protos/perfetto/trace/ftrace/power.gen.h"
40
#include "protos/perfetto/trace/ftrace/perf_trace_counters.gen.h"
41
#include "protos/perfetto/trace/ftrace/panel.gen.h"
42
#include "protos/perfetto/trace/ftrace/oom.gen.h"
43
#include "protos/perfetto/trace/ftrace/net.gen.h"
44
#include "protos/perfetto/trace/ftrace/mm_event.gen.h"
45
#include "protos/perfetto/trace/ftrace/mdss.gen.h"
46
#include "protos/perfetto/trace/ftrace/mali.gen.h"
47
#include "protos/perfetto/trace/ftrace/lwis.gen.h"
48
#include "protos/perfetto/trace/ftrace/lowmemorykiller.gen.h"
49
#include "protos/perfetto/trace/ftrace/kvm.gen.h"
50
#include "protos/perfetto/trace/ftrace/kmem.gen.h"
51
#include "protos/perfetto/trace/ftrace/irq.gen.h"
52
#include "protos/perfetto/trace/ftrace/ipi.gen.h"
53
#include "protos/perfetto/trace/ftrace/ion.gen.h"
54
#include "protos/perfetto/trace/ftrace/i2c.gen.h"
55
#include "protos/perfetto/trace/ftrace/hyp.gen.h"
56
#include "protos/perfetto/trace/ftrace/gpu_scheduler.gen.h"
57
#include "protos/perfetto/trace/ftrace/gpu_mem.gen.h"
58
#include "protos/perfetto/trace/ftrace/g2d.gen.h"
59
#include "protos/perfetto/trace/ftrace/ftrace.gen.h"
60
#include "protos/perfetto/trace/ftrace/filemap.gen.h"
61
#include "protos/perfetto/trace/ftrace/fence.gen.h"
62
#include "protos/perfetto/trace/ftrace/fastrpc.gen.h"
63
#include "protos/perfetto/trace/ftrace/f2fs.gen.h"
64
#include "protos/perfetto/trace/ftrace/ext4.gen.h"
65
#include "protos/perfetto/trace/ftrace/drm.gen.h"
66
#include "protos/perfetto/trace/ftrace/dpu.gen.h"
67
#include "protos/perfetto/trace/ftrace/dmabuf_heap.gen.h"
68
#include "protos/perfetto/trace/ftrace/dma_fence.gen.h"
69
#include "protos/perfetto/trace/ftrace/cros_ec.gen.h"
70
#include "protos/perfetto/trace/ftrace/cpuhp.gen.h"
71
#include "protos/perfetto/trace/ftrace/compaction.gen.h"
72
#include "protos/perfetto/trace/ftrace/cma.gen.h"
73
#include "protos/perfetto/trace/ftrace/clk.gen.h"
74
#include "protos/perfetto/trace/ftrace/cgroup.gen.h"
75
#include "protos/perfetto/trace/ftrace/block.gen.h"
76
#include "protos/perfetto/trace/ftrace/binder.gen.h"
77
#include "protos/perfetto/trace/ftrace/android_fs.gen.h"
78
79
namespace perfetto {
80
namespace protos {
81
namespace gen {
82
83
0
TestBundleWrapper::TestBundleWrapper() = default;
84
0
TestBundleWrapper::~TestBundleWrapper() = default;
85
0
TestBundleWrapper::TestBundleWrapper(const TestBundleWrapper&) = default;
86
0
TestBundleWrapper& TestBundleWrapper::operator=(const TestBundleWrapper&) = default;
87
0
TestBundleWrapper::TestBundleWrapper(TestBundleWrapper&&) noexcept = default;
88
0
TestBundleWrapper& TestBundleWrapper::operator=(TestBundleWrapper&&) = default;
89
90
0
bool TestBundleWrapper::operator==(const TestBundleWrapper& other) const {
91
0
  return ::protozero::internal::gen_helpers::EqualsField(unknown_fields_, other.unknown_fields_)
92
0
   && ::protozero::internal::gen_helpers::EqualsField(before_, other.before_)
93
0
   && ::protozero::internal::gen_helpers::EqualsField(bundle_, other.bundle_)
94
0
   && ::protozero::internal::gen_helpers::EqualsField(after_, other.after_);
95
0
}
96
97
0
int TestBundleWrapper::bundle_size() const { return static_cast<int>(bundle_.size()); }
98
0
void TestBundleWrapper::clear_bundle() { bundle_.clear(); }
99
0
FtraceEventBundle* TestBundleWrapper::add_bundle() { bundle_.emplace_back(); return &bundle_.back(); }
100
0
bool TestBundleWrapper::ParseFromArray(const void* raw, size_t size) {
101
0
  bundle_.clear();
102
0
  unknown_fields_.clear();
103
0
  bool packed_error = false;
104
105
0
  ::protozero::ProtoDecoder dec(raw, size);
106
0
  for (auto field = dec.ReadField(); field.valid(); field = dec.ReadField()) {
107
0
    if (field.id() < _has_field_.size()) {
108
0
      _has_field_.set(field.id());
109
0
    }
110
0
    switch (field.id()) {
111
0
      case 1 /* before */:
112
0
        ::protozero::internal::gen_helpers::DeserializeString(field, &before_);
113
0
        break;
114
0
      case 2 /* bundle */:
115
0
        bundle_.emplace_back();
116
0
        bundle_.back().ParseFromArray(field.data(), field.size());
117
0
        break;
118
0
      case 3 /* after */:
119
0
        ::protozero::internal::gen_helpers::DeserializeString(field, &after_);
120
0
        break;
121
0
      default:
122
0
        field.SerializeAndAppendTo(&unknown_fields_);
123
0
        break;
124
0
    }
125
0
  }
126
0
  return !packed_error && !dec.bytes_left();
127
0
}
128
129
0
std::string TestBundleWrapper::SerializeAsString() const {
130
0
  ::protozero::internal::gen_helpers::MessageSerializer msg;
131
0
  Serialize(msg.get());
132
0
  return msg.SerializeAsString();
133
0
}
134
135
0
std::vector<uint8_t> TestBundleWrapper::SerializeAsArray() const {
136
0
  ::protozero::internal::gen_helpers::MessageSerializer msg;
137
0
  Serialize(msg.get());
138
0
  return msg.SerializeAsArray();
139
0
}
140
141
0
void TestBundleWrapper::Serialize(::protozero::Message* msg) const {
142
  // Field 1: before
143
0
  if (_has_field_[1]) {
144
0
    ::protozero::internal::gen_helpers::SerializeString(1, before_, msg);
145
0
  }
146
147
  // Field 2: bundle
148
0
  for (auto& it : bundle_) {
149
0
    it.Serialize(msg->BeginNestedMessage<::protozero::Message>(2));
150
0
  }
151
152
  // Field 3: after
153
0
  if (_has_field_[3]) {
154
0
    ::protozero::internal::gen_helpers::SerializeString(3, after_, msg);
155
0
  }
156
157
0
  protozero::internal::gen_helpers::SerializeUnknownFields(unknown_fields_, msg);
158
0
}
159
160
}  // namespace perfetto
161
}  // namespace protos
162
}  // namespace gen
163
#if defined(__GNUC__) || defined(__clang__)
164
#pragma GCC diagnostic pop
165
#endif