summaryrefslogtreecommitdiff
path: root/rts/eventlog
Commit message (Collapse)AuthorAgeFilesLines
* Add a new traceMarker# primop for use in profiling outputDuncan Coutts2012-10-152-0/+25
| | | | | | | | | In time-based profiling visualisations (e.g. heap profiles and ThreadScope) it would be useful to be able to mark particular points in the execution and have those points in time marked in the visualisation. The traceMarker# primop currently emits an event into the eventlog. In principle it could be extended to do something in the heap profiling too.
* Deprecate lnat, and use StgWord insteadSimon Marlow2012-09-072-20/+20
| | | | | | | | | | | | lnat was originally "long unsigned int" but we were using it when we wanted a 64-bit type on a 64-bit machine. This broke on Windows x64, where long == int == 32 bits. Using types of unspecified size is bad, but what we really wanted was a type with N bits on an N-bit machine. StgWord is exactly that. lnat was mentioned in some APIs that clients might be using (e.g. StackOverflowHook()), so we leave it defined but with a comment to say that it's deprecated.
* Define the task-tracking eventsDuncan Coutts2012-07-102-9/+101
| | | | | | | | | | | | | Based on initial patches by Mikolaj Konarski <mikolaj@well-typed.com> These new eventlog events are to let profiling tools keep track of all the OS threads that belong to an RTS capability at any moment in time. In the RTS, OS threads correspond to the Task abstraction, so that is what we track. There are events for tasks being created, migrated between capabilities and deleted. In particular the task creation event also records the kernel thread id which lets us match up the OS thread with data collected by others tools (in the initial use case with Linux's perf tool, but in principle also with DTrace).
* A couple of build fixes for Win64Ian Lynagh2012-04-241-1/+4
|
* Make the prototype for postHeapEvent match the definitionIan Lynagh2012-04-241-1/+1
| | | | I've assumed that the definition type is right.
* Add the GC_GLOBAL_SYNC event marking that all caps are stopped for GCMikolaj2012-04-041-0/+2
| | | | | | | | | Quoting design rationale by dcoutts: The event indicates that we're doing a stop-the-world GC and all other HECs should be between their GC_START and GC_END events at that moment. We don't want to use GC_STATS_GHC for that, because GC_STATS_GHC is for extra GHC-specific info, not something we have to rely on to be able to match the GC pauses across HECs to a particular global GC.
* Fix the timestamps in GC_START and GC_END events on the GC-initiating capMikolaj2012-04-042-1/+23
| | | | | | | | | | | There was a discrepancy between GC times reported in +RTS -s and the timestamps of GC_START and GC_END events on the cap, on which +RTS -s stats for the given GC are based. This is fixed by posting the events with exactly the same timestamp as generated for the stat calculation. The calls posting the events are moved too, so that the events are emitted close to the time instant they claim to be emitted at. The GC_STATS_GHC was moved, too, ensuring it's emitted before the moved GC_END on all caps, which simplifies tools code.
* Adjust the eventlog description header for the spark counter eventDuncan Coutts2012-04-041-0/+1
| | | | | | | The EventLogFormat.h described the spark counter fields in a different order to that which ghc emits (the GC'd and fizzled fields were reversed). At this stage it is easier to fix the ghc-events lib and to have ghc continue to emit them in the current order.
* Add new eventlog events for various heap and GC statisticsDuncan Coutts2012-04-042-0/+150
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | They cover much the same info as is available via the GHC.Stats module or via the '+RTS -s' textual output, but via the eventlog and with a better sampling frequency. We have three new generic heap info events and two very GHC-specific ones. (The hope is the general ones are usable by other implementations that use the same eventlog system, or indeed not so sensitive to changes in GHC itself.) The general ones are: * total heap mem allocated since prog start, on a per-HEC basis * current size of the heap (MBlocks reserved from OS for the heap) * current size of live data in the heap Currently these are all emitted by GHC at GC time (live data only at major GC). The GHC specific ones are: * an event giving various static heap paramaters: * number of generations (usually 2) * max size if any * nursary size * MBlock and block sizes * a event emitted on each GC containing: * GC generation (usually just 0,1) * total bytes copied * bytes lost to heap slop and fragmentation * the number of threads in the parallel GC (1 for serial) * the maximum number of bytes copied by any par GC thread * the total number of bytes copied by all par GC threads (these last three can be used to calculate an estimate of the work balance in parallel GCs)
* Add eventlog/trace stuff for capabilities: create/delete/enable/disableDuncan Coutts2012-04-042-9/+46
| | | | | | | | | | | | | | | | | | | | | | | Now that we can adjust the number of capabilities on the fly, we need this reflected in the eventlog. Previously the eventlog had a single startup event that declared a static number of capabilities. Obviously that's no good anymore. For compatability we're keeping the EVENT_STARTUP but adding new EVENT_CAP_CREATE/DELETE. The EVENT_CAP_DELETE is actually just the old EVENT_SHUTDOWN but renamed and extended (using the existing mechanism to extend eventlog events in a compatible way). So we now emit both EVENT_STARTUP and EVENT_CAP_CREATE. One day we will drop EVENT_STARTUP. Since reducing the number of capabilities at runtime does not really delete them, it just disables them, then we also have new events for disable/enable. The old EVENT_SHUTDOWN was in the scheduler class of events. The new EVENT_CAP_* events are in the unconditional class, along with the EVENT_CAPSET_* ones. Knowing when capabilities are created and deleted is crucial to making sense of eventlogs, you always want those events. In any case, they're extremely low volume.
* Allow the number of capabilities to be increased at runtime (#3729)Simon Marlow2011-12-062-6/+22
| | | | | At present the number of capabilities can only be *increased*, not decreased. The latter presents a few more challenges!
* Time handling overhaulSimon Marlow2011-11-251-1/+1
| | | | | | | | | | | | | | | | | | | | | Terminology cleanup: the type "Ticks" has been renamed "Time", which is an StgWord64 in units of TIME_RESOLUTION (currently nanoseconds). The terminology "tick" is now used consistently to mean the interval between timer signals. The ticker now always ticks in realtime (actually CLOCK_MONOTONIC if we have it). Before it used CPU time in the non-threaded RTS and realtime in the threaded RTS, but I've discovered that the CPU timer has terrible resolution (at least on Linux) and isn't much use for profiling. So now we always use realtime. This should also fix The default tick interval is now 10ms, except when profiling where we drop it to 1ms. This gives more accurate profiles without affecting runtime too much (<1%). Lots of cleanups - the resolution of Time is now in one place only (Rts.h) rather than having calculations that depend on the resolution scattered all over the RTS. I hope I found them all.
* Drop ".exe" exetention from eventlog file nameDuncan Coutts2011-11-221-3/+18
| | | | Fixes ticket #5472
* Add eventlog event for thread labelsDuncan Coutts2011-11-042-0/+40
| | | | | | The existing GHC.Conc.labelThread will now also emit the the thread label into the eventlog. Profiling tools like ThreadScope could then use the thread labels rather than thread numbers.
* Add new eventlog EVENT_WALL_CLOCK_TIME for time matchingDuncan Coutts2011-10-262-0/+54
| | | | | | | | | | | | | | Eventlog timestamps are elapsed times (in nanoseconds) relative to the process start. To be able to merge eventlogs from multiple processes we need to be able to align their timelines. If they share a clock domain (or a user judges that their clocks are sufficiently closely synchronised) then it is sufficient to know how the eventlog timestamps match up with the clock. The EVENT_WALL_CLOCK_TIME contains the clock time with (up to) nanosecond precision. It is otherwise an ordinary event and so contains the usual timestamp for the same moment in time. It therefore enables us to match up all the eventlog timestamps with clock time.
* Rename traceCapsetModify for consistency and clarityDuncan Coutts2011-10-262-11/+11
|
* Sync EventLogFormat.h with ghc-eventsDuncan Coutts2011-07-181-3/+3
|
* Add new fully-accurate per-spark trace/eventlog eventsDuncan Coutts2011-07-182-7/+68
| | | | | | | | | | | | | | Replaces the existing EVENT_RUN/STEAL_SPARK events with 7 new events covering all stages of the spark lifcycle: create, dud, overflow, run, steal, fizzle, gc The sampled spark events are still available. There are now two event classes for sparks, the sampled and the fully accurate. They can be enabled/disabled independently. By default +RTS -l includes the sampled but not full detail spark events. Use +RTS -lf-p to enable the detailed 'f' and disable the sampled 'p' spark. Includes work by Mikolaj <mikolaj.konarski@gmail.com>
* Move GC tracing into a separate trace classDuncan Coutts2011-07-181-5/+1
| | | | | | | Previously GC was included in the scheduler trace class. It can be enabled specifically with +RTS -vg or -lg, though note that both -v and -l on their own now default to a sensible set of trace classes, currently: scheduler, gc and sparks.
* Add spark counter tracingDuncan Coutts2011-07-182-1/+37
| | | | | | | A new eventlog event containing 7 spark counters/statistics: sparks created, dud, overflowed, converted, GC'd, fizzled and remaining. These are maintained and logged separately for each capability. We log them at startup, on each GC (minor and major) and on shutdown.
* Fix build on windows (hopefully)Duncan Coutts2011-05-291-1/+1
| | | | | A missing ';' that just happened to work fine on non-windows due to differing definitions of the ACQUIRE_LOCK macro.
* Emit various bits of OS process info into the eventlogDuncan Coutts2011-05-262-1/+100
| | | | | The process ID, parent process ID, rts name and version The program arguments and environment.
* Add capability sets to the tracing/events systemDuncan Coutts2011-05-262-1/+72
| | | | | | | We trace the creation and shutdown of capabilities. All the capabilities in the process are assigned to one capabilitiy set of OS-process type. This is a second version of the patch. Includes work by Spencer Janssen.
* Make the tracing of the startup event more regularDuncan Coutts2011-05-262-4/+18
| | | | Rather than doing it differently for the eventlog and Dtrace cases.
* Revert "Add capability sets to the event system. Contains code from Duncan ↵Duncan Coutts2011-05-232-177/+1
| | | | | | | | Coutts." This reverts commit 58532eb46041aec8d4cbb48b054cb5b001edb43c. Turns out it didn't work on Windows and it'll need some non-trivial changes to make it work on Windows. We'll get it in later once that's sorted out.
* Add capability sets to the event system. Contains code from Duncan Coutts.Spencer Janssen2011-05-182-1/+177
|
* Annotate thread stop events with the owner of the black holeSimon Marlow2011-01-272-7/+10
| | | | | | | | | So we can now get these in ThreadScope: 19487000: cap 1: stopping thread 6 (blocked on black hole owned by thread 4) Note: needs an update to ghc-events. Older ThreadScopes will just ignore the new information.
* allocate enough room for the longer filename (addendum to #4512)Simon Marlow2010-12-101-1/+3
|
* Fixes for #4512: EventLog.c - provides ability to terminate event logging, ↵Dmitry Astapov2010-12-032-4/+40
| | | | Schedule.c - uses them in forkProcess.
* Eventlog: Put correct size for startup eventscpmw@leeds.ac.uk2010-11-051-1/+4
|
* Fix the symbol visibility pragmasSimon Marlow2010-06-171-2/+2
|
* add missing initialisation for eventBufMutexSimon Marlow2010-05-141-0/+4
|
* Use message-passing to implement throwTo in the RTSSimon Marlow2010-03-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This replaces some complicated locking schemes with message-passing in the implementation of throwTo. The benefits are - previously it was impossible to guarantee that a throwTo from a thread running on one CPU to a thread running on another CPU would be noticed, and we had to rely on the GC to pick up these forgotten exceptions. This no longer happens. - the locking regime is simpler (though the code is about the same size) - threads can be unblocked from a blocked_exceptions queue without having to traverse the whole queue now. It's a rare case, but replaces an O(n) operation with an O(1). - generally we move in the direction of sharing less between Capabilities (aka HECs), which will become important with other changes we have planned. Also in this patch I replaced several STM-specific closure types with a generic MUT_PRIM closure type, which allowed a lot of code in the GC and other places to go away, hence the line-count reduction. The message-passing changes resulted in about a net zero line-count difference.
* Fix crash when using printf format specifiers in traceEvent (#3874)Simon Marlow2010-02-262-3/+3
|
* Expose all EventLog events as DTrace probesManuel M T Chakravarty2009-12-121-1/+0
| | | | | | | | | | | | | | - Defines a DTrace provider, called 'HaskellEvent', that provides a probe for every event of the eventlog framework. - In contrast to the original eventlog, the DTrace probes are available in all flavours of the runtime system (DTrace probes have virtually no overhead if not enabled); when -DTRACING is defined both the regular event log as well as DTrace probes can be used. - Currently, Mac OS X only. User-space DTrace probes are implemented differently on Mac OS X than in the original DTrace implementation. Nevertheless, it shouldn't be too hard to enable these probes on other platforms, too. - Documentation is at http://hackage.haskell.org/trac/ghc/wiki/DTrace
* Add events to show when GC threads are idle/workingSimon Marlow2009-10-152-1/+32
|
* Add a way to generate tracing events programmaticallySimon Marlow2009-09-252-5/+14
| | | | | | | | | | | | | | added: primop TraceEventOp "traceEvent#" GenPrimOp Addr# -> State# s -> State# s { Emits an event via the RTS tracing framework. The contents of the event is the zero-terminated byte string passed as the first argument. The event will be emitted either to the .eventlog file, or to stderr, depending on the runtime RTS flags. } and added the required RTS functionality to support it. Also a bit of refactoring in the RTS tracing code.
* typo in error messageSimon Marlow2009-09-161-1/+1
|
* Event tracing: put the capability in the block marker, omit it from the eventsSimon Marlow2009-09-151-44/+38
| | | | | | | | | | | | This makes events smaller and tracing quicker, and speeds up reading and sorting the trace file. HEADS UP: this changes the format of event log files. Corresponding changes to the ghc-events package are required (and will be pushed soon). Normally we would make backwards-compatible changes, but this changes the format of every event (to remove the capability) so I'm breaking the rules this time. This will be the only time we can do this, since the format becomes public in 6.12.1.
* Add event block markersSimon Marlow2009-09-132-71/+72
| | | | | These indicate the size and time span of a sequence of events in the event log, to make it easier to sort and navigate a large event log.
* Omit visibility pragmas on Windows (fixes warnings/validate failures)Simon Marlow2009-09-091-2/+2
|
* Unify event logging and debug tracing.Simon Marlow2009-08-292-86/+167
| | | | | | | | | | | | | | | | | | | - tracing facilities are now enabled with -DTRACING, and -DDEBUG additionally enables debug-tracing. -DEVENTLOG has been removed. - -debug now implies -eventlog - events can be printed to stderr instead of being sent to the binary .eventlog file by adding +RTS -v (which is implied by the +RTS -Dx options). - -Dx debug messages can be sent to the binary .eventlog file by adding +RTS -l. This should help debugging by reducing the impact of debug tracing on execution time. - Various debug messages that duplicated the information in events have been removed.
* Declare RTS-private prototypes with __attribute__((visibility("hidden")))Simon Marlow2009-08-051-0/+4
| | | | | | | | | | This has no effect with static libraries, but when the RTS is in a shared library it does two things: - it prevents the function from being exposed by the shared library - internal calls to the function can use the faster non-PLT calls, because the function cannot be overriden at link time.
* use C99-style array initialisersSimon Marlow2009-08-031-16/+16
|
* fix off-by-one in memory allocationSimon Marlow2009-08-041-2/+2
|
* RTS tidyup sweep, first phaseSimon Marlow2009-08-022-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The first phase of this tidyup is focussed on the header files, and in particular making sure we are exposinng publicly exactly what we need to, and no more. - Rts.h now includes everything that the RTS exposes publicly, rather than a random subset of it. - Most of the public header files have moved into subdirectories, and many of them have been renamed. But clients should not need to include any of the other headers directly, just #include the main public headers: Rts.h, HsFFI.h, RtsAPI.h. - All the headers needed for via-C compilation have moved into the stg subdirectory, which is self-contained. Most of the headers for the rest of the RTS APIs have moved into the rts subdirectory. - I left MachDeps.h where it is, because it is so widely used in Haskell code. - I left a deprecated stub for RtsFlags.h in place. The flag structures are now exposed by Rts.h. - Various internal APIs are no longer exposed by public header files. - Various bits of dead code and declarations have been removed - More gcc warnings are turned on, and the RTS code is more warning-clean. - More source files #include "PosixSource.h", and hence only use standard POSIX (1003.1c-1995) interfaces. There is a lot more tidying up still to do, this is just the first pass. I also intend to standardise the names for external RTS APIs (e.g use the rts_ prefix consistently), and declare the internal APIs as hidden for shared libraries.
* Add EVENT_CREATE_SPARK_THREAD to replace EVENT_SPARK_TO_THREADSimon Marlow2009-04-231-16/+12
| | | | Also some tidyups and renaming
* Removed unused function postEventTypeID.donnie@darthik.com2009-04-131-3/+0
| | | | | postEventTypeID was used to post event marker IDs, but instead we just call postWord16 directly; thus, this function is unused.
* Added new EventLog event: Spark to Thread.donnie@darthik.com2009-04-131-1/+14
|
* Changed postEvent last argument from "nat from" to "StgWord64 other".donnie@darthik.com2009-04-132-5/+5
| | | | | | | StgWord64 other better represents this argument since it can be used as any particular data, thus "other" and not the "from" capability as it was previously strictly used. Also, StgWord64 is normally larger than type nat to allow for larger data to be passed through the "other" argument.