summaryrefslogtreecommitdiff
path: root/src/ToolBox
AgeCommit message (Collapse)AuthorFilesLines
2019-07-12Frkaya/gccfix07102019 (#25624)Sinan Kaya1-1/+1
* Remove duplicate definition * Fix conversion error * 1ui64 doesn't exist on GCC
2019-06-20Remove SOS and lldb plugin (#25220)Mike McLaughlin101-84761/+7
* Remove SOS and lldb plugin Issue: https://github.com/dotnet/coreclr/issues/24092
2019-06-17Enable createdump on arm and arm64 (#24832)Juan Hoyos1-7/+8
* Enable build of ARM64 createdump build - Adds definitions of necessary constructs and aligments for Elf formats in aarch64 - Work around changes in ptrace for aarch64 * Package createdump in runtime transport for arm and arm64 * Use special name register definitions from the PAL * Add createdump_lib to arm64 sos and package plugin
2019-06-12SuperPMI: Fix `getFieldType` (#25102)Carol Eidt2-3/+18
* SuperPMI: Fix `getFieldType` The `structType` out parameter is optional (i.e. it may be null), but it's not used as a key, so we need to update the map if we've saved a null but encounter a non-null.
2019-06-11Delete dead code (#25066)Jan Kotas8-37/+0
2019-06-07Mention `COMPlus_AltJitNgen=*` for crossgenCarol Eidt1-0/+3
2019-06-07Do not delete polymorphic objects without a virtual destructor (#23705)Omair Majid3-3/+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 Wrighton5-126/+0
* 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-06Use CMake's C# support to build DacTableGen instead of manually invoking ↵Jeremy Koritzinsky5-100/+43
csc.exe ourselves. (#24342) * Use CMake's C# support to build DacTableGen instead of manually invoking csc.exe ourselves. * Fix x86 failures. * Disable DAC generation when building with NMake Makefiles and issue an error since the CMake C# support is VS-only. We don't actually support building with NMake (only configure) so this is ok. * Clean up rest of the macro=1's PR Feedback. * Fix Visual Studio generator matching. * Explicitly specify anycpu32bitpreferred for DacTableGen so the ARM64 build doesn't accidentally make it 64-bit * Fix bad merge
2019-06-05Use Modern CMake features instead of CMAKE_CXX_FLAGS (#24861)Jeremy Koritzinsky2-3/+3
* 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-30Create NearDiffer in SuperPMI based on specified targetArchitecture (#24860)Egor Chesakov1-1/+13
2019-05-30Support running SuperPMI with ARM protononjit.dll (#24840)Egor Chesakov3-12/+50
2019-05-28Improve performance of !dumpasync SOS commandStephen Toub3-11/+46
A significant majority of the time spent in dumpasync was in getting the type name of each object in order to compare it to "AsyncStateMachineBox". This switches to comparing by module and mdTypeDef. On an ~1GB dump, the time to execute !dumpasync dropped from 43 to 11 seconds on my machine.
2019-05-28Display state machine fields in DumpAsync for -stacksStephen Toub1-7/+15
Currently the DumpAsync -fields option just impacts whether the state machine fields are output for the top-level state machines. We received feedback that it would be more expected for -fields to also cause the fields to be output for all state machines listed as part of continuation chains. This does that.
2019-05-24Remove dependency on IEEMemoryManager (#24755)Jan Kotas4-80/+70
2019-05-23Add some perf events/data for tiered compilation (#24607)Koundinya Veluri1-8/+14
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-23Use auxiliary vector to obtain the executable path name (#24696)Leandro A. F. Pereira1-1/+1
This vector is populated by the kernel while loading an ELF, and is available to user land without requiring any system calls. This is specially interesting if programs are executed under a chroot where /proc isn't available (and thus realpath("/proc/self/exe"), the current method of obtaining the full path name for the executable).
2019-05-16compilation fixes (#24613)Sinan Kaya3-3/+6
2019-05-15Delete unicode API emulator (#24581)Michal Strehovský2-3/+2
2019-05-15Fix memory corruption in GetResultFileName in SuperPMI (#24537)Egor Chesakov4-72/+64
2019-05-14Decorate SuperPMI DllMain jitStartup getJit with DLLEXPORT (#24508)Egor Chesakov3-30/+21
* Decorate DllMain with DLLEXPORT in superpmi-shim-collector.cpp superpmi-shim-counter.cpp superpmi-shim-simple.cpp * Decorate jitStartup, getJit, sxsJitStartup with DLLEXPORT in superpmi-shim-collector.cpp superpmi-shim-counter.cpp superpmi-shim-simple.cpp
2019-05-08Prefer UINT32 over DWORD in the IBC BlockCount API'sBrian Sullivan7-32/+32
2019-05-07Rename struct ICorJitInfo::ProfileBuffer to ICorJitInfo::BlockCountsBrian Sullivan11-117/+117
Rename method ICorJitInfo::allocBBProfileBuffer to ICorJitInfo::allocMethodBlockCounts Rename method ICorJitInfo::getBBProfileData to ICorJitInfo:"getMethodBlockCounts Rename args and use DWORD instead of ULONG for ICorJitInfo:allocMethodBlockCounts and ICorJitInfo:getMethodBlockCounts Rename Compiler::fgProfileBuffer to Compiler::fgBlockCounts Use an #ifdef FEATURE_CORECLR to fix the missing CORINFO_FLG_DISABLE_TIER0_FOR_LOOPS flag on the desktop. Make fgBlockCountsCount and fgNumProfileRuns DWORDs instead of ULONGs Rename local var bbCurrentBlockProfileBuffer to currentBlockCounts Rename local var bbProfileBufferStart to profileBlockCountsStart Use DWORD when iterating over BlockCounts instead of ULONG Rename ZapImage::hashBBProfileData to ZapImage::hashMethodBlockCounts SuperPMI - Fixed all references to allocBBProfileBuffer => allocMethodBlockCounts SuperPMI - fixed all reference to getBBProfileBuffer => getMethodBlockCounts
2019-05-06Port all managed product binaries to use SDK style projects (#24285)Aaron Robinson1-69/+7
Convert managed product binary to use SDK project system. - Uses Arcade for versions strings - Overrides Arcade defined output paths - should change in the future
2019-05-01Adjust some terms (#24351)Dan Moseley1-1/+1
2019-04-18Add a destructor for sos::GCHeap (#24072)Omair Majid2-0/+7
The constructor allocates memory via new[]. It should be freed up via delete[] by a destructor to avoid a memory leak.
2019-04-18Merge pull request #23934 from franksinankaya/gcc_cleanup_18Jan Vorlicek2-11/+11
Integer Conversion Issues from GCC
2019-04-16Fix a ZeroMemory call in methodcontext.cpp (#23843)Omair Majid1-2/+2
The argument is of type `GetArgTypeValue` and so the `sizeof()` should be done on `GetArgTypeValue`, not on the different type `GetArgType`.
2019-04-16Conversion issuesSinan Kaya2-11/+11
2019-04-03Remove ADID and ADIndex from CoreCLR (#23588)David Wrighton2-3/+1
- Remove concept of AppDomain from object api in VM - Various infrastructure around entering/leaving appdomains is removed - Add small implementation of GetAppDomain for use by DAC (to match existing behavior) - Simplify finalizer thread operations - Eliminate AppDomain::Terminate - Remove use of ADID from stresslog - Remove thread enter/leave tracking from AppDomain - Remove unused asm constants across all architectures - Re-order header inclusion order to put gcenv.h before handletable - Remove retail only sync block code involving appdomain index
2019-03-16Fix typo (#23300)Nikita Potapenko2-4/+4
.Net -> .NET
2019-03-07Fix signed compare warningsSinan Kaya9-16/+16
warning: comparison between signed and unsigned integer expressions [-Wsign-compare] conversions Update src/ToolBox/superpmi/mcs/verbdumptoc.cpp Co-Authored-By: franksinankaya <41809318+franksinankaya@users.noreply.github.com>
2019-03-05Remove dead AppDomain unload code (#23026)Steve MacLean1-4/+0
2019-03-03Cleanup more GCC warnings (#22872)Sinan Kaya2-2/+1
* Add parenthesis src/vm/sha1.cpp: In function ‘void SHA1_block(SHA1_CTX*)’: src/vm/sha1.cpp:93:29: warning: suggest parentheses around arithmetic in operand of ‘|’ [-Wparentheses] #define ROUND3(B, C, D) ((C & (B | D) | (B & D)) + sha1_round3) ^ src/vm/sha1.cpp:139:32: note: in expansion of macro ‘ROUND3’ e += ROTATE32L(a, 5) + ROUND3(b, c, d) + msg80[i]; * Move declaration into same file as one was defined Extern the other one was static * Remove hr=hr undefined assignment * Fix mutli-line comment warning * Convert multi-character literal * Remove null check for stack local variables rc/vm/invokeutil.cpp: In static member function ‘static void InvokeUtil::SetValidField(CorElementType, TypeHandle, FieldDesc*, OBJECTREF*, OBJECTREF*, TypeHandle, CLR_BOOL*)’: src/vm/invokeutil.cpp:978:29: warning: the address of ‘Throwable’ will never be NULL [-Waddress] EX_CATCH_THROWABLE(&Throwable); ^ src/inc/ex.h:1087:21: note: in definition of macro ‘EX_CATCH_THROWABLE’ if (NULL != ppThrowable) ^
2019-02-28Fix DumpAsync to understand ContinuationWrapper (#22913)Stephen Toub1-1/+20
Continuations created while the debugger is attached or certain EventSource events are enabled end up getting wrapped in an extra ContinuationWrapper object that carries some additional information. DumpAsync currently isn't unwrapping these but should. This just teaches it to look for a known field name so that it can "see through" these wrappers while following async "stacks".
2019-02-22More GNUC Fixes (#22687)Sinan Kaya3-2/+15
* Replace __sync_swap with __atomic_exchange_n __sync_swap() is a clang specific function. * Remove multiline comment * Add paranthesis around sum src/md/hotdata/../inc/streamutil.h:73:34: warning: suggest parentheses around ‘+’ in operand of ‘&’ [-Wparentheses] UINT32 aligned = *totalBytes + 3 & ~3; * Define __int64 * Define windows types for tests * Remove undefined has_builtin defines and define alloca and inline for GNUC * Remove __clang__ where possible * Add implicit casting to help compiler find WCHAR* variant src/binder/assembly.cpp:294:73: error: no matching function for call to ‘SString::SString(SString)’ return (pAsmName == nullptr ? nullptr : pAsmName->GetSimpleName()); ^ In file included from src/inc/sstring.h:1082:0, from src/inc/ex.h:19, from src/inc/stgpool.h:28, from src/inc/../md/inc/metamodel.h:18, from src/inc/../md/inc/metamodelro.h:19, from src/inc/metadata.h:17, from src/binder/../vm/util.hpp:19, from src/binder/../vm/common.h:110, from src/binder/assembly.cpp:14: src/inc/sstring.inl:73:8: note: candidate: SString::SString(void*, COUNT_T) inline SString::SString(void *buffer, COUNT_T size) ^ src/inc/sstring.inl:73:8: note: candidate expects 2 arguments, 1 provided src/inc/sstring.inl:436:8: note: candidate: SString::SString(SString::tagLiteral, const WCHAR*, COUNT_T) inline SString::SString(tagLiteral dummytag, const WCHAR *literal, COUNT_T count) ^ src/inc/sstring.inl:436:8: note: candidate expects 3 arguments, 1 provided src/inc/sstring.inl:418:8: note: candidate: SString::SString(SString::tagLiteral, const WCHAR*) inline SString::SString(tagLiteral dummytag, const WCHAR *literal) ^ src/inc/sstring.inl:418:8: note: candidate expects 2 arguments, 1 provided src/inc/sstring.inl:401:8: note: candidate: SString::SString(SString::tagUTF8Literal, const UTF8*) inline SString::SString(tagUTF8Literal dummytag, const UTF8 *literal) ^ src/inc/sstring.inl:401:8: note: candidate expects 2 arguments, 1 provided src/inc/sstring.inl:382:8: note: candidate: SString::SString(SString::tagLiteral, const CHAR*) inline SString::SString(tagLiteral dummytag, const ASCII *literal) * Reorder DLLEXPORT and STDAPI GNUC wants extern "C" <attribute> format. * Abstract __FUNCSIG__ * Abstract __debugbreak() * Move common compiler options out of clang and add Wno-unused-value * Add paranthesis around || and && src/gc/gc.cpp:9084:38: warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses] (!chosen_power2) && (i < free_space_count)); * Set Wno-delete-non-virtual-dtor for CXX files only * Don't warn on unterminated endif labels * Suppress unused functions * Use 0x syntax rather than h syntax on GNU asm files * Correct constructor call directly src/ToolBox/superpmi/superpmi-shared/logging.cpp:301:27: required from here src/inc/clr_std/string:58:9: error: cannot call constructor ‘std::basic_string<char>::basic_string’ directly this->basic_string::basic_string(_Ptr, c_len(_Ptr)); * Suppress NULL used in arithmetic warnings
2019-02-15JIT: modify how jit determines when to update a type (#22618)Andy Ayers8-4/+77
For single-def locals, the type of a reference seen at the assignment to the local may be a more specific type than the local's declared type. If so the jit would prefer to use the assignment type to describe the local's value, as this will lead to better optimization. For instance in ``` object x = "a string"; // only assignment to x ``` the jit can optimize better if it models the type of `x` as `string`. Instead of relying on `mergeClasses` plus some jit-side screening to decide if the assignment type is a more specific type, implement a new jit interface method `isMoreSpecificType` that tries to answer this question more directly. Added a test case with type equivalence that hit asserts. Closes #22583.
2019-02-14Gnuport cleanup 3 (#22581)Sinan Kaya1-1/+1
* Reorder extern "C" and visibility statements In file included from coreclr/src/pal/inc/pal.h:70:0, coreclr/src/pal/inc/pal_mstypes.h:30:25: error: expected unqualified-id before string constant #define EXTERN_C extern "C" ^ coreclr/src/pal/inc/rt/palrt.h:216:30: note: in expansion of macro 'EXTERN_C' #define STDAPI_(type) EXTERN_C type STDAPICALLTYPE * Need double quotes around single quotes in error statements fix error statements Can't have ' character in error statement * Abstract __declspec(noinline) Generate compiler independent macros for noinline request. * Remove unused DBG_NOINLINE_X86__RET_INLINE * Abstract __declspec(nothrow)
2019-02-09Set visibility option to hidden (#21924)Adeel Mujahid4-10/+18
2019-01-29To support container scenario, 2 HardLimit configs are added - (#22180)Maoni Stephens2-10/+11
GCHeapHardLimit - specifies a hard limit for the GC heap GCHeapHardLimitPercent - specifies a percentage of the physical memory this process is allowed to use If both are specified, GCHeapHardLimit is checked first and only when it's not specified would we check GCHeapHardLimitPercent. If neither is specified but the process is running inside a container with a memory limit specified, we will take this as the hard limit: max (20mb, 75% of the memory limit on the container) If one of the HardLimit configs is specified, and the process is running inside a container with a memory limit, the GC heap usage will not exceed the HardLimit but the total memory is still the memory limit on the container so when we calculate the memory load it's based off the container memory limit. An example, process is running inside a container with 200mb limit user also specified GCHeapHardLimit as 100mb. if 50mb out of the 100mb is used for GC, and 100mb is used for other things, the memory load is (50 + 100)/200 = 75%. Some notes on these configs - + The limit is the commit size. + This is only supported on 64-bit. + For Server GC the minimum *reserved* segment size is 16mb per heap, this is to avoid the scenario where the hard limit is small but the process can use many procs and we end up with tiny segments which doesn't make sense. We then keep track of the committed on the segments so the total does not exceed the hard limit.
2019-01-23Remove all traces of FEATURE_STACK_PROBE. (#22149)Filip Navara1-1/+0
2019-01-18SuperPMI Collect/Replay/AsmDiff tool (#21252)Jarret Shook2-3/+11
This change adds superpmi.py. The tool feature three modes, collection, replay, and asmdiffs. Collection The collection logic is very similar to the logic in our superpmi-collect test. Mostly it just allows running a script which will run managed code and it will produce a .mch which is clean to be run against. See superpmi.md for more information on specific usage and problems. Replay Replay will take an existing .mch file and run the current jit over the collection. If there is no .mch file on disk, the script will download the latest collection and run against that. AsmDiffs superpmi.md has the latest information on what platforms support asmdiffs. So far, I have an updated OSX and Windows collection that I have run against. If there are binary diffs, the tool will automatically generate base & diff folders with the asm under each one. Future work would include automatically running jit-analyze over those locations. In addition, the tool has the option to automatically run and diff jit dumps, I have found this to be useful to looking into diffs created, as re-running superpmi with different jits to collect this same information is somewhat tedious. Future work This change is in no way the end of the work needed to leverage superpmi effectively. Instead, it is a good first step. Below are some suggestions for future superpmi work: Automated collections Add pmi collection support Leverage some of the new corefx work to use superpmi shim for collections of corefx runs To be added/changed I will unset zapdisable being set by default, it creates too much data, although it is useful it should be opt in Will include example usage in superpmi.md.
2019-01-09Enable FinalizeQueue SOS command for Unix (#21876)Jan Vorlicek4-8/+26
The command is very useful and there seems to be no reason for it to not to be enabled on Unix.
2018-12-21Improve removal of dead calls to allocator helpers.Eugene Rozenfeld8-21/+39
This change improves detection of allocators with side effects. Allocators can cause side effects if the allocated object may have a finalizer. This change adds a pHasSideEffects parameter to getNewHelper JitEE interface method. It's used by the jit to check for allocator side effects instead of guessing from helper ids. Fixes #21530.
2018-12-07Fix some SOS commands after SharedDomain removal (#21401)Jan Vorlicek2-26/+58
The recent removal of SharedDomain has broken some SOS commands, like Name2EE or bpmd. There was a code that was enumerating domains and obtaining some information on them. And the shared domain pointer from DacpAppDomainStoreData was being included in the list of domains. As it is NULL now, we have failed to get the information and the domain iteration loop was exited prematurely. I have made SOS resilient to the possibility of missing shared domain. On older runtimes, the shared domain is still being reported.
2018-12-07Fix SOS thread statics display (#21426)Jan Vorlicek1-23/+0
I've noticed that when dumping an object with thread locals using SOS dumpobj command, I never get the thread locals. I've stepped through the code in SOS that displays thread statics and found that for some strange reason, it dismisses threads where DomainLocalModule doesn't have "initialized" flag set for the given class. However, when runtime accesses thread statics, it just checks "allocated" flag set for the given class in the ThreadLocalModule. Removing the extra check for DomainLocalModule fixed the problem and now thread statics are displayed properly.
2018-12-03Merge pull request #21264 from fiigii/x64onlyCarol Eidt8-51/+88
Implement 64-bit-only hardware intrinsic
2018-12-03Remove IsNeutralDomain() (#21318)Steve MacLean1-72/+21
* Remove IsNeutralDomain() * PR feedback
2018-11-29Add SuperPMI code for the new getMethodNameFromMetadataFei Peng8-51/+88
2018-11-19format spmi sources (#21094)Sergey Andreenko6-28/+36
We do not do it automatically because we do not change it often.