Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.

Commit 560b130

Browse files
RassKshurivichGreenMatandudikeletiOmerRaviv
authored
Upstream sync 5f27ac2f26cd5d5069179a958ee60cddc1faecba..a5267be6402a22f7404acb9d88b7ad3aef059094 (#571)
* Upstream sync 5f27ac2f26cd5d5069179a958ee60cddc1faecba..a5267be6402a22f7404acb9d88b7ad3aef059094 * Configuration Poller Implementation * Probes Configuration Updater & Comparer Probes Configuration Updater & Comparer implementation * Implemented the method probe instrumentation * Implemented the method probe instrumentation * Snapshot creator and object serialization for probes Adding snapshot creator and WIP on snapshot uploader Co-authored-by: Omer Raviv <[email protected]> Co-authored-by: Alexander S. <[email protected]> * Simplified the DebuggerTokens according to the refactoring of the CallTargetTokens Simplified the DebuggerTokens according to the refactoring of the CallTargetTokens * Discovery Service discovery service * Probe configuration fixes Probe configuration fixes + unit tests * Implemented the instrument-all mode for the Debugger * Added the Instrument All capability where we the Debugger instrumentation is being applied to every jit-compiled method (except predefined known set). * Added an environment variable named `DD_INTERNAL_DEBUGGER_INSTRUMENT_ALL` to control the instrumentation all mode. * Dropped non-ByRef support usages. * Fixed the signature of `LogException` - it is now accepting `DebuggerState`. * Added the ability to grab additional information about instrumented method during execution * Fix Configuration Poller in RCM mode * Add method probes snapshots tests * Fixed instrumentation info lookup for generic methods and methods in generic types * Fixed `InstrumentedMethodInfo` lookup for generic methods & methods (either generic/non-generic) in generic types. * Fixed issues we had in `SmokeTests`. * Added new smoke tests that covers the generics fixes. * Snapshot uploading * Implement Snapshot Uploader * Read local variable names from pdb and use them in snapshots * Add support for resolving Line Probe locations by reading sequence points from PDB * Support static methods (and extracting static fields) in Snapshot Probes * Fix json scheme for capture instance object * support static method in probe snapshot * Fix Snapshot uploading * Add snapshot summary * Add snapshot summary Co-authored-by: Matan Green <[email protected]> Co-authored-by: Omer Raviv <[email protected]> Co-authored-by: Omer Raviv <[email protected]> * Implementation of Batch Uploading * Add tests to check if nothing happens when debugger disabled * implement live debugger tests * Implemented the Line Probe Instrumentation * Implemented the line probe instrumentation + allowing multiple line probes together with method probe to be set on the same method. * Keeping track of methods under instrumentation and updating them accordingly as new line probe / method probe requests arrive. * Activated reverts (aka undoing the instrumentation) for both Method Probes and Line Probes. * Passing ProbeId in Method Probes and Line Probes. * Got rid of assembly name in method probe requests. * Fixed issues in the structuring of the snapshots to adhere the correct format. * Extended the testing infrastructure to support multi*phase (`ProbeAttributeBase.Phase`) and customized (`ProbeAttributeBase.Unlisted`) tests to cover instrumentation of line probes and method probes with reverts. * Added several tests that utilize the new phasing mechanism that covers line probe together with method probe instrumentations. * Rebase Fixes * Allowing simple type names in method probes Allow simple type names in method probe requests. E.g `FooClass` instead of `The.Full.Name.Of.FooClass`. * Fix method probe snapshot without arguments * Remove Thread Sleep from integration tests * remove thread sleeps * Added support for overloads instrumentation in Method Probe * Added support for instrumenting overloads by providing a method probe without a signature. * Restore Live Debugger unit tests * restore live debugger tests * Reporting Probes Statuses Implemented the Probes Statuses. The following Probe Statuses are now emitted correctly: `Received`, `Active`, `Error`. - `Received`: The Agent received the probe but has not requested ReJIT yet (because the module is not loaded). - `Active`: _(*) At least_ `RequestReJIT` has been requested. - `Error`: Tried to apply the instrumentation on a method, but the instrumentation has failed for any reason (not supported types, failure to load metadata, etc...). * Adapt to change made in RCM request schema ('tracer_client' -> 'client_tracer') * Finalize Live Debugger codebase for public repo and address all .NET Team feedback * [Profiler] Fix Arm64 installer smoke tests (#3002) * Fix Amr64 installer smoke tests Profiler was not loaded because Arm64 is not currently supported. But the CodeHotspot feature was activated because it relies only on the env var DD_PROFILING_ENABLED * Check OS in addition to the architecture * Do not add x-datadog-tags header when vlaue is max header length is set to 0 (#3001) * [Test Package Versions Bump] Updating package versions (#2972) * [Test Package Versions Bump] * Exclude GraphQL 5.0 and 5.1.0 from testing There's no compatible combination of packages that works with our sample because GraphQL.Server.All requires minimum of 5.1.1. * Exclude 3.29.0+ from cosmosdb tests on <netcoreapp3.1 Because .NET Standard is a lie - https://andrewlock.net/stop-lying-about-netstandard-2-support/ * Update package versions Co-authored-by: dependabot[bot] <dependabot[bot]@users.noreply.github.com> Co-authored-by: Andrew Lock <[email protected]> * Update vendored version of Newtonsoft.Json (#2980) * Add support for specifying files that should be dropped entirely from the vendored code We need this with Newtonsoft.Json because they define some attributes which we already declare internally * Allow specifying multiple transforms for transforming a content file * Update vendor definition for Newtonsoft.Json Added `#nullable enable` to source as now built with Nullable reference types. Also ignored all warnings related to incorrect annotations - these are primarily coming from the annotated base class libraries in .NET Core I think * Add horrible hacks - JsonSerializerInternalReader explicitly enables and disables some nullability warnings, which ends up conflicting with the global ignores we add. - Some targets were removed in the update, which means we now potentially hit other branches it seems. Working around it by patching the #if - TryGetValue is defined in netcoreapp2.1+. As newtonsoft doesn't target that, they don't have this conflict that we have to work around. Looks like this was manually worked around before, but I'm not sure the previous approach was actually correct. * Update vendored source * Update CoverageCollector to support new nullability in Newtonsoft.Json * Add new HAVE_REGEX_TIMEOUTS constant to constants defined in Datadog.Trace * Remove spurious $(AdditionalConstants) * [Profiler] Minor cleanup (#2977) * Ignore process_id in snapshots on Linux (#3003) When running in Docker, the pid of the main process is always 1.0, however, when we use `dd-trace` to instrument an app, the pid is sometimes _not_ 1.0. I'm not entirely sure why it's _sometimes_ 1.0, and sometimes not, but I would _guess_ that it's some sort of race. Either way, I think it's safe to ignore it in the snapshots. * Support Windows long paths * Fix tests * fix snk name * update configuration keys, values and doc Co-authored-by: Alexander S <[email protected]> Co-authored-by: Matan Green <[email protected]> Co-authored-by: Dudi Keleti <[email protected]> Co-authored-by: Omer Raviv <[email protected]> Co-authored-by: Omer Raviv <[email protected]> Co-authored-by: Matan Green <[email protected]> Co-authored-by: Alexander S <[email protected]> Co-authored-by: Gregory LEOCADIE <[email protected]> Co-authored-by: Pierre Bonet <[email protected]> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: dependabot[bot] <dependabot[bot]@users.noreply.github.com> Co-authored-by: Andrew Lock <[email protected]> Co-authored-by: Kevin Gosse <[email protected]> Co-authored-by: Piotr Kiełkowicz <[email protected]>
1 parent bd166e5 commit 560b130

File tree

580 files changed

+26892
-3131
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

580 files changed

+26892
-3131
lines changed

.github/workflows/ci.yml

+18
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@ jobs:
6666
runs-on: ${{ matrix.machine }}
6767
timeout-minutes: 30
6868
steps:
69+
- name: Support Windows long paths
70+
if: ${{ runner.os == 'Windows' }}
71+
run: git config --system core.longpaths true
6972
- uses: actions/[email protected]
7073
- uses: actions/[email protected]
7174
with:
@@ -164,6 +167,9 @@ jobs:
164167
runs-on: ${{ matrix.machine }}
165168
timeout-minutes: 30
166169
steps:
170+
- name: Support Windows long paths
171+
if: ${{ runner.os == 'Windows' }}
172+
run: git config --system core.longpaths true
167173
- uses: actions/[email protected]
168174
- uses: actions/[email protected]
169175
with:
@@ -232,6 +238,9 @@ jobs:
232238
runs-on: ${{ matrix.machine }}
233239
timeout-minutes: 30
234240
steps:
241+
- name: Support Windows long paths
242+
if: ${{ runner.os == 'Windows' }}
243+
run: git config --system core.longpaths true
235244
- uses: actions/[email protected]
236245
- uses: actions/[email protected]
237246
with:
@@ -303,6 +312,9 @@ jobs:
303312
runs-on: ${{ matrix.machine }}
304313
timeout-minutes: 60
305314
steps:
315+
- name: Support Windows long paths
316+
if: ${{ runner.os == 'Windows' }}
317+
run: git config --system core.longpaths true
306318
- uses: actions/[email protected]
307319
- uses: actions/[email protected]
308320
with:
@@ -420,6 +432,9 @@ jobs:
420432
framework: [ net461, netcoreapp3.1 ]
421433
timeout-minutes: 60
422434
steps:
435+
- name: Support Windows long paths
436+
if: ${{ runner.os == 'Windows' }}
437+
run: git config --system core.longpaths true
423438
- uses: actions/[email protected]
424439
- uses: actions/[email protected]
425440
with:
@@ -466,6 +481,9 @@ jobs:
466481
framework: [ net461, netcoreapp3.1 ]
467482
timeout-minutes: 60
468483
steps:
484+
- name: Support Windows long paths
485+
if: ${{ runner.os == 'Windows' }}
486+
run: git config --system core.longpaths true
469487
- uses: actions/[email protected]
470488
- uses: actions/[email protected]
471489
with:

Datadog.Trace.Debugger.slnf

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"solution": {
3+
"path": "Datadog.Trace.sln",
4+
"projects": [
5+
"tracer\\src\\Datadog.AutoInstrumentation.NativeLoader\\Datadog.AutoInstrumentation.NativeLoader.vcxproj",
6+
"tracer\\src\\Datadog.Trace.ClrProfiler.Native\\Datadog.Trace.ClrProfiler.Native.DLL.vcxproj",
7+
"tracer\\src\\Datadog.Trace.ClrProfiler.Native\\Datadog.Trace.ClrProfiler.Native.vcxproj",
8+
"tracer\\src\\Datadog.Trace.SourceGenerators\\Datadog.Trace.SourceGenerators.csproj",
9+
"tracer\\src\\Datadog.Trace.Tools.Analyzers\\Datadog.Trace.Tools.Analyzers.csproj",
10+
"tracer\\src\\Datadog.Trace\\Datadog.Trace.csproj",
11+
"tracer\\test\\Datadog.Trace.ClrProfiler.IntegrationTests\\Datadog.Trace.ClrProfiler.IntegrationTests.csproj",
12+
"tracer\\test\\Datadog.Trace.TestHelpers\\Datadog.Trace.TestHelpers.csproj",
13+
"tracer\\test\\Datadog.Trace.Tests\\Datadog.Trace.Tests.csproj",
14+
"tracer\\test\\test-applications\\debugger\\Samples.Probes\\Samples.Probes.csproj",
15+
"tracer\\build\\_build\\_build.csproj",
16+
"tracer\\src\\Datadog.Trace.Tools.Analyzers\\Datadog.Trace.Tools.Analyzers.csproj"
17+
]
18+
}
19+
}

Datadog.Trace.sln

+36-18
Original file line numberDiff line numberDiff line change
@@ -468,9 +468,23 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Datadog.InstrumentedAssembl
468468
EndProject
469469
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Datadog.InstrumentedAssemblyVerification.Standalone", "tracer\src\Datadog.InstrumentedAssemblyVerification.Standalone\Datadog.InstrumentedAssemblyVerification.Standalone.csproj", "{61FD6A7E-38EB-4B90-A890-DE3205C041B1}"
470470
EndProject
471+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "debugger", "debugger", "{16427BFB-B4C6-46A9-A290-8EA51FF73FEA}"
472+
EndProject
473+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Samples.Probes", "tracer\test\test-applications\debugger\Samples.Probes\Samples.Probes.csproj", "{2BED2D88-0B51-468B-A559-DA7B4BACA00B}"
474+
EndProject
471475
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Samples.AspNetMvc5CustomException", "tracer\test\test-applications\aspnet\Samples.AspNetMvc5CustomException\Samples.AspNetMvc5CustomException.csproj", "{F71B1B2D-C3E0-49B6-AC29-B96F45E12D5E}"
472476
EndProject
473477
Global
478+
GlobalSection(SharedMSBuildProjectFiles) = preSolution
479+
tracer\test\test-applications\Samples.Shared\Samples.Shared.projitems*{3c6dd42e-9214-4747-92ba-78de29aace59}*SharedItemsImports = 4
480+
tracer\test\test-applications\Samples.Shared\Samples.Shared.projitems*{6d86109f-b7c9-477d-86d7-45735a3a0818}*SharedItemsImports = 4
481+
tracer\test\test-applications\Samples.Shared\Samples.Shared.projitems*{7b0822f6-80de-4b49-8125-93975678d0d5}*SharedItemsImports = 4
482+
tracer\test\test-applications\Samples.Shared\Samples.Shared.projitems*{99a62ccf-8e7f-4d57-8383-d38c371c8087}*SharedItemsImports = 4
483+
tracer\test\test-applications\Samples.Shared\Samples.Shared.projitems*{b6a98887-4a47-4c19-9c6f-d833e24f4b1c}*SharedItemsImports = 4
484+
tracer\test\test-applications\Samples.Shared\Samples.Shared.projitems*{bbb60b0f-bf01-4499-936a-4a299a9acfd4}*SharedItemsImports = 4
485+
tracer\test\test-applications\Samples.Shared\Samples.Shared.projitems*{f71b1b2d-c3e0-49b6-ac29-b96f45e12d5e}*SharedItemsImports = 4
486+
tracer\test\test-applications\Samples.Shared\Samples.Shared.projitems*{fab2b108-e5be-4647-869b-1dc5d362252e}*SharedItemsImports = 4
487+
EndGlobalSection
474488
GlobalSection(SolutionConfigurationPlatforms) = preSolution
475489
Debug|Any CPU = Debug|Any CPU
476490
Debug|x64 = Debug|x64
@@ -2304,18 +2318,30 @@ Global
23042318
{61FD6A7E-38EB-4B90-A890-DE3205C041B1}.Release|x64.Build.0 = Release|Any CPU
23052319
{61FD6A7E-38EB-4B90-A890-DE3205C041B1}.Release|x86.ActiveCfg = Release|Any CPU
23062320
{61FD6A7E-38EB-4B90-A890-DE3205C041B1}.Release|x86.Build.0 = Release|Any CPU
2321+
{2BED2D88-0B51-468B-A559-DA7B4BACA00B}.Debug|Any CPU.ActiveCfg = Debug|x64
2322+
{2BED2D88-0B51-468B-A559-DA7B4BACA00B}.Debug|Any CPU.Build.0 = Debug|x64
2323+
{2BED2D88-0B51-468B-A559-DA7B4BACA00B}.Debug|x64.ActiveCfg = Debug|x64
2324+
{2BED2D88-0B51-468B-A559-DA7B4BACA00B}.Debug|x64.Build.0 = Debug|x64
2325+
{2BED2D88-0B51-468B-A559-DA7B4BACA00B}.Debug|x86.ActiveCfg = Debug|x86
2326+
{2BED2D88-0B51-468B-A559-DA7B4BACA00B}.Debug|x86.Build.0 = Debug|x86
2327+
{2BED2D88-0B51-468B-A559-DA7B4BACA00B}.Release|Any CPU.ActiveCfg = Release|x64
2328+
{2BED2D88-0B51-468B-A559-DA7B4BACA00B}.Release|Any CPU.Build.0 = Release|x64
2329+
{2BED2D88-0B51-468B-A559-DA7B4BACA00B}.Release|x64.ActiveCfg = Release|x64
2330+
{2BED2D88-0B51-468B-A559-DA7B4BACA00B}.Release|x64.Build.0 = Release|x64
2331+
{2BED2D88-0B51-468B-A559-DA7B4BACA00B}.Release|x86.ActiveCfg = Release|x86
2332+
{2BED2D88-0B51-468B-A559-DA7B4BACA00B}.Release|x86.Build.0 = Release|x86
23072333
{F71B1B2D-C3E0-49B6-AC29-B96F45E12D5E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
23082334
{F71B1B2D-C3E0-49B6-AC29-B96F45E12D5E}.Debug|Any CPU.Build.0 = Debug|Any CPU
2309-
{F71B1B2D-C3E0-49B6-AC29-B96F45E12D5E}.Debug|x64.ActiveCfg = Debug|Any CPU
2310-
{F71B1B2D-C3E0-49B6-AC29-B96F45E12D5E}.Debug|x64.Build.0 = Debug|Any CPU
2311-
{F71B1B2D-C3E0-49B6-AC29-B96F45E12D5E}.Debug|x86.ActiveCfg = Debug|Any CPU
2312-
{F71B1B2D-C3E0-49B6-AC29-B96F45E12D5E}.Debug|x86.Build.0 = Debug|Any CPU
2335+
{F71B1B2D-C3E0-49B6-AC29-B96F45E12D5E}.Debug|x64.ActiveCfg = Debug|x64
2336+
{F71B1B2D-C3E0-49B6-AC29-B96F45E12D5E}.Debug|x64.Build.0 = Debug|x64
2337+
{F71B1B2D-C3E0-49B6-AC29-B96F45E12D5E}.Debug|x86.ActiveCfg = Debug|x86
2338+
{F71B1B2D-C3E0-49B6-AC29-B96F45E12D5E}.Debug|x86.Build.0 = Debug|x86
23132339
{F71B1B2D-C3E0-49B6-AC29-B96F45E12D5E}.Release|Any CPU.ActiveCfg = Release|Any CPU
23142340
{F71B1B2D-C3E0-49B6-AC29-B96F45E12D5E}.Release|Any CPU.Build.0 = Release|Any CPU
2315-
{F71B1B2D-C3E0-49B6-AC29-B96F45E12D5E}.Release|x64.ActiveCfg = Release|Any CPU
2316-
{F71B1B2D-C3E0-49B6-AC29-B96F45E12D5E}.Release|x64.Build.0 = Release|Any CPU
2317-
{F71B1B2D-C3E0-49B6-AC29-B96F45E12D5E}.Release|x86.ActiveCfg = Release|Any CPU
2318-
{F71B1B2D-C3E0-49B6-AC29-B96F45E12D5E}.Release|x86.Build.0 = Release|Any CPU
2341+
{F71B1B2D-C3E0-49B6-AC29-B96F45E12D5E}.Release|x64.ActiveCfg = Release|x64
2342+
{F71B1B2D-C3E0-49B6-AC29-B96F45E12D5E}.Release|x64.Build.0 = Release|x64
2343+
{F71B1B2D-C3E0-49B6-AC29-B96F45E12D5E}.Release|x86.ActiveCfg = Release|x86
2344+
{F71B1B2D-C3E0-49B6-AC29-B96F45E12D5E}.Release|x86.Build.0 = Release|x86
23192345
EndGlobalSection
23202346
GlobalSection(SolutionProperties) = preSolution
23212347
HideSolutionNode = FALSE
@@ -2488,19 +2514,11 @@ Global
24882514
{CD816C0C-D116-49A1-93A7-8095594224EB} = {9E5F0022-0A50-40BF-AC6A-C3078585ECAB}
24892515
{FCE813DE-7BF2-4F63-8303-E92F90780C81} = {9E5F0022-0A50-40BF-AC6A-C3078585ECAB}
24902516
{61FD6A7E-38EB-4B90-A890-DE3205C041B1} = {9E5F0022-0A50-40BF-AC6A-C3078585ECAB}
2517+
{16427BFB-B4C6-46A9-A290-8EA51FF73FEA} = {9518425A-36A5-4B8F-B0B8-6137DB88441D}
2518+
{2BED2D88-0B51-468B-A559-DA7B4BACA00B} = {16427BFB-B4C6-46A9-A290-8EA51FF73FEA}
24912519
{F71B1B2D-C3E0-49B6-AC29-B96F45E12D5E} = {AFA0AB23-64F0-4AC1-9050-6CE8FE06F580}
24922520
EndGlobalSection
24932521
GlobalSection(ExtensibilityGlobals) = postSolution
24942522
SolutionGuid = {160A1D00-1F5B-40F8-A155-621B4459D78F}
24952523
EndGlobalSection
2496-
GlobalSection(SharedMSBuildProjectFiles) = preSolution
2497-
tracer\test\test-applications\Samples.Shared\Samples.Shared.projitems*{3c6dd42e-9214-4747-92ba-78de29aace59}*SharedItemsImports = 4
2498-
tracer\test\test-applications\Samples.Shared\Samples.Shared.projitems*{6d86109f-b7c9-477d-86d7-45735a3a0818}*SharedItemsImports = 4
2499-
tracer\test\test-applications\Samples.Shared\Samples.Shared.projitems*{7b0822f6-80de-4b49-8125-93975678d0d5}*SharedItemsImports = 4
2500-
tracer\test\test-applications\Samples.Shared\Samples.Shared.projitems*{99a62ccf-8e7f-4d57-8383-d38c371c8087}*SharedItemsImports = 4
2501-
tracer\test\test-applications\Samples.Shared\Samples.Shared.projitems*{b6a98887-4a47-4c19-9c6f-d833e24f4b1c}*SharedItemsImports = 4
2502-
tracer\test\test-applications\Samples.Shared\Samples.Shared.projitems*{bbb60b0f-bf01-4499-936a-4a299a9acfd4}*SharedItemsImports = 4
2503-
tracer\test\test-applications\Samples.Shared\Samples.Shared.projitems*{f71b1b2d-c3e0-49b6-ac29-b96f45e12d5e}*SharedItemsImports = 4
2504-
tracer\test\test-applications\Samples.Shared\Samples.Shared.projitems*{fab2b108-e5be-4647-869b-1dc5d362252e}*SharedItemsImports = 4
2505-
EndGlobalSection
25062524
EndGlobal

docker-compose.yml

+1
Original file line numberDiff line numberDiff line change
@@ -712,6 +712,7 @@ services:
712712
- "8126:8126"
713713
environment:
714714
- SNAPSHOT_CI=1
715+
- SNAPSHOT_IGNORED_ATTRS=span_id,trace_id,parent_id,duration,start,metrics.system.pid,meta.runtime-id,metrics.process_id
715716

716717
smoke-tests:
717718
build:

docs/internal/internal-config.md

+10
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,16 @@ These settings should be never used by the users.
7272
| `SIGNALFX_LOG_LEVEL` | Sets the log level for serverless. | |
7373
| `_SIGNALFX_EXTENSION_PATH` | Sets the lambda extension path. | |
7474
| `SIGNALFX_TRACE_X_DATADOG_TAGS_MAX_LENGTH` | Configuration key for the maximum length of an outgoing propagation header's value ("x-datadog-tags") | `512` |
75+
| `SIGNALFX_DEBUGGER_POLL_INTERVAL` | Sets the debugger poll interval (in seconds). | `1` |
76+
| `SIGNALFX_DEBUGGER_SNAPSHOT_URL` | Sets the URL used to query our backend directly for the list of active probes. This can only be used if SIGNALFX_API_KEY is also available. | |
77+
| `SIGNALFX_DEBUGGER_PROBE_FILE` | Sets the probe configuration file full path. Loads the probe configuration from a local file on disk. Useful for local development and testing. | |
78+
| `SIGNALFX_DEBUGGER_ENABLED` | Enabling or disabling the Live Debugger | `false` |
79+
| `SIGNALFX_DEBUGGER_MAX_DEPTH_TO_SERIALIZE` | Sets the max object depth to serialize for probe snapshots. | `1` |
80+
| `SIGNALFX_DEBUGGER_MAX_TIME_TO_SERIALIZE` | Sets the maximum duration (in milliseconds) to run serialization for probe snapshots. | `150` |
81+
| `SIGNALFX_DEBUGGER_UPLOAD_BATCH_SIZE` | Sets the maximum upload batch size. | `100` |
82+
| `SIGNALFX_DEBUGGER_DIAGNOSTICS_INTERVAL` | Sets the interval (in seconds) between sending probe statuses. | `3600` |
83+
| `SIGNALFX_DEBUGGER_UPLOAD_FLUSH_INTERVAL` | Sets the interval (in milliseconds) between flushing statuses. | `0` |
84+
| `SIGNALFX_INTERNAL_DEBUGGER_INSTRUMENT_ALL` | Determine whether to enter "instrument all" mode where the Debugger instrumentation is applied to every jit compiled method. Only useful for testing purposes. | `false` |
7585

7686
## Unpublished settings
7787

profiler/src/ProfilerEngine/Datadog.Profiler.Native.Linux/LinuxStackFramesCollector.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ using namespace std::chrono_literals;
3131
std::mutex LinuxStackFramesCollector::s_signalHandlerInitLock;
3232
std::mutex LinuxStackFramesCollector::s_stackWalkInProgressMutex;
3333
bool LinuxStackFramesCollector::s_isSignalHandlerSetup = false;
34-
int LinuxStackFramesCollector::s_signalToSend = -1;
34+
int32_t LinuxStackFramesCollector::s_signalToSend = -1;
3535
LinuxStackFramesCollector* LinuxStackFramesCollector::s_pInstanceCurrentlyStackWalking = nullptr;
3636

3737
LinuxStackFramesCollector::LinuxStackFramesCollector(ICorProfilerInfo4* const _pCorProfilerInfo) :
@@ -192,7 +192,7 @@ void LinuxStackFramesCollector::InitializeSignalHandler()
192192
s_isSignalHandlerSetup = SetupSignalHandler();
193193
}
194194

195-
bool LinuxStackFramesCollector::TrySetHandlerForSignal(int signal, struct sigaction& action)
195+
bool LinuxStackFramesCollector::TrySetHandlerForSignal(int32_t signal, struct sigaction& action)
196196
{
197197
struct sigaction oldAction;
198198
if (sigaction(signal, nullptr, &oldAction) < 0)
@@ -209,7 +209,7 @@ bool LinuxStackFramesCollector::TrySetHandlerForSignal(int signal, struct sigact
209209
if (oldAction.sa_handler == SIG_DFL || oldAction.sa_handler == SIG_IGN)
210210
{
211211
sigaddset(&action.sa_mask, signal);
212-
int result = sigaction(signal, &action, &oldAction);
212+
int32_t result = sigaction(signal, &action, &oldAction);
213213
if (result == 0)
214214
{
215215
return true;
@@ -258,7 +258,7 @@ bool LinuxStackFramesCollector::SetupSignalHandler()
258258
return false;
259259
}
260260

261-
char const* LinuxStackFramesCollector::ErrorCodeToString(int errorCode)
261+
char const* LinuxStackFramesCollector::ErrorCodeToString(int32_t errorCode)
262262
{
263263
switch (errorCode)
264264
{
@@ -349,7 +349,7 @@ std::int32_t LinuxStackFramesCollector::CollectCallStackCurrentThread()
349349
}
350350
}
351351

352-
void LinuxStackFramesCollector::CollectStackSampleSignalHandler(int signal)
352+
void LinuxStackFramesCollector::CollectStackSampleSignalHandler(int32_t signal)
353353
{
354354
std::unique_lock<std::mutex> stackWalkInProgressLock(s_stackWalkInProgressMutex);
355355
LinuxStackFramesCollector* pCollectorInstanceCurrentlyStackWalking = s_pInstanceCurrentlyStackWalking;

profiler/src/ProfilerEngine/Datadog.Profiler.Native.Linux/LinuxStackFramesCollector.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,14 @@ class LinuxStackFramesCollector : public StackFramesCollectorBase
6868
ICorProfilerInfo4* const _pCorProfilerInfo;
6969

7070
private:
71-
static bool TrySetHandlerForSignal(int signal, struct sigaction& action);
72-
static void CollectStackSampleSignalHandler(int signal);
71+
static bool TrySetHandlerForSignal(int32_t signal, struct sigaction& action);
72+
static void CollectStackSampleSignalHandler(int32_t signal);
7373

74-
static char const* ErrorCodeToString(int errorCode);
74+
static char const* ErrorCodeToString(int32_t errorCode);
7575
static std::mutex s_stackWalkInProgressMutex;
7676
static std::mutex s_signalHandlerInitLock;
7777
static bool s_isSignalHandlerSetup;
78-
static int s_signalToSend;
78+
static int32_t s_signalToSend;
7979

8080
static LinuxStackFramesCollector* s_pInstanceCurrentlyStackWalking;
8181

profiler/src/ProfilerEngine/Datadog.Profiler.Native.Linux/OsSpecificApi.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ bool GetCpuInfo(pid_t tid, bool& isRunning, uint64_t& cpuTime)
6565
}
6666

6767
char state = ' ';
68-
int userTime = 0;
69-
int kernelTime = 0;
68+
int32_t userTime = 0;
69+
int32_t kernelTime = 0;
7070
bool success = OpSysTools::ParseThreadInfo(sline, state, userTime, kernelTime);
7171
if (!success)
7272
{

profiler/src/ProfilerEngine/Datadog.Profiler.Native.Windows/OsSpecificApi.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ bool IsRunning(ManagedThreadInfo* pThreadInfo, uint64_t& cpuTime)
138138
SYSTEM_THREAD_INFORMATION sti = {0};
139139
auto size = sizeof(SYSTEM_THREAD_INFORMATION);
140140
ULONG buflen = 0;
141-
NTSTATUS lResult = NtQueryInformationThread(pThreadInfo->GetOsThreadHandle(), SYSTEMTHREADINFORMATION, &sti, size, &buflen);
141+
NTSTATUS lResult = NtQueryInformationThread(pThreadInfo->GetOsThreadHandle(), SYSTEMTHREADINFORMATION, &sti, static_cast<ULONG>(size), &buflen);
142142
if (lResult != 0)
143143
{
144144
// This always happens in 32 bit so uses another API to at least get the CPU consumption

profiler/src/ProfilerEngine/Datadog.Profiler.Native/AdaptiveSampler.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -162,11 +162,11 @@ void AdaptiveSampler::RollWindow()
162162

163163
if (_totalCountRunningAverage == 0 || _emaAlpha <= 0.0)
164164
{
165-
_totalCountRunningAverage = totalCount;
165+
_totalCountRunningAverage = static_cast<double>(totalCount);
166166
}
167167
else
168168
{
169-
_totalCountRunningAverage = _totalCountRunningAverage + _emaAlpha * (totalCount - _totalCountRunningAverage);
169+
_totalCountRunningAverage = _totalCountRunningAverage + _emaAlpha * (static_cast<double>(totalCount) - _totalCountRunningAverage);
170170
}
171171

172172
if (_totalCountRunningAverage <= 0)

profiler/src/ProfilerEngine/Datadog.Profiler.Native/Configuration.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ std::string const Configuration::DefaultProdSite = "datadoghq.com";
2222
std::string const Configuration::DefaultVersion = "Unspecified-Version";
2323
std::string const Configuration::DefaultEnvironment = "Unspecified-Environment";
2424
std::string const Configuration::DefaultAgentHost = "localhost";
25-
int const Configuration::DefaultAgentPort = 8126;
25+
int32_t const Configuration::DefaultAgentPort = 8126;
2626
std::string const Configuration::DefaultEmptyString = "";
2727
std::chrono::seconds const Configuration::DefaultDevUploadInterval = 20s;
2828
std::chrono::seconds const Configuration::DefaultProdUploadInterval = 60s;
@@ -105,7 +105,7 @@ bool Configuration::IsExceptionProfilingEnabled() const
105105
return _isExceptionProfilingEnabled;
106106
}
107107

108-
int Configuration::ExceptionSampleLimit() const
108+
int32_t Configuration::ExceptionSampleLimit() const
109109
{
110110
return _exceptionSampleLimit;
111111
}
@@ -150,7 +150,7 @@ std::string const& Configuration::GetAgentHost() const
150150
return _agentHost;
151151
}
152152

153-
int Configuration::GetAgentPort() const
153+
int32_t Configuration::GetAgentPort() const
154154
{
155155
return _agentPort;
156156
}
@@ -241,7 +241,7 @@ std::chrono::seconds Configuration::GetDefaultUploadInterval()
241241
// - replace shared::TryParse by this implementation
242242
// - add tests
243243

244-
bool TryParse(shared::WSTRING const& s, int& result)
244+
bool TryParse(shared::WSTRING const& s, int32_t& result)
245245
{
246246
auto str = shared::ToString(s);
247247
if (str == "")
@@ -266,7 +266,7 @@ bool TryParse(shared::WSTRING const& s, int& result)
266266
std::chrono::seconds Configuration::ExtractUploadInterval()
267267
{
268268
auto r = shared::GetEnvironmentValue(EnvironmentVariables::UploadInterval);
269-
int interval;
269+
int32_t interval;
270270
if (TryParse(r, interval))
271271
{
272272
return std::chrono::seconds(interval);
@@ -305,7 +305,7 @@ bool convert_to(shared::WSTRING const& s, shared::WSTRING& result)
305305
return true;
306306
}
307307

308-
bool convert_to(shared::WSTRING const& s, int& result)
308+
bool convert_to(shared::WSTRING const& s, int32_t& result)
309309
{
310310
return TryParse(s, result);
311311
}

profiler/src/ProfilerEngine/Datadog.Profiler.Native/Configuration.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,15 @@ class Configuration final : public IConfiguration
3232
std::string const& GetHostname() const override;
3333
std::string const& GetAgentUrl() const override;
3434
std::string const& GetAgentHost() const override;
35-
int GetAgentPort() const override;
35+
int32_t GetAgentPort() const override;
3636
bool IsAgentless() const override;
3737
std::string const& GetSite() const override;
3838
std::string const& GetApiKey() const override;
3939
std::string const& GetServiceName() const override;
4040
bool IsCpuProfilingEnabled() const override;
4141
bool IsWallTimeProfilingEnabled() const override;
4242
bool IsExceptionProfilingEnabled() const override;
43-
int ExceptionSampleLimit() const override;
43+
int32_t ExceptionSampleLimit() const override;
4444

4545
private:
4646
static tags ExtractUserTags();
@@ -63,7 +63,7 @@ class Configuration final : public IConfiguration
6363
static std::string const DefaultEnvironment;
6464
static std::string const DefaultAgentHost;
6565
static std::string const DefaultEmptyString;
66-
static int const DefaultAgentPort;
66+
static int32_t const DefaultAgentPort;
6767
static std::chrono::seconds const DefaultDevUploadInterval;
6868
static std::chrono::seconds const DefaultProdUploadInterval;
6969

@@ -88,5 +88,5 @@ class Configuration final : public IConfiguration
8888
tags _userTags;
8989
bool _isNativeFrameEnabled;
9090
bool _isAgentLess;
91-
int _exceptionSampleLimit;
91+
int32_t _exceptionSampleLimit;
9292
};

0 commit comments

Comments
 (0)