Skip to content

Commit

Permalink
Upstream sync 5f27ac2f26cd5d5069179a958ee60cddc1faecba..a5267be6402a2…
Browse files Browse the repository at this point in the history
…2f7404acb9d88b7ad3aef059094 (#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]>
  • Loading branch information
15 people authored Aug 11, 2022
1 parent bd166e5 commit 560b130
Show file tree
Hide file tree
Showing 580 changed files with 26,892 additions and 3,131 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ jobs:
runs-on: ${{ matrix.machine }}
timeout-minutes: 30
steps:
- name: Support Windows long paths
if: ${{ runner.os == 'Windows' }}
run: git config --system core.longpaths true
- uses: actions/[email protected]
- uses: actions/[email protected]
with:
Expand Down Expand Up @@ -164,6 +167,9 @@ jobs:
runs-on: ${{ matrix.machine }}
timeout-minutes: 30
steps:
- name: Support Windows long paths
if: ${{ runner.os == 'Windows' }}
run: git config --system core.longpaths true
- uses: actions/[email protected]
- uses: actions/[email protected]
with:
Expand Down Expand Up @@ -232,6 +238,9 @@ jobs:
runs-on: ${{ matrix.machine }}
timeout-minutes: 30
steps:
- name: Support Windows long paths
if: ${{ runner.os == 'Windows' }}
run: git config --system core.longpaths true
- uses: actions/[email protected]
- uses: actions/[email protected]
with:
Expand Down Expand Up @@ -303,6 +312,9 @@ jobs:
runs-on: ${{ matrix.machine }}
timeout-minutes: 60
steps:
- name: Support Windows long paths
if: ${{ runner.os == 'Windows' }}
run: git config --system core.longpaths true
- uses: actions/[email protected]
- uses: actions/[email protected]
with:
Expand Down Expand Up @@ -420,6 +432,9 @@ jobs:
framework: [ net461, netcoreapp3.1 ]
timeout-minutes: 60
steps:
- name: Support Windows long paths
if: ${{ runner.os == 'Windows' }}
run: git config --system core.longpaths true
- uses: actions/[email protected]
- uses: actions/[email protected]
with:
Expand Down Expand Up @@ -466,6 +481,9 @@ jobs:
framework: [ net461, netcoreapp3.1 ]
timeout-minutes: 60
steps:
- name: Support Windows long paths
if: ${{ runner.os == 'Windows' }}
run: git config --system core.longpaths true
- uses: actions/[email protected]
- uses: actions/[email protected]
with:
Expand Down
19 changes: 19 additions & 0 deletions Datadog.Trace.Debugger.slnf
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"solution": {
"path": "Datadog.Trace.sln",
"projects": [
"tracer\\src\\Datadog.AutoInstrumentation.NativeLoader\\Datadog.AutoInstrumentation.NativeLoader.vcxproj",
"tracer\\src\\Datadog.Trace.ClrProfiler.Native\\Datadog.Trace.ClrProfiler.Native.DLL.vcxproj",
"tracer\\src\\Datadog.Trace.ClrProfiler.Native\\Datadog.Trace.ClrProfiler.Native.vcxproj",
"tracer\\src\\Datadog.Trace.SourceGenerators\\Datadog.Trace.SourceGenerators.csproj",
"tracer\\src\\Datadog.Trace.Tools.Analyzers\\Datadog.Trace.Tools.Analyzers.csproj",
"tracer\\src\\Datadog.Trace\\Datadog.Trace.csproj",
"tracer\\test\\Datadog.Trace.ClrProfiler.IntegrationTests\\Datadog.Trace.ClrProfiler.IntegrationTests.csproj",
"tracer\\test\\Datadog.Trace.TestHelpers\\Datadog.Trace.TestHelpers.csproj",
"tracer\\test\\Datadog.Trace.Tests\\Datadog.Trace.Tests.csproj",
"tracer\\test\\test-applications\\debugger\\Samples.Probes\\Samples.Probes.csproj",
"tracer\\build\\_build\\_build.csproj",
"tracer\\src\\Datadog.Trace.Tools.Analyzers\\Datadog.Trace.Tools.Analyzers.csproj"
]
}
}
54 changes: 36 additions & 18 deletions Datadog.Trace.sln
Original file line number Diff line number Diff line change
Expand Up @@ -468,9 +468,23 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Datadog.InstrumentedAssembl
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Datadog.InstrumentedAssemblyVerification.Standalone", "tracer\src\Datadog.InstrumentedAssemblyVerification.Standalone\Datadog.InstrumentedAssemblyVerification.Standalone.csproj", "{61FD6A7E-38EB-4B90-A890-DE3205C041B1}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "debugger", "debugger", "{16427BFB-B4C6-46A9-A290-8EA51FF73FEA}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Samples.Probes", "tracer\test\test-applications\debugger\Samples.Probes\Samples.Probes.csproj", "{2BED2D88-0B51-468B-A559-DA7B4BACA00B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Samples.AspNetMvc5CustomException", "tracer\test\test-applications\aspnet\Samples.AspNetMvc5CustomException\Samples.AspNetMvc5CustomException.csproj", "{F71B1B2D-C3E0-49B6-AC29-B96F45E12D5E}"
EndProject
Global
GlobalSection(SharedMSBuildProjectFiles) = preSolution
tracer\test\test-applications\Samples.Shared\Samples.Shared.projitems*{3c6dd42e-9214-4747-92ba-78de29aace59}*SharedItemsImports = 4
tracer\test\test-applications\Samples.Shared\Samples.Shared.projitems*{6d86109f-b7c9-477d-86d7-45735a3a0818}*SharedItemsImports = 4
tracer\test\test-applications\Samples.Shared\Samples.Shared.projitems*{7b0822f6-80de-4b49-8125-93975678d0d5}*SharedItemsImports = 4
tracer\test\test-applications\Samples.Shared\Samples.Shared.projitems*{99a62ccf-8e7f-4d57-8383-d38c371c8087}*SharedItemsImports = 4
tracer\test\test-applications\Samples.Shared\Samples.Shared.projitems*{b6a98887-4a47-4c19-9c6f-d833e24f4b1c}*SharedItemsImports = 4
tracer\test\test-applications\Samples.Shared\Samples.Shared.projitems*{bbb60b0f-bf01-4499-936a-4a299a9acfd4}*SharedItemsImports = 4
tracer\test\test-applications\Samples.Shared\Samples.Shared.projitems*{f71b1b2d-c3e0-49b6-ac29-b96f45e12d5e}*SharedItemsImports = 4
tracer\test\test-applications\Samples.Shared\Samples.Shared.projitems*{fab2b108-e5be-4647-869b-1dc5d362252e}*SharedItemsImports = 4
EndGlobalSection
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Expand Down Expand Up @@ -2304,18 +2318,30 @@ Global
{61FD6A7E-38EB-4B90-A890-DE3205C041B1}.Release|x64.Build.0 = Release|Any CPU
{61FD6A7E-38EB-4B90-A890-DE3205C041B1}.Release|x86.ActiveCfg = Release|Any CPU
{61FD6A7E-38EB-4B90-A890-DE3205C041B1}.Release|x86.Build.0 = Release|Any CPU
{2BED2D88-0B51-468B-A559-DA7B4BACA00B}.Debug|Any CPU.ActiveCfg = Debug|x64
{2BED2D88-0B51-468B-A559-DA7B4BACA00B}.Debug|Any CPU.Build.0 = Debug|x64
{2BED2D88-0B51-468B-A559-DA7B4BACA00B}.Debug|x64.ActiveCfg = Debug|x64
{2BED2D88-0B51-468B-A559-DA7B4BACA00B}.Debug|x64.Build.0 = Debug|x64
{2BED2D88-0B51-468B-A559-DA7B4BACA00B}.Debug|x86.ActiveCfg = Debug|x86
{2BED2D88-0B51-468B-A559-DA7B4BACA00B}.Debug|x86.Build.0 = Debug|x86
{2BED2D88-0B51-468B-A559-DA7B4BACA00B}.Release|Any CPU.ActiveCfg = Release|x64
{2BED2D88-0B51-468B-A559-DA7B4BACA00B}.Release|Any CPU.Build.0 = Release|x64
{2BED2D88-0B51-468B-A559-DA7B4BACA00B}.Release|x64.ActiveCfg = Release|x64
{2BED2D88-0B51-468B-A559-DA7B4BACA00B}.Release|x64.Build.0 = Release|x64
{2BED2D88-0B51-468B-A559-DA7B4BACA00B}.Release|x86.ActiveCfg = Release|x86
{2BED2D88-0B51-468B-A559-DA7B4BACA00B}.Release|x86.Build.0 = Release|x86
{F71B1B2D-C3E0-49B6-AC29-B96F45E12D5E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F71B1B2D-C3E0-49B6-AC29-B96F45E12D5E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F71B1B2D-C3E0-49B6-AC29-B96F45E12D5E}.Debug|x64.ActiveCfg = Debug|Any CPU
{F71B1B2D-C3E0-49B6-AC29-B96F45E12D5E}.Debug|x64.Build.0 = Debug|Any CPU
{F71B1B2D-C3E0-49B6-AC29-B96F45E12D5E}.Debug|x86.ActiveCfg = Debug|Any CPU
{F71B1B2D-C3E0-49B6-AC29-B96F45E12D5E}.Debug|x86.Build.0 = Debug|Any CPU
{F71B1B2D-C3E0-49B6-AC29-B96F45E12D5E}.Debug|x64.ActiveCfg = Debug|x64
{F71B1B2D-C3E0-49B6-AC29-B96F45E12D5E}.Debug|x64.Build.0 = Debug|x64
{F71B1B2D-C3E0-49B6-AC29-B96F45E12D5E}.Debug|x86.ActiveCfg = Debug|x86
{F71B1B2D-C3E0-49B6-AC29-B96F45E12D5E}.Debug|x86.Build.0 = Debug|x86
{F71B1B2D-C3E0-49B6-AC29-B96F45E12D5E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F71B1B2D-C3E0-49B6-AC29-B96F45E12D5E}.Release|Any CPU.Build.0 = Release|Any CPU
{F71B1B2D-C3E0-49B6-AC29-B96F45E12D5E}.Release|x64.ActiveCfg = Release|Any CPU
{F71B1B2D-C3E0-49B6-AC29-B96F45E12D5E}.Release|x64.Build.0 = Release|Any CPU
{F71B1B2D-C3E0-49B6-AC29-B96F45E12D5E}.Release|x86.ActiveCfg = Release|Any CPU
{F71B1B2D-C3E0-49B6-AC29-B96F45E12D5E}.Release|x86.Build.0 = Release|Any CPU
{F71B1B2D-C3E0-49B6-AC29-B96F45E12D5E}.Release|x64.ActiveCfg = Release|x64
{F71B1B2D-C3E0-49B6-AC29-B96F45E12D5E}.Release|x64.Build.0 = Release|x64
{F71B1B2D-C3E0-49B6-AC29-B96F45E12D5E}.Release|x86.ActiveCfg = Release|x86
{F71B1B2D-C3E0-49B6-AC29-B96F45E12D5E}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -2488,19 +2514,11 @@ Global
{CD816C0C-D116-49A1-93A7-8095594224EB} = {9E5F0022-0A50-40BF-AC6A-C3078585ECAB}
{FCE813DE-7BF2-4F63-8303-E92F90780C81} = {9E5F0022-0A50-40BF-AC6A-C3078585ECAB}
{61FD6A7E-38EB-4B90-A890-DE3205C041B1} = {9E5F0022-0A50-40BF-AC6A-C3078585ECAB}
{16427BFB-B4C6-46A9-A290-8EA51FF73FEA} = {9518425A-36A5-4B8F-B0B8-6137DB88441D}
{2BED2D88-0B51-468B-A559-DA7B4BACA00B} = {16427BFB-B4C6-46A9-A290-8EA51FF73FEA}
{F71B1B2D-C3E0-49B6-AC29-B96F45E12D5E} = {AFA0AB23-64F0-4AC1-9050-6CE8FE06F580}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {160A1D00-1F5B-40F8-A155-621B4459D78F}
EndGlobalSection
GlobalSection(SharedMSBuildProjectFiles) = preSolution
tracer\test\test-applications\Samples.Shared\Samples.Shared.projitems*{3c6dd42e-9214-4747-92ba-78de29aace59}*SharedItemsImports = 4
tracer\test\test-applications\Samples.Shared\Samples.Shared.projitems*{6d86109f-b7c9-477d-86d7-45735a3a0818}*SharedItemsImports = 4
tracer\test\test-applications\Samples.Shared\Samples.Shared.projitems*{7b0822f6-80de-4b49-8125-93975678d0d5}*SharedItemsImports = 4
tracer\test\test-applications\Samples.Shared\Samples.Shared.projitems*{99a62ccf-8e7f-4d57-8383-d38c371c8087}*SharedItemsImports = 4
tracer\test\test-applications\Samples.Shared\Samples.Shared.projitems*{b6a98887-4a47-4c19-9c6f-d833e24f4b1c}*SharedItemsImports = 4
tracer\test\test-applications\Samples.Shared\Samples.Shared.projitems*{bbb60b0f-bf01-4499-936a-4a299a9acfd4}*SharedItemsImports = 4
tracer\test\test-applications\Samples.Shared\Samples.Shared.projitems*{f71b1b2d-c3e0-49b6-ac29-b96f45e12d5e}*SharedItemsImports = 4
tracer\test\test-applications\Samples.Shared\Samples.Shared.projitems*{fab2b108-e5be-4647-869b-1dc5d362252e}*SharedItemsImports = 4
EndGlobalSection
EndGlobal
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -712,6 +712,7 @@ services:
- "8126:8126"
environment:
- SNAPSHOT_CI=1
- SNAPSHOT_IGNORED_ATTRS=span_id,trace_id,parent_id,duration,start,metrics.system.pid,meta.runtime-id,metrics.process_id

smoke-tests:
build:
Expand Down
10 changes: 10 additions & 0 deletions docs/internal/internal-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,16 @@ These settings should be never used by the users.
| `SIGNALFX_LOG_LEVEL` | Sets the log level for serverless. | |
| `_SIGNALFX_EXTENSION_PATH` | Sets the lambda extension path. | |
| `SIGNALFX_TRACE_X_DATADOG_TAGS_MAX_LENGTH` | Configuration key for the maximum length of an outgoing propagation header's value ("x-datadog-tags") | `512` |
| `SIGNALFX_DEBUGGER_POLL_INTERVAL` | Sets the debugger poll interval (in seconds). | `1` |
| `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. | |
| `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. | |
| `SIGNALFX_DEBUGGER_ENABLED` | Enabling or disabling the Live Debugger | `false` |
| `SIGNALFX_DEBUGGER_MAX_DEPTH_TO_SERIALIZE` | Sets the max object depth to serialize for probe snapshots. | `1` |
| `SIGNALFX_DEBUGGER_MAX_TIME_TO_SERIALIZE` | Sets the maximum duration (in milliseconds) to run serialization for probe snapshots. | `150` |
| `SIGNALFX_DEBUGGER_UPLOAD_BATCH_SIZE` | Sets the maximum upload batch size. | `100` |
| `SIGNALFX_DEBUGGER_DIAGNOSTICS_INTERVAL` | Sets the interval (in seconds) between sending probe statuses. | `3600` |
| `SIGNALFX_DEBUGGER_UPLOAD_FLUSH_INTERVAL` | Sets the interval (in milliseconds) between flushing statuses. | `0` |
| `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` |

## Unpublished settings

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ using namespace std::chrono_literals;
std::mutex LinuxStackFramesCollector::s_signalHandlerInitLock;
std::mutex LinuxStackFramesCollector::s_stackWalkInProgressMutex;
bool LinuxStackFramesCollector::s_isSignalHandlerSetup = false;
int LinuxStackFramesCollector::s_signalToSend = -1;
int32_t LinuxStackFramesCollector::s_signalToSend = -1;
LinuxStackFramesCollector* LinuxStackFramesCollector::s_pInstanceCurrentlyStackWalking = nullptr;

LinuxStackFramesCollector::LinuxStackFramesCollector(ICorProfilerInfo4* const _pCorProfilerInfo) :
Expand Down Expand Up @@ -192,7 +192,7 @@ void LinuxStackFramesCollector::InitializeSignalHandler()
s_isSignalHandlerSetup = SetupSignalHandler();
}

bool LinuxStackFramesCollector::TrySetHandlerForSignal(int signal, struct sigaction& action)
bool LinuxStackFramesCollector::TrySetHandlerForSignal(int32_t signal, struct sigaction& action)
{
struct sigaction oldAction;
if (sigaction(signal, nullptr, &oldAction) < 0)
Expand All @@ -209,7 +209,7 @@ bool LinuxStackFramesCollector::TrySetHandlerForSignal(int signal, struct sigact
if (oldAction.sa_handler == SIG_DFL || oldAction.sa_handler == SIG_IGN)
{
sigaddset(&action.sa_mask, signal);
int result = sigaction(signal, &action, &oldAction);
int32_t result = sigaction(signal, &action, &oldAction);
if (result == 0)
{
return true;
Expand Down Expand Up @@ -258,7 +258,7 @@ bool LinuxStackFramesCollector::SetupSignalHandler()
return false;
}

char const* LinuxStackFramesCollector::ErrorCodeToString(int errorCode)
char const* LinuxStackFramesCollector::ErrorCodeToString(int32_t errorCode)
{
switch (errorCode)
{
Expand Down Expand Up @@ -349,7 +349,7 @@ std::int32_t LinuxStackFramesCollector::CollectCallStackCurrentThread()
}
}

void LinuxStackFramesCollector::CollectStackSampleSignalHandler(int signal)
void LinuxStackFramesCollector::CollectStackSampleSignalHandler(int32_t signal)
{
std::unique_lock<std::mutex> stackWalkInProgressLock(s_stackWalkInProgressMutex);
LinuxStackFramesCollector* pCollectorInstanceCurrentlyStackWalking = s_pInstanceCurrentlyStackWalking;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,14 @@ class LinuxStackFramesCollector : public StackFramesCollectorBase
ICorProfilerInfo4* const _pCorProfilerInfo;

private:
static bool TrySetHandlerForSignal(int signal, struct sigaction& action);
static void CollectStackSampleSignalHandler(int signal);
static bool TrySetHandlerForSignal(int32_t signal, struct sigaction& action);
static void CollectStackSampleSignalHandler(int32_t signal);

static char const* ErrorCodeToString(int errorCode);
static char const* ErrorCodeToString(int32_t errorCode);
static std::mutex s_stackWalkInProgressMutex;
static std::mutex s_signalHandlerInitLock;
static bool s_isSignalHandlerSetup;
static int s_signalToSend;
static int32_t s_signalToSend;

static LinuxStackFramesCollector* s_pInstanceCurrentlyStackWalking;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ bool GetCpuInfo(pid_t tid, bool& isRunning, uint64_t& cpuTime)
}

char state = ' ';
int userTime = 0;
int kernelTime = 0;
int32_t userTime = 0;
int32_t kernelTime = 0;
bool success = OpSysTools::ParseThreadInfo(sline, state, userTime, kernelTime);
if (!success)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ bool IsRunning(ManagedThreadInfo* pThreadInfo, uint64_t& cpuTime)
SYSTEM_THREAD_INFORMATION sti = {0};
auto size = sizeof(SYSTEM_THREAD_INFORMATION);
ULONG buflen = 0;
NTSTATUS lResult = NtQueryInformationThread(pThreadInfo->GetOsThreadHandle(), SYSTEMTHREADINFORMATION, &sti, size, &buflen);
NTSTATUS lResult = NtQueryInformationThread(pThreadInfo->GetOsThreadHandle(), SYSTEMTHREADINFORMATION, &sti, static_cast<ULONG>(size), &buflen);
if (lResult != 0)
{
// This always happens in 32 bit so uses another API to at least get the CPU consumption
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,11 +162,11 @@ void AdaptiveSampler::RollWindow()

if (_totalCountRunningAverage == 0 || _emaAlpha <= 0.0)
{
_totalCountRunningAverage = totalCount;
_totalCountRunningAverage = static_cast<double>(totalCount);
}
else
{
_totalCountRunningAverage = _totalCountRunningAverage + _emaAlpha * (totalCount - _totalCountRunningAverage);
_totalCountRunningAverage = _totalCountRunningAverage + _emaAlpha * (static_cast<double>(totalCount) - _totalCountRunningAverage);
}

if (_totalCountRunningAverage <= 0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ std::string const Configuration::DefaultProdSite = "datadoghq.com";
std::string const Configuration::DefaultVersion = "Unspecified-Version";
std::string const Configuration::DefaultEnvironment = "Unspecified-Environment";
std::string const Configuration::DefaultAgentHost = "localhost";
int const Configuration::DefaultAgentPort = 8126;
int32_t const Configuration::DefaultAgentPort = 8126;
std::string const Configuration::DefaultEmptyString = "";
std::chrono::seconds const Configuration::DefaultDevUploadInterval = 20s;
std::chrono::seconds const Configuration::DefaultProdUploadInterval = 60s;
Expand Down Expand Up @@ -105,7 +105,7 @@ bool Configuration::IsExceptionProfilingEnabled() const
return _isExceptionProfilingEnabled;
}

int Configuration::ExceptionSampleLimit() const
int32_t Configuration::ExceptionSampleLimit() const
{
return _exceptionSampleLimit;
}
Expand Down Expand Up @@ -150,7 +150,7 @@ std::string const& Configuration::GetAgentHost() const
return _agentHost;
}

int Configuration::GetAgentPort() const
int32_t Configuration::GetAgentPort() const
{
return _agentPort;
}
Expand Down Expand Up @@ -241,7 +241,7 @@ std::chrono::seconds Configuration::GetDefaultUploadInterval()
// - replace shared::TryParse by this implementation
// - add tests

bool TryParse(shared::WSTRING const& s, int& result)
bool TryParse(shared::WSTRING const& s, int32_t& result)
{
auto str = shared::ToString(s);
if (str == "")
Expand All @@ -266,7 +266,7 @@ bool TryParse(shared::WSTRING const& s, int& result)
std::chrono::seconds Configuration::ExtractUploadInterval()
{
auto r = shared::GetEnvironmentValue(EnvironmentVariables::UploadInterval);
int interval;
int32_t interval;
if (TryParse(r, interval))
{
return std::chrono::seconds(interval);
Expand Down Expand Up @@ -305,7 +305,7 @@ bool convert_to(shared::WSTRING const& s, shared::WSTRING& result)
return true;
}

bool convert_to(shared::WSTRING const& s, int& result)
bool convert_to(shared::WSTRING const& s, int32_t& result)
{
return TryParse(s, result);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ class Configuration final : public IConfiguration
std::string const& GetHostname() const override;
std::string const& GetAgentUrl() const override;
std::string const& GetAgentHost() const override;
int GetAgentPort() const override;
int32_t GetAgentPort() const override;
bool IsAgentless() const override;
std::string const& GetSite() const override;
std::string const& GetApiKey() const override;
std::string const& GetServiceName() const override;
bool IsCpuProfilingEnabled() const override;
bool IsWallTimeProfilingEnabled() const override;
bool IsExceptionProfilingEnabled() const override;
int ExceptionSampleLimit() const override;
int32_t ExceptionSampleLimit() const override;

private:
static tags ExtractUserTags();
Expand All @@ -63,7 +63,7 @@ class Configuration final : public IConfiguration
static std::string const DefaultEnvironment;
static std::string const DefaultAgentHost;
static std::string const DefaultEmptyString;
static int const DefaultAgentPort;
static int32_t const DefaultAgentPort;
static std::chrono::seconds const DefaultDevUploadInterval;
static std::chrono::seconds const DefaultProdUploadInterval;

Expand All @@ -88,5 +88,5 @@ class Configuration final : public IConfiguration
tags _userTags;
bool _isNativeFrameEnabled;
bool _isAgentLess;
int _exceptionSampleLimit;
int32_t _exceptionSampleLimit;
};
Loading

0 comments on commit 560b130

Please sign in to comment.