Add cooked data read tracing (#10166)
Added trace to conhost to instrument buffers that are cooked prior to being passed to the console. * [x] I've discussed this with core contributors already (internal) VALIDATION - Ensured trace is correctly logged in ETL (via TraceLog)
This commit is contained in:
parent
52560ff818
commit
31e58809cc
|
@ -1030,6 +1030,8 @@ void COOKED_READ_DATA::SavePendingInput(const size_t index, const bool multiline
|
||||||
WI_IsFlagSet(gci.Flags, CONSOLE_HISTORY_NODUP)));
|
WI_IsFlagSet(gci.Flags, CONSOLE_HISTORY_NODUP)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Tracing::s_TraceCookedRead(_backupLimit);
|
||||||
|
|
||||||
// check for alias
|
// check for alias
|
||||||
ProcessAliases(LineCount);
|
ProcessAliases(LineCount);
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,7 +20,8 @@ enum TraceKeywords
|
||||||
Input = 0x200,
|
Input = 0x200,
|
||||||
API = 0x400,
|
API = 0x400,
|
||||||
UIA = 0x800,
|
UIA = 0x800,
|
||||||
All = 0xFFF
|
CookedRead = 0x1000,
|
||||||
|
All = 0x1FFF
|
||||||
};
|
};
|
||||||
DEFINE_ENUM_FLAG_OPERATORS(TraceKeywords);
|
DEFINE_ENUM_FLAG_OPERATORS(TraceKeywords);
|
||||||
|
|
||||||
|
@ -404,6 +405,16 @@ void Tracing::s_TraceInputRecord(const INPUT_RECORD& inputRecord)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Tracing::s_TraceCookedRead(_In_z_ const wchar_t* pwszCookedBuffer)
|
||||||
|
{
|
||||||
|
TraceLoggingWrite(
|
||||||
|
g_hConhostV2EventTraceProvider,
|
||||||
|
"CookedRead",
|
||||||
|
TraceLoggingWideString(pwszCookedBuffer, "ReadBuffer"),
|
||||||
|
TraceLoggingKeyword(TIL_KEYWORD_TRACE),
|
||||||
|
TraceLoggingKeyword(TraceKeywords::CookedRead));
|
||||||
|
}
|
||||||
|
|
||||||
void __stdcall Tracing::TraceFailure(const wil::FailureInfo& failure) noexcept
|
void __stdcall Tracing::TraceFailure(const wil::FailureInfo& failure) noexcept
|
||||||
{
|
{
|
||||||
TraceLoggingWrite(
|
TraceLoggingWrite(
|
||||||
|
|
|
@ -62,6 +62,8 @@ public:
|
||||||
static void s_TraceWindowMessage(const MSG& msg);
|
static void s_TraceWindowMessage(const MSG& msg);
|
||||||
static void s_TraceInputRecord(const INPUT_RECORD& inputRecord);
|
static void s_TraceInputRecord(const INPUT_RECORD& inputRecord);
|
||||||
|
|
||||||
|
static void s_TraceCookedRead(_In_z_ const wchar_t* pwszCookedBuffer);
|
||||||
|
|
||||||
static void __stdcall TraceFailure(const wil::FailureInfo& failure) noexcept;
|
static void __stdcall TraceFailure(const wil::FailureInfo& failure) noexcept;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -44,7 +44,7 @@
|
||||||
// See also https://osgwiki.com/wiki/TraceLogging#Semantics
|
// See also https://osgwiki.com/wiki/TraceLogging#Semantics
|
||||||
//
|
//
|
||||||
// Note that Conhost had already defined some keywords
|
// Note that Conhost had already defined some keywords
|
||||||
// between bits 0..11 so be sure to not overlap those.
|
// between bits 0..12 so be sure to not overlap those.
|
||||||
// See `TraceKeywords`.
|
// See `TraceKeywords`.
|
||||||
// We will therefore try to reserve 32..42 for TIL
|
// We will therefore try to reserve 32..42 for TIL
|
||||||
// as common flags for the entire Terminal team projects.
|
// as common flags for the entire Terminal team projects.
|
||||||
|
|
Loading…
Reference in a new issue