DiagnosticClient is documented on our official docs site. Removing the
repo copy which is not receiving updates and would get out-of-sync.
Related to: https://github.com/dotnet/docs/pull/42771
Added eng\privatebuild.cmd and eng/privatebuild.sh and some build
changes that sets up for testing against a private build. Just the
latest 9.0.x runtimes are installed and tested against.
Added eng/testsos* as a short cut to running just the SOS tests.
Updated the doc on the end-to-end procedure.
Add "clrmaconfig" command to control clrma logging, direct DAC and
managed support.
Move SOSExtensions to separate cpp/h files.
Cleanup Extensions::FlushCheck. Needed to call in the clrma code.
INIT_API_EXT macro cleanup: added ExtInit function that does all command
entry init.
Change the no managed hosting fallback code (platform/*) to use the
IDebuggerServices instance instead of the global dbgeng variables
because it is always available/setup. This allows the CLRMA support to
work with no managed code.
This change supports collecting GCSettingsEvent for gc-collect profile.
The change will work for both dotnet-trace and dotnet-monitor.
Co-authored-by: Noah Falk <noahfalk@users.noreply.github.com>
This PR moves the main symstore assemblies, tests and dotnet-symbol tool
to the diagnostics repo. It doesn't move the NugetSymbolServer or the
SymClient test tool. Neither are necessary for symbol indexing and
downloading.
The docs/specs were not copied either. I really don't want two copies of
the indexing and download protocol specs.
There is a base line commit that is exactly what is currently in the
symstore repro and several other commits that fix all the coding
convention and analyzer changes required to live in the diagnostics
repo. The only real functional change in
dotnet-symbol/Microsoft.SymbolStore is that ConfigureAwait(false) was
added to all the awaits (I think the default without ConfigureAwait is
true).
Client-side of https://github.com/dotnet/runtime/pull/84077 and the
implementation of https://github.com/dotnet/diagnostics/issues/3696.
To simplify the interface I made `EventPipeSessionConfiguration` public
and introduced a new method in the DiagnosticsClient:
`Task<EventPipeSession>
StartEventPipeSessionAsync(EventPipeSessionConfiguration configuration,
CancellationToken token)`. This is the only method that supports
disabling the stackwalk so no additional overloads with a new bool
parameter and no synchronous counterpart. I believe it'd be easier to
use and maintain a single async method with the options rather than
creating more overloads or default parameters but I may not have all the
context here so please correct me if you think it's a bad idea.
To deal with the backward compatibility I only use `CollectTracingV3`
when necessary i.e. when `RequestStackwalk` option is set to false. I
think it's a good compromise between the added complexity and
potentially surprising behavior:
* when the client is old and the runtime is new everything works because
the runtime supports `CollectTracingV2`
* when the client is new but the runtime is old everything works until
the new option is used. When it's used the session won't start as
`CollectTracingV3` doesn't exist server side: there'd be no clear error
message but it's documented in the option summary.
* when both the client and the runtime are new either `CollectTracingV2`
or `CollectTracingV3` may be used transparently for the user
* we may use the same trick when we introduce `CollectTracingV4`
The alternative is to implement version negotiation of some sort but I'd
like to have your opinion before attempting this as handling the errors
correctly wouldn't be easy (f.e. in [my current
fork](3946b4a88b (diff-e8365039cd36eae3dec611784fc7076be7dadeda1007733412aaaa63f40a748fR39))
I just hide the exception)
The testing turned out to be a bit complex as I needed to convert
EventPipe stream to `TraceLog` to be able to read the stacktraces. I
couldn't achieve that without writing data to a file. Afaiu the
stackwalk may not work correctly without the rundown that only happens
at the end of the session so I wonder if looking at the stacktraces with
a live session is even possible (though iirc netfw+ETW could do that
back in the days) ?
Thanks for your time !
Retire duplicate documentation by redirecting to docs that will be updated.
fixes#515
---------
Co-authored-by: Noah Falk <noahfalk@users.noreply.github.com>
* Add AssemblyLoadContext for loading extensions
Add and use ServiceManager.NotifyExtensionLoadFailure event.
Replace Provider scope with ProviderExport attribute
Removing the DAC or DBI check in GetLocalPath() keeps invalid DACs or DBIs
from being loaded if in the current directory. The download path will find
a DAC in the same directory as the core dump when under dotnet-dump.
Update extensibility doc
* Update to 7.0.3 and 6.0.14
* Change the context service ordering to prevent creating runtimes if not needed
* Fix analyzer issues
* Fix overflow in WebApp tests
* Code review feedback
* Fix desktop SOS tests
Enforcement of style to be consistent with dotnet/runtime.
Enable more analyzers that are compliant with SDL requirements.
Misc bug fixes around sync contexts and async IO.
Use some utility methods available in .NET 6 when possible.
* Add service manager and reflection based service discovery
Add GetTargetId to native ITarget
Load service and command assemblies from directory.
Add LoadExtensions
Add IRuntimeProvider interface that allows IRuntime implementations to be added to the IRuntimeService.
Support multiple service instances for IRuntimeProvider. Added IServiceProvider.GetServices() extension method to get them.
Added the ContextService.ContextServiceProvider to deal with the context service's special needs.
Added the ServiceImportAttribute support. There are Utilities helper functions that process this attribute.
Add IHost.OnTargetCreate event. Removed IHost.DestroyTarget and add ITarget.Destroy. Allows the context and other services
to managed state when targets come, go and flush. Makes target destruction more explicit by the implementations.
Use the ServiceImportAttribute in commands. Add "Optional" ServiceImportAttribute flag.
Add IServiceProviderManager interface to abstract the ServiceProvider functions.
Add as a service the PEModule wrapper around PEReader, ElfModule around ElfFile and MachOModule around MachOFile.
Pass IServiceProvider to constructors instead of using ITarget.Services. This removes the recursion from the ImageMappingMemoryService and MetdataMappingMemoryService.
Update extensibility doc
Add starting runtime id to runtime providers
Add native type/field interfaces/impls
Add WriteLine() to CommandBase and console service extensions.
Fix module Version property.
Fix testasset xml generation and repackaging scripts
Update symstore version
Update test assets version
* Add switch by id to `runtimes` command
* Catch load exceptions
* Change to loading extensions from the tool/host install directory
* Code review feedback
* Undo some of the code review feedback
* Code review feedback
Removed weird this parameter from IServiceContainer.DisposeServices(). Use RemoveServices() to prevent recursion.
Removed IServiceContainer.GetCachedService extension method and call IServiceContainer.TryGetCachedService directly.
* More Code review feedback
* More code review feedback
* More code review changes
* Add provider registration support to service manager
Instead of supporting multiple instances of the same service type, this change allows
services to get "provider" factories registered up the Provider scope. This simplifies
the service container implementation.
Add EnumerateProviderFactories to IServiceManager.
* Allow ServiceImportAttribute on method and constructor parameters to control the Optional metadata flag.
* Code review feedback
* CR feedback: Better PEModule, ELFModule and MachOModule service implementation
The service container no longer exposes itself to services.
* CR feedback: cleanup service manager's global/context container support
* Refactor IServiceContainer to ServiceContainerFactory and ServiceContainer
Remove interface and put implementations in DebugServices.
* Code review feedback
* Code review
* Responding to input to create second draft
Opening pull request in my GitHub account, first draft is located as closed pull request in dotnet/diagnostics repo.
* update command line style, add potential header
* updating to use subcommands
Co-authored-by: John Salem <josalem@microsoft.com>
* Update to include subcommands
* clarify dotnet-trace report descriptions
* update to create consistency
Created consistency within the documentation and examples.
* Creating clarity with consistency
Created consistency between dotnet=trace collect's and report's parameter names.
* Update documentation/design-docs/dotnet-tools.md
Co-authored-by: Noah Falk <noahfalk@users.noreply.github.com>
Co-authored-by: John Salem <josalem@microsoft.com>
Co-authored-by: Noah Falk <noahfalk@users.noreply.github.com>
* Update 2.1 to 3.1 netcoreapp in diagnostic repo documentation
Completes #1640
* Update a few instances of 2.1 I missed in the first commit
* Remove .NET version specific info in README.md
Co-authored-by: Noah Falk <noahfalk@users.noreply.github.com>
Co-authored-by: Noah Falk <noahfalk@users.noreply.github.com>
Fix misc SOS bugs
* Fix bug in the AddFilesFromDirectoryToTpaList issue: https://github.com/dotnet/diagnostics/issues/2596
* Added some logging to GetLineByOffset
* Improve SymbolService.ParseSymbolPath support for Watson. Issue https://github.com/dotnet/diagnostics/issues/2512. Can
now handle the various symbol paths that Watson can throw at us. Doesn't support actually calling the symbol server
dll like in the symsrv*symaudit.dll*\\server\share syntax. The dll is ignored.
* Minor doc updates
* Better loadsymbols error message when no server is set
* Change default trace name to app name + timestamp
* Update in-repo docs
* PR feedback
* ordinalIgnoreCase compare
* only use filename instead of whole path
* update help text
* Fix deadlock when redirecting large amounts of child process output, and add ability to not redirect child process behavior
- Use a small set of tasks to consume and ignore arbitrary data passed through standard output/error
- Add a new switch to dotnet-trace called --redirect-child-output which can be set to false to allow viewing data. (By default the option defaults to true, which may be confusing. I'd like some feedback on that.
* Adjust dotnet-trace to add --show-child-output and improve exit code handling
* Add testing
* Update doc in repo
* Fix issues identified in testing
* Move logic which waited for process to exit to avoid premature Dispose operations
* Code review feedback
Misc interface and implementation changes
Add IExportSymbols and IModuleSymbols interfaces and implementation
Change IModule.IndexFileSize/IndexTimeStamp to uint?.
Renamed IRuntimeService.Runtimes to EnumerateRuntimes to be more consistent with the rest of the interfaces.
Add IHost.EnumerateTargets().