Commit Graph
12 Commits
Author SHA1 Message Date
Eric Mellino 21dec6ff26 Clarify lldb and libsosplugin requirements for core debugging
Commit migrated from https://github.com/dotnet/corefx/commit/e06d60e9fb11f68ead62338fd9dc6ee2210d3375
2017-04-28 11:14:23 -07:00
Eric Mellino 26ecaf5e49 Add a missing word.
Commit migrated from https://github.com/dotnet/corefx/commit/70186262dcd2cea4944b5d5768d67d156bda61dc
2017-04-27 19:50:23 -07:00
Eric Mellino 7cb373059a Add core dump debugging instructions
Commit migrated from https://github.com/dotnet/corefx/commit/c14185223acc62525b0af0887ebc4d3d4ecfeac7
2017-04-27 17:14:44 -07:00
Alex Perovich 8cda321ac1 Add linux debugging instructions (dotnet/corefx#13867)
* Add linux debugging instructions

* s/linux/unix


Commit migrated from https://github.com/dotnet/corefx/commit/4bf98d1729b503430e7cb8ac87c68872a970efb5
2016-11-21 15:39:22 -08:00
Cristian Pop cfe1d001d8 Adding new build/packaging documentation (dotnet/corefx#13026)
* Adding new APIs not part of NetStandard
* Adding package debugging.

Commit migrated from https://github.com/dotnet/corefx/commit/9df69fa5d8333991d9c62a47f0009fed8f1ae0b8
2016-11-09 08:06:52 -08:00
Stephen Toub 78652d624e Overhaul System.Net library logging
This PR overhauls how logging is accomplished in the System.Net libraries.

There are a few problems with the existing solution:
1. In the original sources, logging was split across a GlobalLog class and a Logging class.  Global-related tracing went to GlobalLog, and library-specific tracing went to Logging.  When the sources were moved to corefx, this evolved into multiple EventSource-based types, most of which were in Common and were then src-included into each System.Net assembly.  This has a significant problem, though, which is that the name/Guid identity of an EventSource can only exist once in a process, and subsequent EventSource instances with the same identity fail.  This means that whichever assembly ends up logging something first wins, and all other tracing from other System.Net assemblies ends up being lost.
2. The split also may have made sense when all components shared the same GlobalLog, but now that GlobalLog is included as a unique EventSource instance in each assembly, it's no longer global.  This means that we're not only loading multiple EventSources unnecessarily (each has its own costs), but we're also duplicating logging, as some logging is done to one or the other, but some logging is done to both.
3. Due to sharing the Logging class, which evolved into an EventSource-based type, many logging calls had to include which component they came from as an enum value, leading to bloating at the call sites.
4. Additionally, many logging operations included the name of the method in which the calling was being done, which meant both longer call sites as well as stale values as members got renamed over time.
5. Call sites ended up getting fairly long due to lots of string concatenation operations and other manipulations in the logging call.  This also then led to most call sites needing to be guarded behind checks for IsEnabled, leading to lots of code at every call site and obscuring the actual information being traced.
6. An additional requirement that got added with the move to corefx was that certain failure conditions should both Debug.Fail and do tracing, leading to some tracing operations taking upwards of 10 lines of code.

All of these issues are addressed by this PR.

- Each System.Net assembly that needs to log now loads a single NetEventSource type for doing logging, each with its own identity.
- That implementation is split across a common, partial NetEventSource.Common.cs file used by all such assemblies, and then a per-assembly partial NetEventSource.AssemblyName.cs file used by the individual assembly.  The former file contains most of the logging implementation.  The latter files typically contain just the partial class declaration along with the [EventSource] attribute that gives that assembly's NetEventSource its unique identity / name.
- The logging operations in NetEventSource.Common.cs use a variety of relatively-recent language enhancements to improve the logging.  Each operation uses a [CallerMemberName] so that the call sites don't need to specify the caller.  FormattableString is used so that call sites can use string interpolation while still providing the logging implementation the flexibility to format the individual components in a desired fashion (e.g. IntPtrs are formatted as hex, SafeHandles are rendered in a way that includes their name+hashcode+handle, etc.), along with a mechanism that allows individual libraries to add additional formatting rules.  Each operation allows the this reference (or another this-like context object) to be passed in, to simply identify the source of the call (in concert with the caller member name).  A debug-only mechanism is included in the tracing to help find potential perf issues due to misuse of the logger.  Etc.
- A Fail logging operation is included that both traces and does a Debug.Fail.

With these changes, most call sites are greatly simplified.  Some examples:
Before:
```C#
if (GlobalLog.IsEnabled)
{
    GlobalLog.AssertFormat("ContextAwareResult#{0}::ContextCopy|Called on completed result.", LoggingHash.HashString(this));
}
Debug.Fail("ContextAwareResult#" + LoggingHash.HashString(this) + "::ContextCopy |Called on completed result.");
```
After:
```C#
NetEventSource.Fail(this, "Called on completed result.");
```

Before:
```C#
if (NetEventSource.Log.IsEnabled()) NetEventSource.Enter(NetEventSource.ComponentType.Http, this, ".ctor", handler);
```
After:
```C#
NetEventSource.Enter(this, handler);
```

Etc.

In addition to fixing up all of the event sources, I of course also fixed up all usage in order to clean up the call sites.  However, this was a rather mechanical change: I did not remove existing logging (other than duplication) nor did I add new logging.  At some point, we should review the actual logging being done to determine what's missing and what's not needed.  I also did not revise the additional existing events on the sockets and security event sources, but we may want to remove those (or some of those) in favor of just using the shared events.


Commit migrated from https://github.com/dotnet/corefx/commit/92fd5c0814bcc0c03acfa9f3ad857661828b35a6
2016-10-29 10:01:53 -04:00
Cristian Pop 72ad1653c3 Update windows-instructions.md
The debugging extension is now copied in the test folder.

Commit migrated from https://github.com/dotnet/corefx/commit/7fefc299f58813447bf4d621eb2468c085873ead
2016-06-13 16:01:16 -07:00
Cristian Pop ba00fce5af Merge pull request dotnet/corefx#9010 from CIPop/doc
Adding image example for PerfView collection.

Commit migrated from https://github.com/dotnet/corefx/commit/5c85e22115f2b6361af786fd492ea236a2cec3cf
2016-05-31 17:42:59 -07:00
Cristian Pop 7f4c4f31c2 Adding image example for PerfView collection.
Commit migrated from https://github.com/dotnet/corefx/commit/4d8e48407275040ae9e38c14883da2757cd6f07f
2016-05-31 17:05:53 -07:00
Eric St. John 5a444416fd Update tests to use NETCoreApp1.0 moniker
Requires https://github.com/dotnet/buildtools/pull/751

This makes all the tests resolve using NETCoreApp1.0 instead of
DNXCore50.  I've removed the netstandard1.6 import since that is no
longer needed.  I've also removed the workarounds from tests that were
targeting netcoreapp1.0 on their own.  For restore compat I've added an
DNXCore50 import to every test project.  These can be removed once
test-runtime packages are updated to target NETCoreApp1.0.

I've updated all the test scripts which were assuming DNXCore50 as well
as docs which referred to this path.


Commit migrated from https://github.com/dotnet/corefx/commit/7ba4d296e3e0a2445ffa708c1e918d90d2bac69c
2016-05-24 21:49:17 -07:00
Cristian Pop 7b6bded174 Adding logman instructions and System.Net new providers.
Commit migrated from https://github.com/dotnet/corefx/commit/1a2ffc42ee6dd364396af8e4762587853cbc80c9
2016-01-20 10:05:23 -08:00
Cristian Pop 04058dc524 Windows advanced debugging documentation.
Commit migrated from https://github.com/dotnet/corefx/commit/9dda8dfef549658ec53bda7e0aebdbfb5494de2c
2015-11-02 16:13:13 -08:00