Skip to content

Commit

Permalink
Disable tiered JIT workaround by default (#3579)
Browse files Browse the repository at this point in the history
* Disable tiered-jit workaround by default

* Enable the tiered-jit workaround in CI

* Update to link to PR
  • Loading branch information
andrewlock authored Dec 20, 2022
1 parent 6957642 commit 4ec8df9
Show file tree
Hide file tree
Showing 10 changed files with 29 additions and 1 deletion.
3 changes: 3 additions & 0 deletions tracer/build/_build/docker/smoke.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ ENV DD_APPSEC_ENABLED=1
ENV DD_TRACE_DEBUG=1
ENV DD_PROFILING_LOG_DIR=/var/log/datadog/dotnet

# see https://github.com/DataDog/dd-trace-dotnet/pull/3579
ENV DD_INTERNAL_WORKAROUND_77973_ENABLED=1

ENV ASPNETCORE_URLS=http://localhost:5000

# Copy the app across
Expand Down
3 changes: 3 additions & 0 deletions tracer/build/_build/docker/smoke.dotnet-tool.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ ENV DD_TRACE_DEBUG=1
ENV ASPNETCORE_URLS=http://localhost:5000
ENV DD_PROFILING_LOG_DIR=/var/log/datadog/dotnet

# see https://github.com/DataDog/dd-trace-dotnet/pull/3579
ENV DD_INTERNAL_WORKAROUND_77973_ENABLED=1

# Copy the app across
COPY --from=builder /src/publish /app/.

Expand Down
3 changes: 3 additions & 0 deletions tracer/build/_build/docker/smoke.dotnet-tool.nuget.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ ENV DD_TRACE_DEBUG=1
ENV ASPNETCORE_URLS=http://localhost:5000
ENV DD_PROFILING_LOG_DIR=/var/log/datadog/dotnet

# see https://github.com/DataDog/dd-trace-dotnet/pull/3579
ENV DD_INTERNAL_WORKAROUND_77973_ENABLED=1

# Copy the app across
COPY --from=builder /src/publish /app/.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ ENV DD_TRACE_DEBUG=1
ENV ASPNETCORE_URLS=http://localhost:5000
ENV DD_PROFILING_LOG_DIR=/var/log/datadog/dotnet

# see https://github.com/DataDog/dd-trace-dotnet/pull/3579
ENV DD_INTERNAL_WORKAROUND_77973_ENABLED=1

# Copy the app across
COPY --from=builder /src/publish /app/.

Expand Down
3 changes: 3 additions & 0 deletions tracer/build/_build/docker/smoke.windows.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ ENV DD_PROFILING_ENABLED=1 \
DD_PROFILING_LOG_DIR="C:\logs" \
ASPNETCORE_URLS=http://localhost:5000

# see https://github.com/DataDog/dd-trace-dotnet/pull/3579
ENV DD_INTERNAL_WORKAROUND_77973_ENABLED=1

# Copy the app across
COPY --from=builder /src/publish /app/.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ ENV DD_PROFILING_ENABLED=1 \
DD_PROFILING_LOG_DIR="C:\logs" \
ASPNETCORE_URLS=http://localhost:5000
# see https://github.com/DataDog/dd-trace-dotnet/pull/3579
ENV DD_INTERNAL_WORKAROUND_77973_ENABLED=1
# Copy the app across
COPY --from=builder /src/publish /app/.
Expand Down
3 changes: 3 additions & 0 deletions tracer/build/_build/docker/smoke.windows.nuget.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ ENV CORECLR_ENABLE_PROFILING=1 \
DD_PROFILING_ENABLED=1 \
ASPNETCORE_URLS=http://localhost:5000

# see https://github.com/DataDog/dd-trace-dotnet/pull/3579
ENV DD_INTERNAL_WORKAROUND_77973_ENABLED=1

# Copy the app across
COPY --from=builder /src/publish /app/.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ ENV DD_PROFILING_ENABLED=1 \
DD_PROFILING_LOG_DIR="C:\logs" \
ASPNETCORE_URLS=http://localhost:5000

# see https://github.com/DataDog/dd-trace-dotnet/pull/3579
ENV DD_INTERNAL_WORKAROUND_77973_ENABLED=1

# Copy the app across
COPY --from=builder /src/publish /app/.

Expand Down
3 changes: 2 additions & 1 deletion tracer/src/Datadog.Tracer.Native/cor_profiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,9 @@ HRESULT STDMETHODCALLTYPE CorProfiler::Initialize(IUnknown* cor_profiler_info_un
Logger::Info("Runtime Information: ", runtimeType, " ", runtime_information_.major_version, ".", runtime_information_.minor_version, ".", runtime_information_.build_version);

// Check if we have to disable tiered compilation (due to https://github.com/dotnet/runtime/issues/77973)
// see https://github.com/DataDog/dd-trace-dotnet/pull/3579 for more details
bool disableTieredCompilation = false;
bool internal_workaround_77973_enabled = true;
bool internal_workaround_77973_enabled = false;
shared::TryParseBooleanEnvironmentValue(shared::GetEnvironmentValue(environment::internal_workaround_77973_enabled), internal_workaround_77973_enabled);
if (internal_workaround_77973_enabled)
{
Expand Down
3 changes: 3 additions & 0 deletions tracer/test/Datadog.Trace.TestHelpers/EnvironmentHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,9 @@ public void SetEnvironmentVariables(
string profilerEnabled = AutomaticInstrumentationEnabled ? "1" : "0";
environmentVariables["DD_DOTNET_TRACER_HOME"] = MonitoringHome;

// see https://github.com/DataDog/dd-trace-dotnet/pull/3579
environmentVariables["DD_INTERNAL_WORKAROUND_77973_ENABLED"] = "1";

// Everything should be using the native loader now
var nativeLoaderPath = GetNativeLoaderPath();

Expand Down

0 comments on commit 4ec8df9

Please sign in to comment.