summaryrefslogtreecommitdiff
path: root/src/inc
AgeCommit message (Collapse)AuthorFilesLines
2020-04-22[Tizen] Add a config knob for importing ibc filesSwift Kim1-1/+1
2020-04-16Fix PIE options (#26323)submit/tizen/20200415.223728accepted/tizen/unified/20200416.080052Jan Vorlicek1-1/+0
* Fix PIE options We were missing passing the -pie linker option. That means that while we were compiling our code as position independent, the executables (not shared libraries) were not marked as position independent and ASLR was not applied to them. They were always loaded to fixed addresses. This change adds the missing -pie option and also replaces all the individual settings of -fPIE / -fPIC on the targets we build by a centralized setting of CMAKE_POSITION_INDEPENDENT_CODE variable that causes cmake to add the appropriate compiler options everywhere. * Fix native parts of coreclr tests build The native parts of the tests are not built using the root CMakeLists.txt so I am moving enabling the position independent code to configurecompiler.cmake Change-Id: Ieafff8984ec23e5fdb00fb0c2fb017e53afbce88
2020-03-25[Tizen] Add coreclr_preload_assembly to CoreCLR host APIKonstantin Baladurin1-0/+5
2020-03-25[Linux/x86] Use ebp from current context during unwinding (#26789)Konstantin Baladurin1-2/+9
pCurrentContextPointers in REGDISPLAY can contain NULLs so we need to use ebp value from pCurrentContext. This patch contains following changes: - GetRegdisplayFP returns ebp from pCurrentContext - GetRegdisplayFP is used instead of *GetEbpLocation() - Set##reg##Location also updates register value in pCurrentContext
2020-03-25Linux/x86: fix build (#26594)Konstantin Baladurin1-0/+1
2020-03-25corbbtprof: set byte alignment for CORBBTPROF structures (#25816)Konstantin Baladurin1-0/+5
Fix patch fixes SIGBUG that occurs due to unaligned read/write
2020-03-25[Tizen] Disable jithost arena cacheGleb Balykov1-1/+1
2019-11-11[release/3.1] Reword comments for policheck (#27670)Jeremy Koritzinsky1-11/+11
* Comment rewordings required by policheck. * Use AppContainer instead of Windows Store.
2019-10-30[Release/3.1] Port profiler APIs to set and retrieve environment variables ↵David Mason1-0/+34
to 3.1 (#27512)
2019-10-22Fix step with stackalloc (#27246) (#27351)Steve MacLean1-1/+1
* Make ControllerStackInfo::m_returnFrame private * Make ControllerStackInfo always capture a return frame In case the active frame has no managed caller, capture the unmanaged frame * Fix step over stackalloc Generalize handling of stack allocations and stepping * Fix GetFunctionFromToken() argument checking Check token type is a method before creating a CordbFunction. Add extra assert to check for invalid tokens
2019-10-21[Release/3.1] Fixes for profiler stack sampling (#27300)David Mason1-0/+3
* only set THREAD_IS_SUSPENDED if we are truly doing an async stack walk (#26985) * Use a new COR_PRF_SUSPEND_FOR_PROFILER in ICorProfilerCallback::RuntimeThreadSuspended() when requested by profiler (#27041) Fixes https://github.com/dotnet/coreclr/issues/26576
2019-10-14Do not create diagnostics server thread and pipe if EnableDiagnostics is set ↵Sung Yoon Whang1-1/+1
to 0 (#27137) (#27140) * Do not create diagnostics server thread and pipe if EnableDiagnostics is set to 0 * Remove unnecessary check for config var in DiagnosticServer::Shutdown
2019-08-29Emit RVA Instead of File Offset by Default in Native Image PerfMap Files ↵Brian Robbins1-0/+1
(#26423)
2019-07-11Fix GS cookie check on ARM in functions with stackalloc (#25628)Jan Vorlicek1-0/+2
* Fix GS cookie check on ARM in functions with stackalloc The GC cookie check was failing during GC stack walking on ARM for frames of functions using stackalloc and pinvoke. The InlinedCallFrame stores only the SP after the stackalloc adjustment and unwinder needs R9 that contains SP before the stackalloc to be able to unwind the frame to get caller SP. The caller SP is used as a base for getting the GS cookie address. We were incorrectly setting the R9 in the CONTEXT to the same value as SP and so the unwinding was getting an incorrect caller SP. The fix is to store R9 in the InlinedCallFrame for ARM.
2019-07-05many core (#25350)Maoni Stephens1-0/+3
2019-07-03Add check to prevent attaching a profiler when one is already present (#25520)David Mason1-0/+1
* Don't load multiple profilers * add comment * Move check to LoadProfiler, and eliminate race condition between attach profiler and startup profiled
2019-06-27Enable parsing multiple providers for LTTngConfig variable (#25451)Sung Yoon Whang1-42/+55
* Enable parsing multiple providers for LTTngConfig variable * Handle case where LTTngConfig==NULL * renaming some methods * Add comment about the format of environment variable being parsed
2019-06-26Delegate inspection API in the DBI (#25362)Juan Hoyos2-0/+40
* Add ICorDebugDelegateObjectValue interfaces * Expose appropriate HR (CORDBG_E_UNSUPPORTED_DELEGATE) * Partially DACize DelegateObject * Add DacDbi method for delegate inspection
2019-06-25Fix LTTng filtering for runtime providers (#25374)Sung Yoon Whang2-23/+252
* LTTng filtering * Fix Windows build, make IsInitialized check faster * Cleanup/change default to no keywords/level set * Keep the default to be the current policy - enable everything * more cleanup * No need to check for initialization * Fix Windows build
2019-06-25Fix ReJIT failures (#25377)David Mason1-0/+1
2019-06-25Fix StackChange value for OpCodes.Stelem (#25382)Jan Kotas1-4/+4
Fixes dotnet/corefx#37955
2019-06-25Add a note about ReadyToRun to ManagedNativeHeaderOmair Majid1-1/+2
2019-06-25Fix broken ETW events (#25364)Sung Yoon Whang1-4/+4
2019-06-21Add EventPipe Processor Number support and make NetTrace the default … ↵Noah Falk1-1/+2
(#25276) * Add EventPipe Processor Number support and make NetTrace the default format The EventPipe header now has a Processor Number field. On windows we query the correct value, on other OSes we currently have a -1 placeholder, but the field is written to the format regardless. NetTrace is now the default format when using the environment variable, and the format must be explicitly configured when using the IPC channel or managed API. A parallel change in the diagnostics repo is changing dotnet-trace and dotnet-counter to specify nettrace format which means .NET devs should see nettrace almost exclusively from now on. If for whatever reason it is needed, NetPerf remains available if a scenario explicitly requests to use it. * PR feedback + attempting to fix broken tests
2019-06-20Add custom default base address option to crossgen (#25227)Gleb Balykov1-0/+5
* Add crossgen option to setup default base address for native image This is enabled only with -DFEATURE_ENABLE_NO_ADDRESS_SPACE_RANDOMIZATION. * Mmap native images at default base address if env variable COMPlus_UseDefaultBaseAddr=0x1 is setup. This is enabled only with -DFEATURE_ENABLE_NO_ADDRESS_SPACE_RANDOMIZATION.
2019-06-20Fix eventpipe filtering (#25221)Sung Yoon Whang1-21/+43
* Add DOTNET_TRACE_CONTEXT and change macros to use DOTNET_TRACE_CONTEXT instead of MCGEN_TRACE_CONTEXT * Fixing macro definitions * eventing codegen scripts now generates EventPipe trace contexts * Fix macros to use the EVENTPIPE_TRACE_Context * Fix linux build * Fix windows build * Update Eventpipe provider context at EtwCallbackComon * break in switch * Update rundown provider context manually * PR feedback * Eventpipe->EventPipe * cleanup in codegen script
2019-06-17Remove unused TRACE_LEVEL_NONE (#23711)mvandeberg1-1/+0
Removed define TRACE_LEVEL_NONE from eventtracebase.h. Removed static_assert(GCEventLevel_None == TRACE_LEVEL_NONE, "GCEventLevel_None value mismatch"); from eventtrace.cpp Enhancement #23711
2019-06-13Add a switch to suppress crossgen warningsfadimounir1-0/+1
2019-06-11Delete dead code (#25066)Jan Kotas1-11/+0
2019-06-11R2R ilstubs (#24823)David Wrighton1-0/+5
* Basic support for precompiled pinvoke stubs * Generate R2R file with multiple references to same IL stub (one per method which the IL stub is associated with) * Not all il stubs are p/invokes. Don't fail when they aren't. * Consistently use IsDynamicScope and GetModule to avoid unsafe memory access in IL stub compilation paths * Enable full p/invoke il stubs when compiling System.Private.Corelib * Disable IL Stub generation in crossgen for ARM32. - The cross bitness logic is not correct for IL Stub generation
2019-06-11Refactor one-time ETL rundown event firing (#24993)Koundinya Veluri1-0/+1
- Moved the `RuntimeInformation` and `TieredCompilation/Settings` events to fire on rundown on attach/detach
2019-06-10Add optimization tiers to the Linux perf maps for perfcollect (#24967)Koundinya Veluri2-11/+1
Add optimization tiers to the Linux perf maps for perfcollect Fixes https://github.com/dotnet/coreclr/issues/23222: - It looks like module unloads are currently not taken into account. Once they would be taken into account, Although we have method JIT events from `lttng` with the code address and optimization tier, samples can only be associated with method JIT events by associating the time range when the module is loaded with times of samples, and the event times from `lttng` would not necessarily correspond with times from samples taken by `perf`. - Updated to include the optimization tier in the perf map for each jitted or R2R method code address - Refactored common code between eventtrace and perfmap for getting jit tiers
2019-06-10Add support for the NetTrace EventPipe file formatnoahfalk1-0/+1
Right now the new format is not on by default, but it can be enabled using COMPlus_EventPipeNetTraceFormat = 1 for testing purposes. The plan to have a follow up PR that will add shipping configuration mechanisms and change the default setting. See the documentation in the PerfView repo for more details about the format. At a glance the goal is to create a format that is more efficient to produce, has a smaller on disk size, and offers enhanced functionality in a few areas: a) 64 bit thread id support b) Detection of dropped events via sequence numbers c) Better support for extracting subsets of the file Together with the change there was also some refactoring of the EventPipeBufferManager and EventPipeThread. This change addresses (at least in part) the following issues: #19688, #23414, #24188, #20751, #20555, #21827, #24852, #25046
2019-06-07Merge pull request #24007 from mikedn/enable-w4Sergey Andreenko1-2/+2
Compile JIT sources with /W4
2019-06-07Do not delete polymorphic objects without a virtual destructor (#23705)Omair Majid1-0/+2
SEI CERT C++ Coding Standard says: > Do not delete an object of derived class type through a pointer to its > base class type that has a non-virtual destructor. Instead, the base > class should be defined with a virtual destructor. Deleting an object > through a pointer to a type without a virtual destructor results in > undefined behavior. See https://wiki.sei.cmu.edu/confluence/display/cplusplus/OOP52-CPP.+Do+not+delete+a+polymorphic+object+without+a+virtual+destructor Clang generally warns about this, but we disabled the warning via -Wno-delete-non-virtual-dtor. This commit re-enables the warning and fixes up all the code that hits the warning.
2019-06-07Reduce indirect function calls (#24980)David Wrighton2-6/+43
* Reduce indirect dispatch in hot paths in metadata * Remove allocation indirections in utilcode for coreclr - we no longer have a multi-dll distribution of code that needs to share heaps * Remove unused code in GetCLRFunction * Remove virtual dispatch around impl/decl methodtable access in MethodData
2019-06-05APIs to allow profilers to use DoStackSnapShot on Linux (#24968)David Mason4-0/+15
2019-06-05Fix GCStress coverage for multi reg returns. (#24826)Sergey Andreenko1-0/+6
* Extract ReplaceInstrAfterCall. * Avoid GCStress when return multireg with pointers. Determinate when we need to protect the second register and do not cause GCStress in such cases. * Add a repro test. * Reenable MethodImplOptionsTests. * Extract IsGcCoveregeInterruptInstruction. That changes how we do checks for arm32 in `IsGcCoverageInterrupt`. * Tolerate direct call to JIT_RareDisableHelper. x86 ILStubClass:IL_STUB_PInvoke(byref,ref,int,byref):int generates it like: Generating: N119 ( 4, 7) [000118] ------------ * RETURNTRAP int REG NA IN0021: cmp dword ptr [0F9BF9F8H], 0 New Basic Block BB10 [0009] created. IN0022: je L_M6496_BB10 Call: GCvars=00000001 {V01}, gcrefRegs=00000000 {}, byrefRegs=00000000 {} IN0023: call CORINFO_HELP_STOP_FOR_GC * Support GC stress protect return 1/2/both Unix x64. * Fix arm64. Do not insert GC Stress instrucitons when we can't determinate the exact return kind. * Fix review1. * Fix review2. * Change the test as Andy suggested. * Fix some typos. * Replace all SLOT with PBYTE. * Disable assert that can fail because of multithreading.
2019-06-05Use Modern CMake features instead of CMAKE_CXX_FLAGS (#24861)Jeremy Koritzinsky1-1/+1
* Convert C++ standard settings and warning options from CMAKE_<LANG>_FLAGS to Modern CMake isms. * More $<COMPILE_LANGUAGE> generator expressions instead of CMAKE_CXX_FLAGS. * Use $<COMPILE_LANGUAGE:CXX> for all -fpermissive usage * Fix generator expression that generates multiple flags * Fix invalid use of CMAKE_CXX_FLAGS instead of CMAKE_C_FLAGS. * Treat AppleClang as though it is Clang (match pre-3.0 behavior). * Update our build system to understand that AppleClang is distinct from Clang and remove CMP0025 policy setting. * PR Feedback.
2019-05-30Delete dead code (#24876)Jan Kotas1-11/+0
2019-05-30Implement R2R helpers for synchronized methods (#24646)Michal Strehovský2-0/+6
Synchronized methods show up when `Console` is used and the missing helper mapping would cause us not to AOT compile them.
2019-05-29Add COMPlus_LTTng environment variable (#24733)John Salem1-0/+4
* default value is 1, and when set to 0 will disable loading LTTng. Co-Authored-By: Jan Kotas <jkotas@microsoft.com>
2019-05-24Delete FEATURE_USE_LCID (#24767)Jan Kotas2-104/+1
Never defined and obsolete
2019-05-24Remove dependency on IEEMemoryManager (#24755)Jan Kotas1-1/+1
2019-05-23Delete RETURNTYPE and change how we get ReturnKind for gccover. (#24600)Sergey Andreenko1-0/+14
* Move GetReturnKindFromMethodTable to method.hpp. We would need this in other places in the next commits. * Delete unnecessary checks from callhelpers. * Do not check return types in CanDeduplicateCode. GC info v.2 has this information and it is checked in another place. * Change ComPlusMethodFrame to use the new function. * Change gccover.cpp to use GetReturnKindFromMethodTable. * Delete RETURNTYPE. * Add check to ComPlusMethodFrame. * Delete check from threadsuspend. codeInfo->GetCodeManager()->GetReturnKind(gcInfoToken) must always return a valid kind nowdays (it could return an invalid lind only when GC Info v2 was not available). * Rename functions/arguments. * Add check for IsValidReturnKind. * delete unused var.
2019-05-23Diagnostics IPC (#24582)John Salem1-0/+20
* Initial draft of structs and classes for Diagnostic Server IPC Protocol * Fix some syntax/name issues that weren't getting caught by intellisense in vscode for mac * * Add member checkers for Flatten and GetSize * Split Flatten impl to have a default version for simple, fixed-size structs * * Remove unnecessary abstract class * Add documentation about templates * * Change templating for IpcMessage class to be more limited (only on message creation and payload parsing) * flesh out parse and tryparse * add requirement for non-fixed-size payloads to implement a static TryParse(buffer, bufferlen) * refactor namespace to bottom of file * * moved DiagnosticsIpc namespace into diagnosticprotocol.h to avoid being referenced by debug-pal project * converted diagnostic server to use DiagnosticsIpc code * converted EventPipeProtocolHelper to use DiagnosticsIpc code * made EventPipe end to end use DiagnosticsIpc code * * Add ASSERTs where relevant * Refactor stream ownershpi back to previous way for collect tracing response * * Add contracts where applicable * * Updating GenerateCoreDump code to use new IPC work after rebase * * modify contract in DiagnosticProtocolHelper to be more restrictive * remove comments * Add comment documentation of SFINAE pattern above usage * simplify Has* checks * Fix function resolution for static member check * Add Constructor for rvalue references to IpcMessage * avoid code path that would result in a blocking read on 0 bytes * Fix silly strcmp bug * fix contractin EventPipeProtocolHelper * * Modify header declaration to make static initialization easier * fix type in template code * * Make all messages use Initialize instead of constructor for hydrating themselves, to make error paths easier * * Expand and streamline error model to match spec * Simplify writing error messages to a static function * memory management * *modify function signatures for SFINAE to remove clang warning * * add braces to static initialization to remove clang warnings * * modify IpcMessage::TryParseImpl, to reset the internal data pointer when passing back a reinterpret_cast to prevent double frees on destruction * Add notes on requirement that user free the memory for a payload * * fix bug in TryParse for generateCoreDump * change INT to uint32_t in GenerateCoreDump payloads * Remove unused error code * * rename Miscellaneous command set to Diagnostic * Remove unnecessary command ids in EventPipe * Rename Diagnostic command set to Dump * * Move payload into Holder to simplify cleanup * Add buffer holder to payloads to ensure the buffers are being cleaned up after use * updated Profiler attach to use IPC work after rebase * * Fix typos * Fix placement of ifdefs for profiler helpers * * Fix accidental char hidden in ifdef... * * Add ASSERT to signify we shouldn't be re-using IpcMessages * * fix another typo hidden behind inactive ifdef... * * Change errors to use HRESULTS to increase transparency * fix bug in profiler attach for checking if entire client data is in buffer
2019-05-23Delete FEATURE_TESTHOOK (#24746)Jan Kotas2-160/+0
2019-05-23Delete unused PredefinedTlsSlots (#24744)Jan Kotas1-3/+1
2019-05-23Add some perf events/data for tiered compilation (#24607)Koundinya Veluri3-13/+111
Add some perf events/data for tiered compilation New events: - `Settings` - Sent when TC is enabled - `Flags` - Currently indicates whether QuickJit and QuickJitForLoops are enabled - `Pause` - Sent when TC is paused (due to a new method being called for the first time) - `Resume` - Sent when TC resumes - `NewMethodCount` - Number of methods called for the first time while tiering was paused - `BackgroundJitStart` - Sent when starting to JIT methods in the background - `PendingMethodCount` - Number of methods currently scheduled for background JIT - `BackgroundJitStop` - Sent when background jitting stops - `PendingMethodCount` - Same as above. When 0, background jitting has completed. - `JittedMethodCount` - Number of methods jitted in the background since the previous BackgroundJitStart event on the same thread Miscellaneous: - Updated method JIT events to include the optimization tier - Added a couple more cases where tiered compilation is disabled for methods that have JIT optimization disabled for some reason - Renamed `Duration` field of the new version of the `ContentionEnd` to `DurationNs` to indicate the units of time - Added `OptimizationTierOptimized` to `NativeCodeVersion::OptimizationTier` to distinguish it from `OptimizationTier1`. `OptimizationTierOptimized` is now used for methods that QuickJit is disabled for, and does not send the tier 1 flag. - For info about the code being generated by the JIT, added info to `PrepareCodeConfig` and stored a pointer to it on the thread object for the current JIT invocation. Info is updated in `PrepareCodeConfig` and used for updating the tier on the code version and for sending the ETL event. - If the JIT decides to use MinOpt when `MethodDesc::IsJitOptimizationDisabled()` is false, the info is not stored. The runtime method event will reflect the JIT's choice, the rundown event will not. - Updated to show optimization tiers in SOS similarly to PerfView
2019-05-23Profiler attach over the diagnostics pipe (#24670)David Mason4-23/+4
Remove the old windows only profiler attach mechanism and replace it with a cross plat implementation over the diagnostics pipe