Compute Graph Framework SDK Reference
5.4.5418 Release
For Test and Development only

ChannelTrace.hpp
Go to the documentation of this file.
1 //
3 // Notice
4 // ALL NVIDIA DESIGN SPECIFICATIONS AND CODE ("MATERIALS") ARE PROVIDED "AS IS" NVIDIA MAKES
5 // NO REPRESENTATIONS, WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
6 // THE MATERIALS, AND EXPRESSLY DISCLAIMS ANY IMPLIED WARRANTIES OF NONINFRINGEMENT,
7 // MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.
8 //
9 // NVIDIA CORPORATION & AFFILIATES assumes no responsibility for the consequences of use of such
10 // information or for any infringement of patents or other rights of third parties that may
11 // result from its use. No license is granted by implication or otherwise under any patent
12 // or patent rights of NVIDIA CORPORATION & AFFILIATES. No third party distribution is allowed unless
13 // expressly authorized by NVIDIA. Details are subject to change without notice.
14 // This code supersedes and replaces all information previously supplied.
15 // NVIDIA CORPORATION & AFFILIATES products are not authorized for use as critical
16 // components in life support devices or systems without express written approval of
17 // NVIDIA CORPORATION & AFFILIATES.
18 //
19 // SPDX-FileCopyrightText: Copyright (c) 2021 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
20 // SPDX-License-Identifier: LicenseRef-NvidiaProprietary
21 //
22 // NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
23 // property and proprietary rights in and to this material, related
24 // documentation and any modifications thereto. Any use, reproduction,
25 // disclosure or distribution of this material and related documentation
26 // without an express license agreement from NVIDIA CORPORATION or
27 // its affiliates is strictly prohibited.
28 //
30 
31 #include <dw/core/base/Status.h>
32 #include <dw/core/language/Function.hpp>
33 #include <dw/core/container/Span.hpp>
34 
35 #ifndef CHANNEL_TRACE_HPP
36 #define CHANNEL_TRACE_HPP
37 
38 namespace dw
39 {
40 namespace framework
41 {
42 
44 {
45  WAIT, // Consumer::wait called by client
46  RECV, // Consumer::recv called by client
47  RELEASE, // Consumer::release called by client
48  DROP, // Consumer drops a packet due to mailbox mode
49  GET, // Producer::get called by client
50  SEND, // Producer::send called by client
51  RETURN // Producer receives a packet returned by consumers
52 };
53 
55 {
56  /*
57  * The hash of the id of the channel involved with this packet
58  */
59  uint32_t channelID;
60  /*
61  * Incremented by the producer every time get is called.
62  */
63  uint32_t getID;
64  /*
65  * The ID of the data buffers used to send this info.
66  * This id indexes the packets in the order they were created and
67  * added to the producer's packet pool
68  */
69  uint32_t bufferID;
70 };
71 
91 {
99  dwStatus status;
104 };
105 
110 {
114  DISABLED,
118  RECORD,
137  REPLAY
138 };
139 
144 using ChannelTraceWriteCallback = dw::core::Function<void(ChannelTracePoint)>;
145 
151 using ChannelTraceReadCallback = dw::core::Function<bool(ChannelTracePoint&)>;
152 
158 using ChannelOnRegisterTraceWriter = dw::core::Function<ChannelTraceWriteCallback(const char* channelID)>;
159 
165 using ChannelOnRegisterTraceReader = dw::core::Function<ChannelTraceReadCallback(const char* channelID)>;
166 
168 {
172  uint32_t channelID;
181 };
182 
186 uint32_t ChannelTraceHashId(const char* id);
187 
231 void ChannelTraceProcess(dw::core::span<ChannelTraceProcessParam> traces);
232 
233 } // framework
234 } // dw
235 
236 #endif // CHANNEL_TRACE_HPP
ChannelPacketFingerprint packetFingerprint
The fingerprint of the packet involved in the event.
uint32_t channelID
The trace ID of the channel to be processed.
dwStatus status
The status returned to the client (for events involving client interaction)
ChannelTraceWriteCallback output
Iterator to write the replayable traces of the channel to be processed.
ChannelTraceMode
A channel is created with a particular mode for these traces.
void ChannelTraceProcess(dw::core::span< ChannelTraceProcessParam > traces)
Process recorded traces from a set of interconnected producers/consumers into a replayable format...
ChannelTraceReadCallback input
Iterator to read the recorded traces of the channel to be processed.
dw::core::Function< void(ChannelTracePoint)> ChannelTraceWriteCallback
Callback used by channel to write a tracepoint.
ChannelTraceEventType eventType
The type of the event recorded in this trace point.
dw::core::Function< ChannelTraceWriteCallback(const char *channelID)> ChannelOnRegisterTraceWriter
Callback used by channel to register its need to write trace points.
dw::core::Function< bool(ChannelTracePoint &)> ChannelTraceReadCallback
Callback used by channel to read a tracepoint.
uint32_t ChannelTraceHashId(const char *id)
Definition: Exception.hpp:46
dw::core::Function< ChannelTraceReadCallback(const char *channelID)> ChannelOnRegisterTraceReader
Callback used by channel to register its need to read trace points.
Traces will be read and enforced by the channel.
This struct records the info relating to a single event on a channel.