summaryrefslogtreecommitdiff
path: root/src/vm/eventpipebuffer.cpp
AgeCommit message (Collapse)AuthorFilesLines
2019-06-21Add EventPipe Processor Number support and make NetTrace the default … ↵Noah Falk1-0/+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-14Moving non-EventPipe types out of eventpipe.* (#25161)José Rivero1-1/+2
* Replace runtime check with compile time assert. * Move EventPipeEventPayload to its own file. * Move `StackContents` to its own file. * Move other classes declaration/definition out of eventpipe.*
2019-06-10Add support for the NetTrace EventPipe file formatnoahfalk1-55/+62
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-05-28Create the Concept of Multiple EventPipe Sessions (#24417)José Rivero1-43/+28
This is the initial work to enable https://github.com/dotnet/coreclr/issues/15377 ## What's here? - A lot of code move/split. Some important moves: - `EventPipe` has a colection of `EventPipeSessions` instead of a single session. - `EventPipeSession` now owns a `EventPipeBufferManager` and a `EventPipeFile` - `EventPipeThread` now owns a collection of { EventPipeBufferManager, EventPipeBuffer }, and a collection of { EventPipeBufferManager, EventPipeBufferList } - There is a cap on the max number of `EventPipeSession` (64 sessions) - `EventPipeProvider` and `EventPipeEvent` use a 64-bit mask to keep track of the sessions that are listening to provider/events. ## What's pending? https://github.com/dotnet/coreclr/issues/24753
2019-05-17Allow the write when the buffer can fit the event exactlyAndrew Au1-1/+1
2019-05-01Simplifying Pop() logicAndrew Au1-5/+1
2019-05-01Pulling in Noah's fix in event_pipe_lock_fix branchSung Yoon Whang1-8/+36
2019-03-27Eliminate EventPipeBuffer::Close()Andrew Au1-16/+0
2019-03-13Fix issue 23151 (Cleanup TODO introduced by PR #23148)Andrew Au1-2/+10
2019-03-09Avoid StackWalk in EventPipeEventInstance constructorAndrew Au1-0/+1
2019-03-05Fix issue 23040Andrew Au1-3/+11
2019-03-05Fix issue 23037Andrew Au1-4/+3
2019-02-09Move eventpipe buffer to TLS (#21817)Sung Yoon Whang1-4/+5
* start ripping out eventpipe buffer to tls * can now emit events from gc threads * cleanup * more cleanup * more cleanup * tested on linux * Addressing PR comments * Move things around a bit to build in Linux * change eventpipe buffer deallocation code * more cleanup * this while loop doesnt do anything now * Fix build * fixing build * More cleanup * more pr comments * Fix unix build * more pr comments * trying to add a message to assertion that seems to be causing CIs to fail * more pr feedback * handle non-2-byte aligned string payloads inside payload buffers * some more cleanup * Fix off by one error in null index calculation * Make Get/SetThreadEventBufferList a static member of ThreadEventBufferList * make only the methods public in ThreadEventBufferList * Addressing noah's comments * fix comment and last off by 1 error
2018-08-10Align the Contents of EventPipeBuffers (#19375)Brian Robbins1-9/+11
2018-02-05fix the Incorrect EventPipe Assert, fixes #16158Adam Sitnik1-1/+1
2018-02-02Event Pipe File V3 (#16107)Adam Sitnik1-5/+5
* write missing information to the event pipe file (pointer size to make it work fo x86) * define where the events start, not only where they end * include process Id in the event pipe file, bump the version so old consumers get clear error message * write the missing EndObject tag to close the header * include expected CPU sampling rate in the event pipe header file * include keywords in V3 of EventPipe metadata, fixes #11934 * remove forward references * entry object comes after the header and ends after it's data, before the event block objects * introduce event block * fix the GC contracts * generate metadata ids * end the file with null reference tag * getting it work * 4 byte alignment of serialized event data * Revert "include keywords in V3 of EventPipe metadata, fixes #11934" This reverts commit 98ef2f588e271f928fd051e96da526dc1e0f017c. * remove event Id and event version from metadata buffer (it was duplicated with native code) * increase the block size to be the same as buffer size * Write the last event block to the file after disabling the event pipe, right after last events * include the sife in itself * the native part was supposed to not duplicate the event id and version, not manged * ensure 4 byte alignment * build metadata when it's not provided, so payload is never empty (no need to serialize length) * this todo is no longer valid * don't align everything, just the content of event block as suggested by @vancem * improvements after code review * update TraceEvent dependency, make the test verify new feature * InterlockedIncrement(Int32) is not available for non-Windows OSes * code improvements after Skype code review from @jorive
2018-01-29EventPipe: Don't Generate and Emit Stacks on Rundown (#16083)Brian Robbins1-1/+2
2018-01-02Retry: Enable EventPipe across Unix and Windows (#15611)Victor "Nate" Graf1-3/+3
* Revert "Revert "Enable EventPipe across Unix and Windows (#14772)" (#15609)" This reverts commit 302005ca8ae14eade37ddf4ac6e900617c1c166a. * Fix ARM build break * Use more explicit references to resolve build failures * Fix compat with python3 * Disable FeaturePerfTracing on Windows as it is not ready * Disable test for incomplete functionality * Fix test diabled patterns * Add license header * Use keyword types for managed code * Add message prefix * More precisly condition generation of eventing sources * Remove erroneously added changes
2017-12-21Revert "Enable EventPipe across Unix and Windows (#14772)" (#15609)Victor "Nate" Graf1-3/+3
This reverts commit 7524d72d4f0f634fe5407280b83c25181dc8c556.
2017-12-20Enable EventPipe across Unix and Windows (#14772)Victor "Nate" Graf1-3/+3
* [squashed] most work complete to enable EventPipe on Windows * Eventpipe now builds on Windows * Ensure evevntpipe is intialized on Windows * Resolve the location of python from build.cmd * Ensure eventing files are generated when needed * moving linkage declaration to cmake * create new event from constructor * enable FEATURE_EVENT_TRACE and FEATURE_PERF_TRACE everywhere * [WIP] checkpoint in fixing contarct errors * add another possible python location * Fix double delete bug in EventPipeConfiguration destructor * Fix typo in function name * Revert changes to .gitgnore * bump to netstandard1.6 in preperation for new version of TraceEvent * Revert changes to groovy files * revert changes to perf-prep scripts * add common.h and use nothrow * Fix issue which was causing double delete of configprovider * Add new test utilizing TraceEvent * Remove accidentally added local directory reference * Add comment to explain the addition of misc/tracepointprovider.cpp * Add back sys.exit(0) and refactor * Change conditional to be more direct * Better handle NULL config * Initialize m_deleteDefered * Eliminate obsolete field * Fix spelling error * Fix nits * Make smaple progiler timing functions easier to read * Move projects back to netstandard1.4 * Incomplete improvements to EventPipeTrace test * Add event integrity checks to test * Clean up some left over code * Add EventSource based test * Remove unused PAL tests on Windows * Fix Linux build breaks * Minor changes to CMake files * Remove //HACK for hack that was previously removed * Fix formatting and negate a #ifdef * Add conditional to ensure PERFTRACING is not enabled without EVENT_TRACE * Take lock on EventPipeProvider and EventPipeConfiguration destruction * Load winmm.dll at runtime * Change function name and compile conditions * Move typedef into #ifndef * Use the correct config in setup * Change lifecycle managment of EventPipeConfiguration's configuration provider * Enable EventPipe tests pri0 and disable broken tests * Replace python3 only error with python2 compatable one * Make common.csproj build pri0 * Change TraceEvent version to 2.0.2 to match published verison * Address cross build failure * Remove use of undefined variable * Add crossgen fix to .cmd * Use more specific types to avoid marshalling errors * Use Assert-style statements and remove one check * Fix cross arch build * Fix flipped branch * Bring build.cmd changes to build.sh * Fix cmake writing * Revert "Bring build.cmd changes to build.sh" This reverts commit 893c6492548d8bc9859ebba5b1b810aa630fac63. * remove stdlib.h * Fix out of order null check
2017-08-24Remove unnecessary buffer copy from EventPipe::WriteEvent pipeline (#13347)Victor "Nate" Graf1-5/+6
* [WIP] Eliminate extra buffer copy with new api path * Copy blobs to a flat buffer is Rundown is on * Refactor to use payload class and dedupe code * Add contracts * Fix many small errors * Make names unambiguous * Add EventPipe::WriteEventBlob to ecalllist.h * Address code review * Add test and fix a buffer copy bug * Copy data instead of data pointer * Add optional output file arg to tests * Change failure return code * Renamed variables for clarity
2017-05-25Implement Activity ID / Related Activity ID for EventSources Writing to ↵Brian Robbins1-2/+4
EventPipe (#11904) * Implement thread-local storage of activity ids. * Plumb the activity id and related activity id into the trace file.
2017-05-23Return early if EventPipeBuffer is empty. (#11855)Brian Robbins1-0/+4
2017-05-12EventPipe Circular Buffer Support and Ability to Start/Stop Tracing (#11507)Brian Robbins1-0/+275