515.43.04

This commit is contained in:
Andy Ritger
2022-05-09 13:18:59 -07:00
commit 1739a20efc
2519 changed files with 1060036 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
#include "g_gpu_acct_nvoc.h"

View File

@@ -0,0 +1,3 @@
#include "g_journal_nvoc.h"

View File

@@ -0,0 +1,53 @@
/*
* SPDX-FileCopyrightText: Copyright (c) 1993-2021 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-License-Identifier: MIT
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
#ifndef JOURNAL_STRUCTS_H
#define JOURNAL_STRUCTS_H 1
#include "nvcd.h"
#include "rmcd.h"
// Meta Data to Describe an error block
typedef struct RMCD_ERROR_BLOCK {
NvU8 * pBlock;
NvU32 blockSize;
struct RMCD_ERROR_BLOCK * pNext;
} RMCD_ERROR_BLOCK;
typedef struct RMERRORHEADER {
struct RMFIFOERRORELEMENT_V3 *pNextError;
RMCD_ERROR_BLOCK *pErrorBlock;
NvU32 GPUTag;
NvU32 ErrorNumber;
} RMERRORHEADER;
typedef struct {
RMERRORHEADER ErrorHeader;
RmPrbInfo_RECORD_V2 RmPrbErrorData;
} RMPRBERRORELEMENT_V2;
typedef struct RMFIFOERRORELEMENT_V3 {
RMERRORHEADER ErrorHeader;
} RMFIFOERRORELEMENT_V3;
#endif /* ifndef JOURNAL_STRUCTS_H */

View File

@@ -0,0 +1,3 @@
#include "g_nv_debug_dump_nvoc.h"

View File

@@ -0,0 +1,119 @@
/*
* SPDX-FileCopyrightText: Copyright (c) 2012-2020 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-License-Identifier: MIT
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
#ifndef _PROFILER_H_
#define _PROFILER_H_
/*!
* @file profiler.h
* @brief Simple API to measure elapsed times in RM for profiling and statistics
*
* The primary goals of this API are to:
* 1. Be lightweight and have little-to-no setup required (built into release drivers)
* 2. Defer as much analysis as possible to the user of the data (keep it simple)
* 3. Provide sub-millisecond resolution if possible (medium-high granularity)
*
* This is intended mainly for coarse measurements of time-critical software
* sequences, such as GC6. For example, the measurements could be used to catch
* major latency regressions in a particular timing module.
*
* For more sophisticated profiling (e.g. for prospective analysis), use of an
* external profiling tool (e.g. xperf with ETW) is recommended instead.
*/
#include "core/core.h"
/*!
* Record containing the statistics of a single time module to be profiled
* periodically.
*
* This tracks the min/max elapsed time over all the measurement
* cycles, as well as the total elapsed time and number of cycles.
* To calculate the average elapsed time per cycle, divide total_ns by count.
*
* 64-bit precision integers are used to hold nanosecond resolution
* over long periods of time (e.g. greater than 4 seconds).
*/
typedef struct
{
NvU64 count; //<! Number of cycles this time record has measured
NvU64 start_ns; //<! Starting time of current cycle in nanoseconds
NvU64 total_ns; //<! Total nanoseconds elapsed for this record
NvU64 min_ns; //<! Minimum nanoseconds elapsed in a single cycle
NvU64 max_ns; //<! Maximum nanoseconds elapsed in a single cycle
} RM_PROF_STATS;
/*!
* A profiling group is a chain of continuous profiling modules. The purpose of
* chaining the modules together is to reduce the number of timestamps taken
* by approximately half and to prevent any time from "escaping" between the
* end of one module and the start of another (e.g. due to preemption).
*/
typedef struct
{
RM_PROF_STATS *pTotal; //<! Stats for the total time spent in the group.
RM_PROF_STATS *pLast; //<! Stats for the previous module of the group.
} RM_PROF_GROUP;
/*!
* Start measuring time for the specified module stats (begin a new cycle).
*/
#define RM_PROF_START(pStats) rmProfStart(pStats)
/*!
* Stop measuring time for the specified module stats (end a cycle).
* Must be called after RM_PROF_START - these two APIs are not reentrant.
*/
#define RM_PROF_STOP(pStats) rmProfStop(pStats)
/*!
* Lower-level API to record a cycle time manually. The provided time can
* be derived from any timer source as long as it is converted to nanoseconds.
*/
#define RM_PROF_RECORD(pStats, time_ns) rmProfRecord(pStats, time_ns)
/*!
* Start measuring time for the specified profiling group (begin a new cycle).
* pTotal is the optional stats for the whole group.
* pFirst is the first module of the group.
*/
#define RM_PROF_GROUP_START(pGroup, pTotal, pFirst) rmProfGroupStart(pGroup, pTotal, pFirst)
/*!
* Continue profiling the next module of a profiling group.
*/
#define RM_PROF_GROUP_NEXT(pGroup, pNext) rmProfGroupNext(pGroup, pNext)
/*!
* Stop profiling a cycle of a profiling group (ends both the last and total modules).
*/
#define RM_PROF_GROUP_STOP(pGroup) rmProfGroupStop(pGroup)
// Underlying functions - use the wrapper macros instead.
void rmProfStart (RM_PROF_STATS *pStats);
void rmProfStop (RM_PROF_STATS *pStats);
void rmProfRecord(RM_PROF_STATS *pStats, NvU64 time_ns);
void rmProfGroupStart(RM_PROF_GROUP *pGroup, RM_PROF_STATS *pTotal, RM_PROF_STATS *pFirst);
void rmProfGroupNext (RM_PROF_GROUP *pGroup, RM_PROF_STATS *pNext);
void rmProfGroupStop (RM_PROF_GROUP *pGroup);
#endif /* _PROFILER_H_ */

View File

@@ -0,0 +1,3 @@
#include "g_traceable_nvoc.h"

View File

@@ -0,0 +1,188 @@
/*
* SPDX-FileCopyrightText: Copyright (c) 1993-2021 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-License-Identifier: MIT
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
/*****************************************************************************
*
* Description:
* RM Event Tracer
*
******************************************************************************/
#ifndef TRACER_H
#define TRACER_H
#define RMTRACE_EVENT_FLAG_ENABLED NVBIT(0) // whether the event is enabled
#define RMTRACE_EVENT_FLAG_FREQ NVBIT(1) // an event frequently happens. In ETW, freq events use an independent Provider 'NVRM_FREQ'
#define RMTRACE_EVENT_FLAG_FLUSHABLE NVBIT(2) // an event may cause a flush. 'Flush' is enabled by regkey 'RMEnableEventTracer'
//
// Function Progress Value
//
// RMTRACE_FUNC_PROG_ENTER and RMTRACE_FUNC_PROG_EXIT are used to indicate enter and leave state of a specific events, so that the time interval
// of this event can be computed.
//
// RMTRACE_FUNC_PROG_STEP can be combined with RMTRACE_FUNC_PROG_ENTER and RMTRACE_FUNC_PROG_EXIT, used in ETW_Event_Generic_Marker. Below is a
// sample how to use it.
//
// void AAA()
// {
// RMTRACE_MARKER_PROBE("AAA Function", pGpu->gpuId, data, RMTRACE_FUNC_PROG_ENTER);
// ...
// RMTRACE_MARKER_PROBE("About To Enter XXX", pGpu->gpuId, data, RMTRACE_FUNC_PROG_STEP);
// XXX();
// ...
// BBB();
// ...
// RMTRACE_MARKER_PROBE("AAA Function", pGpu->gpuId, data, RMTRACE_FUNC_PROG_EXIT);
// }
//
//
// void BBB()
// {
// RMTRACE_MARKER_PROBE("BBB Function", pGpu->gpuId, data, RMTRACE_FUNC_PROG_ENTER);
// ...
// CCC();
// ...
// RMTRACE_MARKER_PROBE("BBB Function", pGpu->gpuId, data, RMTRACE_FUNC_PROG_EXIT);
// }
//
// With a tool (like EtwTool), we can generate below message automatically
//
// AAA Function (Enter)
// (0.1234ms)
// About to Enter XXX
// (0.0012ms)
// BBB Function (Enter)
// BBB Function (Leave) - 0.23ms
// AAA Function (Leave) -- 0.4111ms
//
#define RMTRACE_FUNC_PROG_ENTER 0x0000
#define RMTRACE_FUNC_PROG_EXIT 0x00FF
#define RMTRACE_FUNC_PROG_STEP 0x007F
#define RMTRACE_UNKNOWN_GPUID 0xFFFFFFFF
#define RMTRACE_UNUSED_PARAM 0
#define RMTRACE_MAX_PRINT_BUFFER_SIZE 128
//
// Empty macros
//
#define RMTRACE_INIT_NEW()
#define RMTRACE_DESTROY_NEW()
#define RMTRACE_SET_PTIMER_LOG(enable)
#define RMTRACE_IS_PTIMER_LOG_ENABLED() \
NV_FALSE
#define RMTRACE_RMAPI(id, cmd)
#define RMTRACE_RMLOCK(id)
#define RMTRACE_DISP1(id, gpuId, param1)
#define RMTRACE_DISP2(id, gpuId, param1, param2)
#define RMTRACE_DISP3(id, gpuId, param1, param2, param3)
#define RMTRACE_DISP4(id, gpuId, param1, param2, param3, param4)
#define RMTRACE_DISP5(id, gpuId, param1, param2, param3, param4, param5)
#define RMTRACE_DISP6(id, gpuId, param1, param2, param3, param4, param5, param6)
#define RMTRACE_DISP_EDID(gpuId, publicId, connectedId, data, size)
#define RMTRACE_DISP_BRIGHTNESS_ENTRY(dispId, flags, blType, pwmInfoProvider, pwmInfoEntries, SBEnable, lmnProvider, lmnEntryCount, blPwmInfoSize, blPwmInfo)
#define RMTRACE_DISP_ERROR(id, gpuId, param1, param2, status)
#define RMTRACE_DISP_EXCEPTION(gpuId, param1, param2, param3, param4, param5)
#define RMTRACE_GPIO(id, _function, _state, _gpioPin, param)
#define RMTRACE_GPIO_LIST(id, count, list)
#define RMTRACE_I2C(id, gpuId, portId, address, indexSize, pIndex, dataSize, pData, status)
#define RMTRACE_I2C_SET_ACQUIRED(gpuId, portId, acquirer, status, curTime)
#define RMTRACE_I2C_ENUM_PORTS(gpuId, count, ports)
#define RMTRACE_GPU(id, gpuId, param1, param2, param3, param4, param5, param6, param7)
#define RMTRACE_RMJOURNAL(id, gpuId, type, group, key, count, firstTime, lastTime)
#define RMTRACE_POWER(id, gpuId, state, head, forcePerf, fastBootPowerState)
#define RMTRACE_PERF(id, gpuId, param1, param2, param3, param4, param5, param6, param7)
#define RMTRACE_THERM2(id, gpuId, param1, param2)
#define RMTRACE_THERM3(id, gpuId, param1, param2, param3)
#define RMTRACE_THERM6(id, gpuId, param1, param2, param3, param4, param5, param6)
#define RMTRACE_TIMEOUT(id, gpuId)
#define RMTRACE_VBIOS(id, gpuId, param1, param2, param3, param4, param5, param6, param7)
#define RMTRACE_VBIOS_ERROR(id, gpuId, param1, param2, param3, param4, param5, param6, param7)
#define RMTRACE_NVLOG(id, pData, dataSize)
#define RMTRACE_SBIOS(id, gpuId, param1, param2, param3, param4, param5, param6, param7)
#define RMTRACE_USBC0(id, gpuId)
#define RMTRACE_USBC1(id, gpuId, param1)
#define RMTRACE_USBC2(id, gpuId, param1, param2)
#define RMTRACE_USBC7(id, gpuId, param1, param2, param3, param4, param5, param6, param7)
#define RMTRACE_RMGENERAL(id, param1, param2, param3)
#define RMTRACE_NVTELEMETRY(id, gpuId, param1, param2, param3)
#define RMTRACE_NOCAT(id, gpuId, type, group, key, count, timeStamp)
#define RMTRACE_PRINT
#ifndef RMTRACE_FLAG_ENABLED
#define RMTRACE_FLAG_ENABLED (0)
#endif
//
// Empty macros
//
#define RMTRACE_INIT()
#define RMTRACE_DESTROY()
#define RMTRACE_ENABLE(eventEventMask)
#define RMTRACE_PROBE(module, event)
#define RMTRACE_PROBE1(module, event, dataType, data, dataSize)
#define RMTRACE_PROBE2(module, event, dataType1, data1, dataSize1, dataType2, data2, dataSize2)
#define RMTRACE_PROBE3(module, event, dataType1, data1, dataSize1, dataType2, data2, dataSize2, \
dataType3, data3, dataSize3)
#define RMTRACE_PROBE4(module, event, dataType1, data1, dataSize1, dataType2, data2, dataSize2, \
dataType3, data3, dataSize3, dataType4, data4, dataSize4)
#define RMTRACE_PROBE5(module, event, dataType1, data1, dataSize1, dataType2, data2, dataSize2, \
dataType3, data3, dataSize3, dataType4, data4, dataSize4, \
dataType5, data5, dataSize5)
#define RMTRACE_PROBE6(module, event, dataType1, data1, dataSize1, dataType2, data2, dataSize2, \
dataType3, data3, dataSize3, dataType4, data4, dataSize4, \
dataType5, data5, dataSize5, dataType6, data6, dataSize6)
#define RMTRACE_PROBE7(module, event, dataType1, data1, dataSize1, dataType2, data2, dataSize2, \
dataType3, data3, dataSize3, dataType4, data4, dataSize4, \
dataType5, data5, dataSize5, dataType6, data6, dataSize6, \
dataType7, data7, dataSize7)
#define RMTRACE_PROBE10(module, event, dataType1, data1, dataSize1, dataType2, data2, dataSize2, \
dataType3, data3, dataSize3, dataType4, data4, dataSize4, \
dataType5, data5, dataSize5, dataType6, data6, dataSize6, \
dataType7, data7, dataSize7, dataType8, data8, dataSize8, \
dataType9, data9, dataSize9, dataType10, data10, dataSize10)
#define RMTRACE_PROBE2_PRIMTYPE(module, event, type0, val0, type1, val1)
#define RMTRACE_PROBE3_PRIMTYPE(module, event, type0, val0, type1, val1, type2, val2)
#define RMTRACE_PROBE4_PRIMTYPE(module, event, type0, val0, type1, val1, type2, val2, type3, val3)
#define RMTRACE_PROBE5_PRIMTYPE(module, event, type0, val0, type1, val1, type2, val2, type3, val3, \
type4, val4)
#define RMTRACE_PROBE7_PRIMTYPE(module, event, type0, val0, type1, val1, type2, val2, type3, val3, \
type4, val4, type5, val5, type6, val6)
#define RMTRACE_PROBE10_PRIMTYPE(module, event, type0, val0, type1, val1, type2, val2, type3, val3, \
type4, val4, type5, val5, type6, val6, type7, val7, type8, val8, \
type9, val9)
#define RMTRACE_MARKER_PROBE(name, gpuId, payload, id)
#endif /* TRACER_H */