Skip to content

Commit

Permalink
Delete FEATURE_TRACELOGGING (#91986)
Browse files Browse the repository at this point in the history
This is bitrotten telemetry collector from .NET Framework. It is unusable for .NET Core.
  • Loading branch information
jkotas committed Sep 14, 2023
1 parent e54e7ac commit 44037e8
Show file tree
Hide file tree
Showing 10 changed files with 9 additions and 595 deletions.
2 changes: 0 additions & 2 deletions src/coreclr/jit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ set( JIT_SOURCES
jitconfig.cpp
jiteh.cpp
jithashtable.cpp
jittelemetry.cpp
lclmorph.cpp
lclvars.cpp
likelyclass.cpp
Expand Down Expand Up @@ -335,7 +334,6 @@ set( JIT_HEADERS
jithashtable.h
jitpch.h
jitstd.h
jittelemetry.h
lir.h
loopcloning.h
loopcloningopts.h
Expand Down
30 changes: 2 additions & 28 deletions src/coreclr/jit/compiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#include "rangecheck.h"
#include "lower.h"
#include "stacklevelsetter.h"
#include "jittelemetry.h"
#include "patchpointinfo.h"
#include "jitstd/algorithm.h"

Expand Down Expand Up @@ -1854,19 +1853,6 @@ void Compiler::compInit(ArenaAllocator* pAlloc,
activePhaseChecks = PhaseChecks::CHECK_NONE;
activePhaseDumps = PhaseDumps::DUMP_ALL;

#ifdef FEATURE_TRACELOGGING
// Make sure JIT telemetry is initialized as soon as allocations can be made
// but no later than a point where noway_asserts can be thrown.
// 1. JIT telemetry could allocate some objects internally.
// 2. NowayAsserts are tracked through telemetry.
// Note: JIT telemetry could gather data when compiler is not fully initialized.
// So you have to initialize the compiler variables you use for telemetry.
assert((unsigned)PHASE_PRE_IMPORT == 0);
info.compILCodeSize = 0;
info.compMethodHnd = nullptr;
compJitTelemetry.Initialize(this);
#endif

fgInit();
lvaInit();
optInit();
Expand Down Expand Up @@ -2368,16 +2354,8 @@ void DummyProfilerELTStub(UINT_PTR ProfilerHandle)

#endif // PROFILING_SUPPORTED

bool Compiler::compShouldThrowOnNoway(
#ifdef FEATURE_TRACELOGGING
const char* filename, unsigned line
#endif
)
bool Compiler::compShouldThrowOnNoway()
{
#ifdef FEATURE_TRACELOGGING
compJitTelemetry.NotifyNowayAssert(filename, line);
#endif

// In min opts, we don't want the noway assert to go through the exception
// path. Instead we want it to just silently go through codegen for
// compat reasons.
Expand Down Expand Up @@ -5196,10 +5174,6 @@ void Compiler::compCompile(void** methodCodePtr, uint32_t* methodCodeSize, JitFl

RecordStateAtEndOfCompilation();

#ifdef FEATURE_TRACELOGGING
compJitTelemetry.NotifyEndOfCompilation();
#endif

unsigned methodsCompiled = (unsigned)InterlockedIncrement((LONG*)&Compiler::jitTotalMethodCompiled);

if (JitConfig.JitDisasmSummary() && !compIsForInlining())
Expand Down Expand Up @@ -8314,7 +8288,7 @@ double JitTimer::s_cyclesPerSec = CachedCyclesPerSecond();
#endif
#endif // FEATURE_JIT_METHOD_PERF

#if defined(FEATURE_JIT_METHOD_PERF) || DUMP_FLOWGRAPHS || defined(FEATURE_TRACELOGGING)
#if defined(FEATURE_JIT_METHOD_PERF) || DUMP_FLOWGRAPHS
const char* PhaseNames[] = {
#define CompPhaseNameMacro(enum_nm, string_nm, hasChildren, parent, measureIR) string_nm,
#include "compphases.h"
Expand Down
15 changes: 0 additions & 15 deletions src/coreclr/jit/compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#include "jitexpandarray.h"
#include "tinyarray.h"
#include "valuenum.h"
#include "jittelemetry.h"
#include "namedintrinsiclist.h"
#ifdef LATE_DISASM
#include "disasm.h"
Expand Down Expand Up @@ -10802,22 +10801,8 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
void RecordNowayAssert(const char* filename, unsigned line, const char* condStr);
#endif // MEASURE_NOWAY

#ifndef FEATURE_TRACELOGGING
// Should we actually fire the noway assert body and the exception handler?
bool compShouldThrowOnNoway();
#else // FEATURE_TRACELOGGING
// Should we actually fire the noway assert body and the exception handler?
bool compShouldThrowOnNoway(const char* filename, unsigned line);

// Telemetry instance to use per method compilation.
JitTelemetry compJitTelemetry;

// Get common parameters that have to be logged with most telemetry data.
void compGetTelemetryDefaults(const char** assemblyName,
const char** scopeName,
const char** methodName,
unsigned* methodHash);
#endif // !FEATURE_TRACELOGGING

#ifdef DEBUG
private:
Expand Down
7 changes: 0 additions & 7 deletions src/coreclr/jit/ee_il_dll.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,6 @@ extern "C" DLLEXPORT void jitStartup(ICorJitHost* jitHost)
jitstdout = procstdout();
}

#ifdef FEATURE_TRACELOGGING
JitTelemetry::NotifyDllProcessAttach();
#endif
Compiler::compStartup();

g_jitInitialized = true;
Expand Down Expand Up @@ -150,10 +147,6 @@ void jitShutdown(bool processIsTerminating)
}
}

#ifdef FEATURE_TRACELOGGING
JitTelemetry::NotifyDllProcessDetach();
#endif

g_jitInitialized = false;
}

Expand Down
27 changes: 3 additions & 24 deletions src/coreclr/jit/error.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,32 +108,15 @@ void DECLSPEC_NORETURN noWayAssertBody()
fatal(CORJIT_RECOVERABLEERROR);
}

inline static bool ShouldThrowOnNoway(
#ifdef FEATURE_TRACELOGGING
const char* filename, unsigned line
#endif
)
inline static bool ShouldThrowOnNoway()
{
return JitTls::GetCompiler() == nullptr ||
JitTls::GetCompiler()->compShouldThrowOnNoway(
#ifdef FEATURE_TRACELOGGING
filename, line
#endif
);
return JitTls::GetCompiler() == nullptr || JitTls::GetCompiler()->compShouldThrowOnNoway();
}

/*****************************************************************************/
void noWayAssertBodyConditional(
#ifdef FEATURE_TRACELOGGING
const char* filename, unsigned line
#endif
)
void noWayAssertBodyConditional()
{
#ifdef FEATURE_TRACELOGGING
if (ShouldThrowOnNoway(filename, line))
#else
if (ShouldThrowOnNoway())
#endif // FEATURE_TRACELOGGING
{
noWayAssertBody();
}
Expand Down Expand Up @@ -513,11 +496,7 @@ void noWayAssertAbortHelper(const char* cond, const char* file, unsigned line)

void noWayAssertBodyConditional(const char* cond, const char* file, unsigned line)
{
#ifdef FEATURE_TRACELOGGING
if (ShouldThrowOnNoway(file, line))
#else
if (ShouldThrowOnNoway())
#endif
{
noWayAssertBody(cond, file, line);
}
Expand Down
18 changes: 4 additions & 14 deletions src/coreclr/jit/error.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,7 @@ extern void DECLSPEC_NORETURN noWayAssertBody(const char* cond, const char* file
// Conditionally invoke the noway assert body. The conditional predicate is evaluated using a method on the tlsCompiler.
// If a noway_assert is hit, we ask the Compiler whether to raise an exception (i.e., conditionally raise exception.)
// To have backward compatibility between v4.5 and v4.0, in min-opts we take a shot at codegen rather than rethrow.
extern void ANALYZER_NORETURN noWayAssertBodyConditional(
#ifdef FEATURE_TRACELOGGING
const char* file, unsigned line
#endif
);
extern void ANALYZER_NORETURN noWayAssertBodyConditional();

extern void ANALYZER_NORETURN noWayAssertBodyConditional(const char* cond, const char* file, unsigned line);

Expand Down Expand Up @@ -135,25 +131,19 @@ extern void RecordNowayAssertGlobal(const char* filename, unsigned line, const c
// limitations (that could be removed in the future)
#define IMPL_LIMITATION(msg) implLimitation()

#ifdef FEATURE_TRACELOGGING
#define NOWAY_ASSERT_BODY_ARGUMENTS __FILE__, __LINE__
#else
#define NOWAY_ASSERT_BODY_ARGUMENTS
#endif

#define noway_assert(cond) \
do \
{ \
RECORD_NOWAY_ASSERT(#cond) \
if (!(cond)) \
{ \
noWayAssertBodyConditional(NOWAY_ASSERT_BODY_ARGUMENTS); \
noWayAssertBodyConditional(); \
} \
} while (0)
#define unreached() noWayAssertBody()

#define NOWAY_MSG(msg) noWayAssertBodyConditional(NOWAY_ASSERT_BODY_ARGUMENTS)
#define NOWAY_MSG_FILE_AND_LINE(msg, file, line) noWayAssertBodyConditional(NOWAY_ASSERT_BODY_ARGUMENTS)
#define NOWAY_MSG(msg) noWayAssertBodyConditional()
#define NOWAY_MSG_FILE_AND_LINE(msg, file, line) noWayAssertBodyConditional()

#endif // !DEBUG

Expand Down
2 changes: 0 additions & 2 deletions src/coreclr/jit/jitconfigvalues.h
Original file line number Diff line number Diff line change
Expand Up @@ -442,8 +442,6 @@ CONFIG_INTEGER(JitOptRepeatCount, W("JitOptRepeatCount"), 2) // Number of times
CONFIG_INTEGER(JitDoIfConversion, W("JitDoIfConversion"), 1) // Perform If conversion
#endif // defined(OPT_CONFIG)

CONFIG_INTEGER(JitTelemetry, W("JitTelemetry"), 1) // If non-zero, gather JIT telemetry data

// Max # of MapSelect's considered for a particular top-level invocation.
CONFIG_INTEGER(JitVNMapSelBudget, W("JitVNMapSelBudget"), DEFAULT_MAP_SELECT_BUDGET)

Expand Down
Loading

0 comments on commit 44037e8

Please sign in to comment.