Commit Graph
234 Commits
Author SHA1 Message Date
Tijoy Tom Kalathiparambil c1fb207fba Add missing WebHeaderCollection Keys property
Commit migrated from https://github.com/dotnet/corefx/commit/362116bf98e506f33ad81325d013076545db2c87
2016-11-03 15:39:40 -07:00
Stephen Toub 7b2a531875 Add additional System.Net tracing tests
- Add tests that actually exercise the event sources, making sure that no event source errors are produced and that events are actually generated.
- Fix a few src issues found from these tests.


Commit migrated from https://github.com/dotnet/corefx/commit/2284f735df7ad8c072b7861980d205c4476709b8
2016-10-29 11:53:54 -04: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
Tijoy Tom Kalathiparambil 97b7dfee3d Fixes https://github.com/dotnet/corefx/issues/12139
Make WebHeaderCollection derive from NameValueCollection and
implement ISerlizable interface.Instead of copying the whole
file from FX , this change adapt the current implemention
to add the required methods.

Adding more values to WebHeaderCollectionType
Adding logging


Commit migrated from https://github.com/dotnet/corefx/commit/d92bbeeb89c037bb269bbc73d63e7cb875b85eb7
2016-10-27 19:25:59 -07:00
Stephen Toub 25d2794313 Add System.Net.WebHeaderCollection serialization
Commit migrated from https://github.com/dotnet/corefx/commit/b3e846da3816ea8799efa8182e11f0860b2a2411
2016-10-22 06:27:55 -04:00
Eric St. John 922ed26679 Make System.Net.WebHeaderCollection target ns1.7
Commit migrated from https://github.com/dotnet/corefx/commit/6ee8e383c853bf80fcfb05e448142bd1529af371
2016-10-20 14:28:17 -07:00
Karthik Rajasekaran 9255a2e649 Combine test dependencies into a common project.json.
Restore this common project.json upfront to improve sync time and avoid download contention from nuget.


Commit migrated from https://github.com/dotnet/corefx/commit/654f5548f946659c694d110a4bbce8aa33f1a7a1
2016-10-18 11:39:53 -07:00
dotnet-bot 94f229c6a7 Update CoreClr, CoreFx to beta-24617-03, beta-24617-03, respectively
Commit migrated from https://github.com/dotnet/corefx/commit/4c6df2edbad3b5d8ec3914c0366f80ebb73f7c12
2016-10-18 08:43:24 -04:00
dotnet-bot 7b31a1e04a Update CoreClr, CoreFx, External to beta-24615-02, beta-24615-03, beta-24614-00, respectively
Commit migrated from https://github.com/dotnet/corefx/commit/025cec5bf1e82980a77e473f2e5d599ffd60af49
2016-10-15 08:33:01 +00:00
dotnet-bot 511149ab83 Update CoreClr, CoreFx, External to beta-24613-02, beta-24613-01, beta-24613-00, respectively
Commit migrated from https://github.com/dotnet/corefx/commit/8f355c66ac9adbf9f36cfdd019ba1d2cefb54001
2016-10-13 08:37:30 +00:00
dotnet-bot 4a517b60c6 Update CoreClr, CoreFx to beta-24612-03, beta-24612-03, respectively
Commit migrated from https://github.com/dotnet/corefx/commit/f01cf91423391f80ad5269340eb8e602ea9cb087
2016-10-12 16:28:54 +00:00
Stephen Toub f54cfb8704 Update CoreClr, CoreFx to beta-24611-01, beta-24611-02 respectively (master)
Commit migrated from https://github.com/dotnet/corefx/commit/b7cc4e219207cff50cdbb11176d3cee25be724f0
2016-10-11 15:32:17 -04:00
Stephen Toub 320ec958ba Update CoreClr, CoreFx to beta-24608-02, beta-24608-01, respectively (master)
Commit migrated from https://github.com/dotnet/corefx/commit/0fe592ec0a6be3cb49ecf37a798ca482b0d261dc
2016-10-08 08:25:01 -04:00
Sedar Gokbulut fb95e1e002 Revert "Merge branch 'dotnet-bot-master-UpdateDependencies'"
This reverts commit dotnet/corefx@631f21b4c2, reversing
changes made to dotnet/corefx@374a387de0.


Commit migrated from https://github.com/dotnet/corefx/commit/30cd016952f1f806986f2918fc7c1ebdb570aefd
2016-10-07 16:10:51 -07:00
dotnet-bot d7384b3382 Update CoreClr, CoreFx, ProjectNTfs to beta-24607-02, beta-24607-03, beta-24607-00, respectively
Commit migrated from https://github.com/dotnet/corefx/commit/6f081ec97720eb7efd2653b91f88cda45cb43431
2016-10-07 15:48:04 -04:00
Jose Perez Rodriguez c37abd4f53 Reorder test.builds files metadata to be consisteng across the repo
Commit migrated from https://github.com/dotnet/corefx/commit/8cbdf88e1b122babd37575587692448ed59e7f58
2016-10-05 14:58:03 -07:00
Alex Perovich 674bb7a0f8 Update project ToolsVersions to 14.0 (dotnet/corefx#12355)
Commit migrated from https://github.com/dotnet/corefx/commit/71de1aac5cf3e5dc87714ae0cc829e1fa98f7c5d
2016-10-05 12:50:37 -07:00
dotnet-bot ddcb0ebc64 Update CoreClr, CoreFx, ProjectNTfs to beta-24605-01, beta-24604-02, beta-24604-00, respectively
Commit migrated from https://github.com/dotnet/corefx/commit/193d21d6f4d181b086a52d17716499a3170785d0
2016-10-05 07:52:47 -04:00
dotnet-bot 018cb6969b Update CoreClr, CoreFx to beta-24602-02, beta-24601-02, respectively
Commit migrated from https://github.com/dotnet/corefx/commit/3274ef94654da6754aaa54427d289e51ec316ea9
2016-10-02 08:24:45 +00:00
Wes Haggard bd13e2e340 Update xunit.netcore.extensions package
This allows us to start using TestPlatforms added with
https://github.com/dotnet/buildtools/pull/1000


Commit migrated from https://github.com/dotnet/corefx/commit/64a737e43afb7954d0105da8f360a1669ebe2a2d
2016-10-01 10:55:35 -07:00
dotnet-bot 027f6103a8 Update CoreClr, CoreFx to beta-24601-01, beta-24530-03, respectively
Commit migrated from https://github.com/dotnet/corefx/commit/d37f83fb58b99eef950787f191744f503ee50067
2016-09-30 22:46:05 -04:00
dotnet-bot 7b4f9fc0c4 Update CoreClr, CoreFx to beta-24530-04, beta-24530-02, respectively
Commit migrated from https://github.com/dotnet/corefx/commit/76746a58dabb98d6df8d5404b9fe00c66404a427
2016-09-30 19:24:02 +00:00
dotnet-bot bce2d80e22 Update CoreClr, CoreFx, External, ProjectNTfs to beta-24529-03, beta-24530-01, beta-24523-00, beta-24530-00, respectively
Commit migrated from https://github.com/dotnet/corefx/commit/0b6b3faaaa9877872721f52469dc48016496ed82
2016-09-30 12:35:55 -04:00
dotnet-bot c2d82aba38 Update CoreClr, CoreFx, External, ProjectNTfs to beta-24522-04, beta-24522-03, beta-24522-00, beta-24522-01, respectively
Commit migrated from https://github.com/dotnet/corefx/commit/894cc88238f0bd57ad49b59cfb5f5e6581993742
2016-09-22 14:41:33 -07:00
dotnet-bot 96edb1b541 Update CoreClr, CoreFx, External, ProjectNTfs to beta-24522-01, beta-24521-07, beta-24521-00, beta-24521-00, respectively
Commit migrated from https://github.com/dotnet/corefx/commit/fe6144b2d3726b68f824db46047b9ddfa7516ea4
2016-09-22 11:55:56 -07:00
dotnet-bot 4d9c1ffa86 Update CoreClr, CoreFx, External, ProjectNTfs to beta-24520-03, beta-24520-06, beta-24520-00, beta-24520-00, respectively
Commit migrated from https://github.com/dotnet/corefx/commit/21ad171bdf873f7be8f0756ea7a572e6c9595eb9
2016-09-20 15:08:50 -07:00
dotnet-bot 23d6e4713d Update CoreClr, CoreFx to beta-24518-02, beta-24516-03, respectively
Commit migrated from https://github.com/dotnet/corefx/commit/dfa190bcbb19492f0584298671ae27171d0e460c
2016-09-18 08:19:04 +00:00
Jose Perez Rodriguez e9c5a6629e Using master packages instead of dev/api
Commit migrated from https://github.com/dotnet/corefx/commit/517f1bf92c00acf7b0a71318255bb1d4504264d4
2016-09-16 11:17:32 -07:00
dotnet-bot f7a9e6db49 Update CoreClr, CoreFx, External, ProjectNTfs to beta-24516-01, beta-devapi-24515-01, beta-24514-00, beta-24516-00, respectively
Commit migrated from https://github.com/dotnet/corefx/commit/a51ffdcc41142c8928da0ce9d05ec586476cc227
2016-09-16 11:16:36 -07:00
Jose Perez Rodriguez bf0da1a921 Required changes to get the build green again after merge from dev/api
Commit migrated from https://github.com/dotnet/corefx/commit/ed8347041878054db7707d54201779ccba967782
2016-09-13 11:21:48 -07:00
dotnet-bot dedd766eff Update CoreClr, CoreFx, ProjectNTfs to beta-24512-02, beta-devapi-24512-01, beta-24512-00, respectively
Commit migrated from https://github.com/dotnet/corefx/commit/141f99a8e273e4288ca3d827aa10d00e64cb5bcc
2016-09-12 08:23:26 +00:00
dotnet-bot 18b78b4c1f Update CoreClr, CoreFx to beta-24511-02, beta-devapi-24511-01, respectively
Commit migrated from https://github.com/dotnet/corefx/commit/ae7f1882d122ae773eaf5e0d507fe2df2139a0bf
2016-09-11 08:12:24 +00:00
dotnet-bot d6ed58d1f6 Update CoreClr, CoreFx, External to beta-24510-02, beta-devapi-24510-01, beta-24509-00, respectively
Commit migrated from https://github.com/dotnet/corefx/commit/2177e4aa7dd0d6099e849398cc75ddab5401d3f9
2016-09-10 08:20:00 +00:00
dotnet-bot b4d3b58080 Update CoreClr, CoreFx, ProjectNTfs to beta-24509-03, beta-devapi-24509-01, beta-24509-00, respectively
Commit migrated from https://github.com/dotnet/corefx/commit/b0752ce47fb6a5935827c89cfa0928b3934d2f37
2016-09-09 08:12:40 +00:00
dotnet-bot 8d8fb53a8f Update CoreClr, CoreFx, External, ProjectNTfs to beta-24508-02, beta-devapi-24508-03, beta-24507-00, beta-24508-00, respectively
Commit migrated from https://github.com/dotnet/corefx/commit/ba1dbe35b8c7b6ff7a9d8a607ae465a48c889d97
2016-09-08 08:22:27 +00:00
dotnet-bot cec9baaf99 Update CoreClr, CoreFx to beta-24503-02, beta-devapi-24503-01, respectively
Commit migrated from https://github.com/dotnet/corefx/commit/062c5a22cef03332558c4726078615061a88d7b6
2016-09-03 09:30:27 +00:00
dotnet-bot a37985e165 Update CoreClr, CoreFx, External, ProjectNTfs to beta-24502-03, beta-devapi-24502-02, beta-24502-00, beta-24502-00, respectively
Commit migrated from https://github.com/dotnet/corefx/commit/3c724e11c6d1c94ed8d22b510e23333471a9a50c
2016-09-02 19:42:48 +00:00
Jose Perez Rodriguez 1e6d178df5 Changes required to have dev/api building again after merge
Commit migrated from https://github.com/dotnet/corefx/commit/bf7911a1ba3cfdf389527276d7991312dbd2b8c9
2016-09-01 16:47:55 -07:00
dotnet-bot 05cdb1c739 Update CoreClr, CoreFx, External to beta-24425-04, beta-devapi-24424-01, beta-24424-00, respectively
Commit migrated from https://github.com/dotnet/corefx/commit/c4a64f09e5f959e5e4df8e43117593cc638b1e23
2016-08-25 18:29:39 +00:00
Stephen Toub 46bee4ed23 Update dev/api corefx packages to 24422-01
Commit migrated from https://github.com/dotnet/corefx/commit/9a56ea0f3fc583cb50e174c269ff806702f59d2f
2016-08-22 09:48:02 -04:00
Stephen Toub e6c04e117f Update dev/api corefx dependencies to 24421-01
Commit migrated from https://github.com/dotnet/corefx/commit/069806fcaf2ba7a74795584f7769a0a818892b06
2016-08-21 07:38:01 -04:00
Stephen Toub e092967612 Update dev/api corefx dependencies to 24420-01
Commit migrated from https://github.com/dotnet/corefx/commit/8dc0eb899de2ed4a69682b1ca1ba62ba7595e746
2016-08-20 07:28:26 -04:00
Stephen Toub bf361cd27f Update dev/api dependencies, coreclr to 24419-04, corefx to 24419-01
Commit migrated from https://github.com/dotnet/corefx/commit/edbf01bd6d52f1ae40dd26aacf09a5831a2ada9a
2016-08-19 17:00:06 -04:00
Stephen Toub 06046efb31 Update devapi package versions
Commit migrated from https://github.com/dotnet/corefx/commit/4a30f6b2d34826fe1e0d1973d1104a2804f36ddd
2016-08-18 08:18:20 -04:00
Jose Perez Rodriguez 729079fd49 Updating CoreFx dependencies to beta-devapi-24416-01
Commit migrated from https://github.com/dotnet/corefx/commit/e8521f9b3a9fc1a8239a432f781edb274a44bdf5
2016-08-17 16:37:46 -07:00
Jose Perez Rodriguez 240a2669cd Required changes post-merge to get a succesfull build in dev/api
Commit migrated from https://github.com/dotnet/corefx/commit/f03238e592e63ca00a01f6fb36d2ba6d126857fe
2016-08-17 10:30:47 -07:00
dotnet-bot 39ae5fc430 Update CoreClr, CoreFx to beta-24416-04, beta-24416-03, respectively
Commit migrated from https://github.com/dotnet/corefx/commit/727593b9fae753fd12a0f53ecedcc9b7db2d9a78
2016-08-16 16:39:56 +00:00
dotnet-bot ae71404cf2 Update CoreClr, CoreFx to beta-24416-03, beta-24416-02, respectively
Commit migrated from https://github.com/dotnet/corefx/commit/9da7e25b03c3fa6cc8135a445fb1470292695780
2016-08-16 08:35:17 +00:00
dotnet-bot 5b24eda3e2 Update CoreClr, CoreFx to beta-24415-03, beta-24415-01, respectively
Commit migrated from https://github.com/dotnet/corefx/commit/2ffeaf70ba986937f7db938dda0ac349a9c8742a
2016-08-15 16:37:43 +00:00
dotnet bot e27d1f0f86 Update CoreClr, CoreFx to beta-24413-03, beta-24413-01, respectively (dotnet/corefx#10753)
Commit migrated from https://github.com/dotnet/corefx/commit/49e569b01a307c2af2d0f2d598fcacd4805699d4
2016-08-13 11:29:26 -07:00