Compute Graph Framework SDK Reference  5.8
dwTraceNode.hpp
Go to the documentation of this file.
1
2//
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) 2020-2022 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#ifndef DW_FRAMEWORK_TRACE_NODE_H_
32#define DW_FRAMEWORK_TRACE_NODE_H_
33
34#include <dwcgf/node/Node.hpp>
37#include <dwcgf/port/Port.hpp>
39/* Need to include the appropriate ChannelPacketTypes.hpp since port initialization requires
40 the parameter_trait overrides. Otherwise, it will be considered as a packet of generic type. */
42
43namespace dw
44{
45namespace framework
46{
47
49{
50 // Use this flag when traces are deterministic. When there is uncontrollably large amount of trace(Ex. DW Channel traces),
51 // it is good to disable this flag. After disabling this flag traces won't be dropped.
52 bool stmControlTracing;
53 // DWTrace supports total 32 channels. Following mask allows to enable/disable specific channels.
54 // Only Enabled channels allocated buffers for their channel. This value must match channelMask provided to dwTraceCollectorNode.
55 uint32_t channelMask;
56 // Max trace limit that a channel can handle per epoch.
58};
59
64{
65public:
66 static constexpr char LOG_TAG[] = "dwTraceNode";
67
68 static constexpr auto describeInputPorts()
69 {
71 }
72
73 static constexpr auto describeOutputPorts()
74 {
77 }
78
79 static constexpr auto describePasses()
80 {
82 describePass("SETUP"_sv, DW_PROCESSOR_TYPE_CPU),
83 describePass("PASS_PROCESS"_sv, DW_PROCESSOR_TYPE_CPU),
84 describePass("TEARDOWN"_sv, DW_PROCESSOR_TYPE_CPU));
85 }
86
87 static constexpr auto describeParameters()
88 {
89 return describeConstructorArguments<dwTraceNodeParams, dwContextHandle_t>(
92 bool,
93 "stmControlTracing"_sv,
94 &dwTraceNodeParams::stmControlTracing),
96 uint32_t,
97 "channelMask"_sv,
100 uint32_t,
101 "maxTracesPerChPerEpoch"_sv,
105 dwContextHandle_t)));
106 }
107
108 static std::unique_ptr<dwTraceNode> create(ParameterProvider& provider);
109
110 dwTraceNode(const dwTraceNodeParams& params, const dwContextHandle_t ctx); // context handle is not required in this node
111};
112
113} // namespace framework
114} // namespace dw
115
116#endif // DW_FRAMEWORK_TRACE_NODE_H_
#define DW_DESCRIBE_UNNAMED_PARAMETER(TYPE_NAME, args...)
#define DW_DESCRIBE_PARAMETER(TYPE_NAME, args...)
#define DW_DESCRIBE_PORT(TYPE_NAME, args...)
The interface to access parameter values identified by name and/or (semantic) type.
static constexpr auto describeInputPorts()
Definition: dwTraceNode.hpp:68
static constexpr auto describeParameters()
Definition: dwTraceNode.hpp:87
static constexpr auto describePasses()
Definition: dwTraceNode.hpp:79
static constexpr auto describeOutputPorts()
Definition: dwTraceNode.hpp:73
static constexpr char LOG_TAG[]
Definition: dwTraceNode.hpp:66
dwTraceNode(const dwTraceNodeParams &params, const dwContextHandle_t ctx)
static std::unique_ptr< dwTraceNode > create(ParameterProvider &provider)
dwTraceNodeData { size_t maxDataSize dwTraceNodeData
constexpr auto describePortCollection(Args &&... args)
constexpr std::tuple< dw::core::StringView, dwProcessorType > describePass(dw::core::StringView const &&name, dwProcessorType processorType)
uint32_t channelMask
Definition: dwTraceNode.hpp:55
uint32_t maxTracesPerChPerEpoch
Definition: dwTraceNode.hpp:57
dwTraceNodeParams { bool stmControlTracing dwTraceNodeParams
Definition: dwTraceNode.hpp:52
constexpr auto describeConstructorArgument(const Args &&... args)
constexpr auto describePassCollection(const Args &&... args)
Definition: Exception.hpp:47