Compute Graph Framework SDK Reference  5.12
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-2023 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 DWFRAMEWORK_DWNODES_DWTRACE_TRACENODE_DWTRACENODE_HPP_
32#define DWFRAMEWORK_DWNODES_DWTRACE_TRACENODE_DWTRACENODE_HPP_
33
34#include <dwcgf/node/Node.hpp>
37#include <dwcgf/port/Port.hpp>
39#include <dwframework/dwnodes/common/channelpackets/SensorCommonTypes.hpp>
40
41namespace dw
42{
43namespace framework
44{
45
47{
48 // Use this flag when traces are deterministic. When there is uncontrollably large amount of trace(Ex. DW Channel traces),
49 // it is good to disable this flag. After disabling this flag traces won't be dropped.
50 bool stmControlTracing;
51 // DWTrace supports total 32 channels. Following mask allows to enable/disable specific channels.
52 // Only Enabled channels allocated buffers for their channel. This value must match channelMask provided to dwTraceCollectorNode.
53 uint32_t channelMask;
54 // Max trace limit that a channel can handle per epoch.
56};
57
62{
63public:
64 // TODO(csketch): FP -- This is used when the logger is called and not just at assignment.
65 // coverity[autosar_cpp14_a0_1_1_violation] FP: nvbugs/2980283
66 // coverity[autosar_cpp14_m0_1_4_violation] FP: nvbugs/2980283
67 static constexpr char8_t LOG_TAG[]{"dwTraceNode"};
68
69 // coverity[autosar_cpp14_a7_1_5_violation] RFD Accepted: TID-1984
70 static constexpr auto describeInputPorts()
71 {
72 // TODO(csketch): RFD -- user defined literal being interpreted as c style cast.
73 // coverity[autosar_cpp14_a5_2_2_violation] RFD Pending: TID-1983
74 // TODO(csketch): RFD -- user defined literal being interpreted as c style cast.
75 // coverity[autosar_cpp14_a5_2_2_violation] RFD Pending: TID-1983
77 }
78
79 // coverity[autosar_cpp14_a7_1_5_violation] RFD Accepted: TID-1984
80 static constexpr auto describeOutputPorts()
81 {
82 // TODO(csketch): RFD -- user defined literal being interpreted as c style cast.
83 // coverity[autosar_cpp14_a5_2_2_violation] RFD Pending: TID-1983
85 DW_DESCRIBE_PORT(dwTraceNodeData, "TRACE"_sv, PortBinding::REQUIRED));
86 }
87
88 // coverity[autosar_cpp14_a7_1_5_violation] RFD Accepted: TID-1984
89 static constexpr auto describePasses()
90 {
92 describePass(StringView{"SETUP"}, DW_PROCESSOR_TYPE_CPU),
93 describePass(StringView{"PASS_PROCESS"}, DW_PROCESSOR_TYPE_CPU),
94 describePass(StringView{"TEARDOWN"}, DW_PROCESSOR_TYPE_CPU));
95 }
96
97 // coverity[autosar_cpp14_a7_1_5_violation] RFD Accepted: TID-1984
98 static constexpr auto describeParameters()
99 {
100 // TODO(csketch): RFD -- user defined literal being interpreted as c style cast.
101 // coverity[autosar_cpp14_a5_2_2_violation] RFD Pending: TID-1983
102 return describeConstructorArguments<dwTraceNodeParams, dwContextHandle_t>(
105 bool,
106 "stmControlTracing"_sv,
107 &dwTraceNodeParams::stmControlTracing),
109 uint32_t,
110 "channelMask"_sv,
113 uint32_t,
114 "maxTracesPerChPerEpoch"_sv,
118 dwContextHandle_t)));
119 }
120
121 static std::unique_ptr<dwTraceNode> create(ParameterProvider& provider);
122
123 dwTraceNode(const dwTraceNodeParams& params, const dwContextHandle_t ctx); // context handle is not required in this node
124};
125
126} // namespace framework
127} // namespace dw
128
129#endif // DWFRAMEWORK_DWNODES_DWTRACE_TRACENODE_DWTRACENODE_HPP_
#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:70
static constexpr auto describeParameters()
Definition: dwTraceNode.hpp:98
static constexpr auto describePasses()
Definition: dwTraceNode.hpp:89
static constexpr char8_t LOG_TAG[]
Definition: dwTraceNode.hpp:67
static constexpr auto describeOutputPorts()
Definition: dwTraceNode.hpp:80
dwTraceNode(const dwTraceNodeParams &params, const dwContextHandle_t ctx)
static std::unique_ptr< dwTraceNode > create(ParameterProvider &provider)
constexpr auto describeConstructorArgument(const Args &&... args) -> dw::core::Tuple< Args... >
constexpr std::tuple< dw::core::StringView, dwProcessorType > describePass(dw::core::StringView const &&name, dwProcessorType processorType)
uint32_t maxTracesPerChPerEpoch
Definition: dwTraceNode.hpp:55
constexpr auto describePassCollection(const Args &&... args) -> std::tuple< Args... >
constexpr auto describePortCollection(Args &&... args) -> dw::core::Tuple< Args... >
dwTraceNodeParams { bool stmControlTracing dwTraceNodeParams
Definition: dwTraceNode.hpp:50
Definition: Buffer.hpp:40