blob: 0323f62d80d47567b738488c9a4d6ef9df045ce0 [file] [log] [blame]
Ferran Balaguer1b941722019-08-28 16:57:18 +01001//
2// Copyright © 2019 Arm Ltd. All rights reserved.
3// SPDX-License-Identifier: MIT
4//
5
6#pragma once
7
Matteo Martincigh24e8f922019-09-19 11:57:46 +01008#include <SendCounterPacket.hpp>
9#include <ProfilingUtils.hpp>
Ferran Balaguer1b941722019-08-28 16:57:18 +010010
11#include <armnn/Exceptions.hpp>
Matteo Martincigh24e8f922019-09-19 11:57:46 +010012#include <armnn/Optional.hpp>
13#include <armnn/Conversion.hpp>
Ferran Balaguer1b941722019-08-28 16:57:18 +010014
Matteo Martincigh24e8f922019-09-19 11:57:46 +010015#include <boost/numeric/conversion/cast.hpp>
Ferran Balaguer1b941722019-08-28 16:57:18 +010016
Matteo Martincigh24e8f922019-09-19 11:57:46 +010017namespace armnn
18{
Ferran Balaguer1b941722019-08-28 16:57:18 +010019
Matteo Martincigh24e8f922019-09-19 11:57:46 +010020namespace profiling
21{
22
23class MockProfilingConnection : public IProfilingConnection
24{
25public:
26 MockProfilingConnection()
27 : m_IsOpen(true)
28 {}
29
30 bool IsOpen() override { return m_IsOpen; }
31
32 void Close() override { m_IsOpen = false; }
33
34 bool WritePacket(const unsigned char* buffer, uint32_t length) override
35 {
36 return buffer != nullptr && length > 0;
37 }
38
39 Packet ReadPacket(uint32_t timeout) override { return Packet(); }
40
41private:
42 bool m_IsOpen;
43};
Ferran Balaguer1b941722019-08-28 16:57:18 +010044
Narumol Prangnawarat0ec068f2019-09-30 16:20:20 +010045class MockWriteProfilingConnection : public IProfilingConnection
46{
47public:
48 MockWriteProfilingConnection()
49 : m_IsOpen(true)
50 {}
51
52 bool IsOpen() override { return m_IsOpen; }
53
54 void Close() override { m_IsOpen = false; }
55
56 bool WritePacket(const unsigned char* buffer, uint32_t length) override
57 {
58 m_WrittenData.push_back(length);
59 return buffer != nullptr && length > 0;
60 }
61
62 Packet ReadPacket(uint32_t timeout) override { return Packet(); }
63
64 std::vector<uint32_t> GetWrittenData()
65 {
66 return m_WrittenData;
67 }
68
69private:
70 bool m_IsOpen;
71 std::vector<uint32_t> m_WrittenData;
72};
73
Narumol Prangnawarat404b2752019-09-24 17:23:16 +010074class MockPacketBuffer : public IPacketBuffer
Ferran Balaguer1b941722019-08-28 16:57:18 +010075{
76public:
Narumol Prangnawarat404b2752019-09-24 17:23:16 +010077 MockPacketBuffer(unsigned int maxSize)
Matteo Martincigh61d6f732019-10-03 11:21:18 +010078 : m_MaxSize(maxSize)
79 , m_Size(0)
80 , m_Data(std::make_unique<unsigned char[]>(m_MaxSize))
81 {}
Ferran Balaguer1b941722019-08-28 16:57:18 +010082
Narumol Prangnawarat404b2752019-09-24 17:23:16 +010083 ~MockPacketBuffer() {}
84
85 const unsigned char* const GetReadableData() const override { return m_Data.get(); }
86
87 unsigned int GetSize() const override { return m_Size; }
88
Matteo Martincigh61d6f732019-10-03 11:21:18 +010089 void MarkRead() override { m_Size = 0; }
Narumol Prangnawarat404b2752019-09-24 17:23:16 +010090
91 void Commit(unsigned int size) override { m_Size = size; }
92
93 void Release() override { m_Size = 0; }
94
95 unsigned char* GetWritableData() override { return m_Data.get(); }
96
97private:
98 unsigned int m_MaxSize;
99 unsigned int m_Size;
100 std::unique_ptr<unsigned char[]> m_Data;
101};
102
103class MockBufferManager : public IBufferManager
104{
105public:
106 MockBufferManager(unsigned int size)
107 : m_BufferSize(size),
108 m_Buffer(std::make_unique<MockPacketBuffer>(size)) {}
109
110 ~MockBufferManager() {}
111
112 std::unique_ptr<IPacketBuffer> Reserve(unsigned int requestedSize, unsigned int& reservedSize) override
Ferran Balaguer1b941722019-08-28 16:57:18 +0100113 {
114 if (requestedSize > m_BufferSize)
115 {
116 reservedSize = m_BufferSize;
117 }
118 else
119 {
120 reservedSize = requestedSize;
121 }
122
Narumol Prangnawarat404b2752019-09-24 17:23:16 +0100123 return std::move(m_Buffer);
Ferran Balaguer1b941722019-08-28 16:57:18 +0100124 }
125
Narumol Prangnawarat404b2752019-09-24 17:23:16 +0100126 void Commit(std::unique_ptr<IPacketBuffer>& packetBuffer, unsigned int size) override
Ferran Balaguer1b941722019-08-28 16:57:18 +0100127 {
Narumol Prangnawarat404b2752019-09-24 17:23:16 +0100128 packetBuffer->Commit(size);
129 m_Buffer = std::move(packetBuffer);
Ferran Balaguer1b941722019-08-28 16:57:18 +0100130 }
131
Narumol Prangnawarat404b2752019-09-24 17:23:16 +0100132 std::unique_ptr<IPacketBuffer> GetReadableBuffer() override
133 {
134 return std::move(m_Buffer);
135 }
136
137 void Release(std::unique_ptr<IPacketBuffer>& packetBuffer) override
138 {
139 packetBuffer->Release();
140 m_Buffer = std::move(packetBuffer);
141 }
142
143 void MarkRead(std::unique_ptr<IPacketBuffer>& packetBuffer) override
144 {
145 packetBuffer->MarkRead();
146 m_Buffer = std::move(packetBuffer);
147 }
Ferran Balaguer1b941722019-08-28 16:57:18 +0100148
149private:
150 unsigned int m_BufferSize;
Narumol Prangnawarat404b2752019-09-24 17:23:16 +0100151 std::unique_ptr<IPacketBuffer> m_Buffer;
Ferran Balaguer1b941722019-08-28 16:57:18 +0100152};
153
Narumol Prangnawarat404b2752019-09-24 17:23:16 +0100154class MockStreamCounterBuffer : public IBufferManager
Matteo Martincigh24e8f922019-09-19 11:57:46 +0100155{
156public:
Matteo Martincigh61d6f732019-10-03 11:21:18 +0100157 using IPacketBufferPtr = std::unique_ptr<IPacketBuffer>;
Matteo Martincigh24e8f922019-09-19 11:57:46 +0100158
Matteo Martincigh61d6f732019-10-03 11:21:18 +0100159 MockStreamCounterBuffer(unsigned int maxBufferSize = 4096)
160 : m_MaxBufferSize(maxBufferSize)
161 , m_BufferList()
162 , m_CommittedSize(0)
163 , m_ReadableSize(0)
164 , m_ReadSize(0)
165 {}
Narumol Prangnawarat404b2752019-09-24 17:23:16 +0100166 ~MockStreamCounterBuffer() {}
Matteo Martincigh24e8f922019-09-19 11:57:46 +0100167
Matteo Martincigh61d6f732019-10-03 11:21:18 +0100168 IPacketBufferPtr Reserve(unsigned int requestedSize, unsigned int& reservedSize) override
Narumol Prangnawarat404b2752019-09-24 17:23:16 +0100169 {
Matteo Martincigh61d6f732019-10-03 11:21:18 +0100170 std::unique_lock<std::mutex> lock(m_Mutex);
171
172 reservedSize = 0;
Narumol Prangnawarat404b2752019-09-24 17:23:16 +0100173 if (requestedSize > m_MaxBufferSize)
Narumol Prangnawarat7be47ef2019-09-27 18:00:11 +0100174 {
Matteo Martincigh61d6f732019-10-03 11:21:18 +0100175 throw armnn::InvalidArgumentException("The maximum buffer size that can be requested is [" +
176 std::to_string(m_MaxBufferSize) + "] bytes");
Narumol Prangnawarat7be47ef2019-09-27 18:00:11 +0100177 }
Narumol Prangnawarat404b2752019-09-24 17:23:16 +0100178 reservedSize = requestedSize;
Matteo Martincigh61d6f732019-10-03 11:21:18 +0100179 return std::make_unique<MockPacketBuffer>(requestedSize);
Narumol Prangnawarat404b2752019-09-24 17:23:16 +0100180 }
181
Matteo Martincigh61d6f732019-10-03 11:21:18 +0100182 void Commit(IPacketBufferPtr& packetBuffer, unsigned int size) override
Narumol Prangnawarat404b2752019-09-24 17:23:16 +0100183 {
Matteo Martincigh61d6f732019-10-03 11:21:18 +0100184 std::unique_lock<std::mutex> lock(m_Mutex);
185
186 packetBuffer->Commit(size);
187 m_BufferList.push_back(std::move(packetBuffer));
Matteo Martincigh24e8f922019-09-19 11:57:46 +0100188 m_CommittedSize += size;
189 }
190
Matteo Martincigh61d6f732019-10-03 11:21:18 +0100191 void Release(IPacketBufferPtr& packetBuffer) override
Matteo Martincigh24e8f922019-09-19 11:57:46 +0100192 {
Matteo Martincigh61d6f732019-10-03 11:21:18 +0100193 std::unique_lock<std::mutex> lock(m_Mutex);
194
195 packetBuffer->Release();
Matteo Martincigh24e8f922019-09-19 11:57:46 +0100196 }
197
Matteo Martincigh61d6f732019-10-03 11:21:18 +0100198 IPacketBufferPtr GetReadableBuffer() override
Matteo Martincigh24e8f922019-09-19 11:57:46 +0100199 {
Matteo Martincigh61d6f732019-10-03 11:21:18 +0100200 std::unique_lock<std::mutex> lock(m_Mutex);
201
202 if (m_BufferList.empty())
Matteo Martincigh24e8f922019-09-19 11:57:46 +0100203 {
Matteo Martincigh61d6f732019-10-03 11:21:18 +0100204 return nullptr;
Matteo Martincigh24e8f922019-09-19 11:57:46 +0100205 }
Matteo Martincigh61d6f732019-10-03 11:21:18 +0100206 IPacketBufferPtr buffer = std::move(m_BufferList.back());
207 m_BufferList.pop_back();
208 m_ReadableSize += buffer->GetSize();
209 return buffer;
Matteo Martincigh24e8f922019-09-19 11:57:46 +0100210 }
211
Matteo Martincigh61d6f732019-10-03 11:21:18 +0100212 void MarkRead(IPacketBufferPtr& packetBuffer) override
Narumol Prangnawarat404b2752019-09-24 17:23:16 +0100213 {
Matteo Martincigh61d6f732019-10-03 11:21:18 +0100214 std::unique_lock<std::mutex> lock(m_Mutex);
215
Narumol Prangnawarat404b2752019-09-24 17:23:16 +0100216 m_ReadSize += packetBuffer->GetSize();
217 packetBuffer->MarkRead();
Narumol Prangnawarat404b2752019-09-24 17:23:16 +0100218 }
219
Matteo Martincigh61d6f732019-10-03 11:21:18 +0100220 unsigned int GetCommittedSize() const { return m_CommittedSize; }
221 unsigned int GetReadableSize() const { return m_ReadableSize; }
222 unsigned int GetReadSize() const { return m_ReadSize; }
Matteo Martincigh24e8f922019-09-19 11:57:46 +0100223
224private:
Matteo Martincigh61d6f732019-10-03 11:21:18 +0100225 // The maximum buffer size when creating a new buffer
Narumol Prangnawarat404b2752019-09-24 17:23:16 +0100226 unsigned int m_MaxBufferSize;
Narumol Prangnawarat404b2752019-09-24 17:23:16 +0100227
Matteo Martincigh61d6f732019-10-03 11:21:18 +0100228 // A list of buffers
229 std::vector<IPacketBufferPtr> m_BufferList;
Matteo Martincigh24e8f922019-09-19 11:57:46 +0100230
Matteo Martincigh61d6f732019-10-03 11:21:18 +0100231 // The mutex to synchronize this mock's methods
232 std::mutex m_Mutex;
233
234 // The total size of the buffers that has been committed for reading
Narumol Prangnawarat404b2752019-09-24 17:23:16 +0100235 unsigned int m_CommittedSize;
Matteo Martincigh24e8f922019-09-19 11:57:46 +0100236
Matteo Martincigh61d6f732019-10-03 11:21:18 +0100237 // The total size of the buffers that can be read
238 unsigned int m_ReadableSize;
239
240 // The total size of the buffers that has already been read
Narumol Prangnawarat404b2752019-09-24 17:23:16 +0100241 unsigned int m_ReadSize;
Matteo Martincigh24e8f922019-09-19 11:57:46 +0100242};
243
Ferran Balaguer1b941722019-08-28 16:57:18 +0100244class MockSendCounterPacket : public ISendCounterPacket
245{
246public:
Narumol Prangnawarat404b2752019-09-24 17:23:16 +0100247 MockSendCounterPacket(IBufferManager& sendBuffer) : m_BufferManager(sendBuffer) {}
Ferran Balaguer1b941722019-08-28 16:57:18 +0100248
249 void SendStreamMetaDataPacket() override
250 {
251 std::string message("SendStreamMetaDataPacket");
252 unsigned int reserved = 0;
Narumol Prangnawarat404b2752019-09-24 17:23:16 +0100253 std::unique_ptr<IPacketBuffer> buffer = m_BufferManager.Reserve(1024, reserved);
254 memcpy(buffer->GetWritableData(), message.c_str(), static_cast<unsigned int>(message.size()) + 1);
255 m_BufferManager.Commit(buffer, reserved);
Ferran Balaguer1b941722019-08-28 16:57:18 +0100256 }
257
Matteo Martincigh42f9d9e2019-09-05 12:02:04 +0100258 void SendCounterDirectoryPacket(const ICounterDirectory& counterDirectory) override
Ferran Balaguer1b941722019-08-28 16:57:18 +0100259 {
260 std::string message("SendCounterDirectoryPacket");
261 unsigned int reserved = 0;
Narumol Prangnawarat404b2752019-09-24 17:23:16 +0100262 std::unique_ptr<IPacketBuffer> buffer = m_BufferManager.Reserve(1024, reserved);
263 memcpy(buffer->GetWritableData(), message.c_str(), static_cast<unsigned int>(message.size()) + 1);
264 m_BufferManager.Commit(buffer, reserved);
Ferran Balaguer1b941722019-08-28 16:57:18 +0100265 }
266
267 void SendPeriodicCounterCapturePacket(uint64_t timestamp,
268 const std::vector<std::pair<uint16_t, uint32_t>>& values) override
269 {
270 std::string message("SendPeriodicCounterCapturePacket");
271 unsigned int reserved = 0;
Narumol Prangnawarat404b2752019-09-24 17:23:16 +0100272 std::unique_ptr<IPacketBuffer> buffer = m_BufferManager.Reserve(1024, reserved);
273 memcpy(buffer->GetWritableData(), message.c_str(), static_cast<unsigned int>(message.size()) + 1);
274 m_BufferManager.Commit(buffer, reserved);
Ferran Balaguer1b941722019-08-28 16:57:18 +0100275 }
276
277 void SendPeriodicCounterSelectionPacket(uint32_t capturePeriod,
278 const std::vector<uint16_t>& selectedCounterIds) override
279 {
280 std::string message("SendPeriodicCounterSelectionPacket");
281 unsigned int reserved = 0;
Narumol Prangnawarat404b2752019-09-24 17:23:16 +0100282 std::unique_ptr<IPacketBuffer> buffer = m_BufferManager.Reserve(1024, reserved);
283 memcpy(buffer->GetWritableData(), message.c_str(), static_cast<unsigned int>(message.size()) + 1);
284 m_BufferManager.Commit(buffer, reserved);
Ferran Balaguer1b941722019-08-28 16:57:18 +0100285 }
286
Matteo Martincigh24e8f922019-09-19 11:57:46 +0100287 void SetReadyToRead() override {}
Ferran Balaguer1b941722019-08-28 16:57:18 +0100288
289private:
Narumol Prangnawarat404b2752019-09-24 17:23:16 +0100290 IBufferManager& m_BufferManager;
Ferran Balaguer1b941722019-08-28 16:57:18 +0100291};
Matteo Martincigh42f9d9e2019-09-05 12:02:04 +0100292
293class MockCounterDirectory : public ICounterDirectory
294{
295public:
296 MockCounterDirectory() = default;
297 ~MockCounterDirectory() = default;
298
299 // Register profiling objects
300 const Category* RegisterCategory(const std::string& categoryName,
301 const armnn::Optional<uint16_t>& deviceUid = armnn::EmptyOptional(),
302 const armnn::Optional<uint16_t>& counterSetUid = armnn::EmptyOptional())
303 {
304 // Get the device UID
305 uint16_t deviceUidValue = deviceUid.has_value() ? deviceUid.value() : 0;
306
307 // Get the counter set UID
308 uint16_t counterSetUidValue = counterSetUid.has_value() ? counterSetUid.value() : 0;
309
310 // Create the category
311 CategoryPtr category = std::make_unique<Category>(categoryName, deviceUidValue, counterSetUidValue);
312 BOOST_ASSERT(category);
313
314 // Get the raw category pointer
315 const Category* categoryPtr = category.get();
316 BOOST_ASSERT(categoryPtr);
317
318 // Register the category
319 m_Categories.insert(std::move(category));
320
321 return categoryPtr;
322 }
323
324 const Device* RegisterDevice(const std::string& deviceName,
325 uint16_t cores = 0,
326 const armnn::Optional<std::string>& parentCategoryName = armnn::EmptyOptional())
327 {
328 // Get the device UID
329 uint16_t deviceUid = GetNextUid();
330
331 // Create the device
332 DevicePtr device = std::make_unique<Device>(deviceUid, deviceName, cores);
333 BOOST_ASSERT(device);
334
335 // Get the raw device pointer
336 const Device* devicePtr = device.get();
337 BOOST_ASSERT(devicePtr);
338
339 // Register the device
340 m_Devices.insert(std::make_pair(deviceUid, std::move(device)));
341
342 // Connect the counter set to the parent category, if required
343 if (parentCategoryName.has_value())
344 {
345 // Set the counter set UID in the parent category
346 Category* parentCategory = const_cast<Category*>(GetCategory(parentCategoryName.value()));
347 BOOST_ASSERT(parentCategory);
348 parentCategory->m_DeviceUid = deviceUid;
349 }
350
351 return devicePtr;
352 }
353
354 const CounterSet* RegisterCounterSet(
355 const std::string& counterSetName,
356 uint16_t count = 0,
357 const armnn::Optional<std::string>& parentCategoryName = armnn::EmptyOptional())
358 {
359 // Get the counter set UID
360 uint16_t counterSetUid = GetNextUid();
361
362 // Create the counter set
363 CounterSetPtr counterSet = std::make_unique<CounterSet>(counterSetUid, counterSetName, count);
364 BOOST_ASSERT(counterSet);
365
366 // Get the raw counter set pointer
367 const CounterSet* counterSetPtr = counterSet.get();
368 BOOST_ASSERT(counterSetPtr);
369
370 // Register the counter set
371 m_CounterSets.insert(std::make_pair(counterSetUid, std::move(counterSet)));
372
373 // Connect the counter set to the parent category, if required
374 if (parentCategoryName.has_value())
375 {
376 // Set the counter set UID in the parent category
377 Category* parentCategory = const_cast<Category*>(GetCategory(parentCategoryName.value()));
378 BOOST_ASSERT(parentCategory);
379 parentCategory->m_CounterSetUid = counterSetUid;
380 }
381
382 return counterSetPtr;
383 }
384
385 const Counter* RegisterCounter(const std::string& parentCategoryName,
386 uint16_t counterClass,
387 uint16_t interpolation,
388 double multiplier,
389 const std::string& name,
390 const std::string& description,
391 const armnn::Optional<std::string>& units = armnn::EmptyOptional(),
392 const armnn::Optional<uint16_t>& numberOfCores = armnn::EmptyOptional(),
393 const armnn::Optional<uint16_t>& deviceUid = armnn::EmptyOptional(),
394 const armnn::Optional<uint16_t>& counterSetUid = armnn::EmptyOptional())
395 {
396 // Get the number of cores from the argument only
397 uint16_t deviceCores = numberOfCores.has_value() ? numberOfCores.value() : 0;
398
399 // Get the device UID
400 uint16_t deviceUidValue = deviceUid.has_value() ? deviceUid.value() : 0;
401
402 // Get the counter set UID
403 uint16_t counterSetUidValue = counterSetUid.has_value() ? counterSetUid.value() : 0;
404
405 // Get the counter UIDs and calculate the max counter UID
406 std::vector<uint16_t> counterUids = GetNextCounterUids(deviceCores);
407 BOOST_ASSERT(!counterUids.empty());
408 uint16_t maxCounterUid = deviceCores <= 1 ? counterUids.front() : counterUids.back();
409
410 // Get the counter units
411 const std::string unitsValue = units.has_value() ? units.value() : "";
412
413 // Create the counter
414 CounterPtr counter = std::make_shared<Counter>(counterUids.front(),
415 maxCounterUid,
416 counterClass,
417 interpolation,
418 multiplier,
419 name,
420 description,
421 unitsValue,
422 deviceUidValue,
423 counterSetUidValue);
424 BOOST_ASSERT(counter);
425
426 // Get the raw counter pointer
427 const Counter* counterPtr = counter.get();
428 BOOST_ASSERT(counterPtr);
429
430 // Process multiple counters if necessary
431 for (uint16_t counterUid : counterUids)
432 {
433 // Connect the counter to the parent category
434 Category* parentCategory = const_cast<Category*>(GetCategory(parentCategoryName));
435 BOOST_ASSERT(parentCategory);
436 parentCategory->m_Counters.push_back(counterUid);
437
438 // Register the counter
439 m_Counters.insert(std::make_pair(counterUid, counter));
440 }
441
442 return counterPtr;
443 }
444
445 // Getters for counts
446 uint16_t GetCategoryCount() const override { return boost::numeric_cast<uint16_t>(m_Categories.size()); }
447 uint16_t GetDeviceCount() const override { return boost::numeric_cast<uint16_t>(m_Devices.size()); }
448 uint16_t GetCounterSetCount() const override { return boost::numeric_cast<uint16_t>(m_CounterSets.size()); }
449 uint16_t GetCounterCount() const override { return boost::numeric_cast<uint16_t>(m_Counters.size()); }
450
451 // Getters for collections
452 const Categories& GetCategories() const override { return m_Categories; }
453 const Devices& GetDevices() const override { return m_Devices; }
454 const CounterSets& GetCounterSets() const override { return m_CounterSets; }
455 const Counters& GetCounters() const override { return m_Counters; }
456
457 // Getters for profiling objects
458 const Category* GetCategory(const std::string& name) const override
459 {
460 auto it = std::find_if(m_Categories.begin(), m_Categories.end(), [&name](const CategoryPtr& category)
461 {
462 BOOST_ASSERT(category);
463
464 return category->m_Name == name;
465 });
466
467 if (it == m_Categories.end())
468 {
469 return nullptr;
470 }
471
472 return it->get();
473 }
474
475 const Device* GetDevice(uint16_t uid) const override
476 {
477 return nullptr; // Not used by the unit tests
478 }
479
480 const CounterSet* GetCounterSet(uint16_t uid) const override
481 {
482 return nullptr; // Not used by the unit tests
483 }
484
485 const Counter* GetCounter(uint16_t uid) const override
486 {
487 return nullptr; // Not used by the unit tests
488 }
489
490private:
491 Categories m_Categories;
492 Devices m_Devices;
493 CounterSets m_CounterSets;
494 Counters m_Counters;
495};
496
497class SendCounterPacketTest : public SendCounterPacket
498{
499public:
Matteo Martincighe61ffd02019-10-07 10:19:35 +0100500 SendCounterPacketTest(IBufferManager& buffer)
501 : SendCounterPacket(buffer)
Matteo Martincigh42f9d9e2019-09-05 12:02:04 +0100502 {}
503
504 bool CreateDeviceRecordTest(const DevicePtr& device,
505 DeviceRecord& deviceRecord,
506 std::string& errorMessage)
507 {
508 return CreateDeviceRecord(device, deviceRecord, errorMessage);
509 }
510
511 bool CreateCounterSetRecordTest(const CounterSetPtr& counterSet,
512 CounterSetRecord& counterSetRecord,
513 std::string& errorMessage)
514 {
515 return CreateCounterSetRecord(counterSet, counterSetRecord, errorMessage);
516 }
517
518 bool CreateEventRecordTest(const CounterPtr& counter,
519 EventRecord& eventRecord,
520 std::string& errorMessage)
521 {
522 return CreateEventRecord(counter, eventRecord, errorMessage);
523 }
524
525 bool CreateCategoryRecordTest(const CategoryPtr& category,
526 const Counters& counters,
527 CategoryRecord& categoryRecord,
528 std::string& errorMessage)
529 {
530 return CreateCategoryRecord(category, counters, categoryRecord, errorMessage);
531 }
532};
Matteo Martincigh24e8f922019-09-19 11:57:46 +0100533
534} // namespace profiling
535
536} // namespace armnn