summaryrefslogtreecommitdiff
path: root/rts/Hpc.c
Commit message (Collapse)AuthorAgeFilesLines
* Change the way module initialisation is done (#3252, #4417)Simon Marlow2011-04-121-90/+128
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously the code generator generated small code fragments labelled with __stginit_M for each module M, and these performed whatever initialisation was necessary for that module and recursively invoked the initialisation functions for imported modules. This appraoch had drawbacks: - FFI users had to call hs_add_root() to ensure the correct initialisation routines were called. This is a non-standard, and ugly, API. - unless we were using -split-objs, the __stginit dependencies would entail linking the whole transitive closure of modules imported, whether they were actually used or not. In an extreme case (#4387, #4417), a module from GHC might be imported for use in Template Haskell or an annotation, and that would force the whole of GHC to be needlessly linked into the final executable. So now instead we do our initialisation with C functions marked with __attribute__((constructor)), which are automatically invoked at program startup time (or DSO load-time). The C initialisers are emitted into the stub.c file. This means that every time we compile with -prof or -hpc, we now get a stub file, but thanks to #3687 that is now invisible to the user. There are some refactorings in the RTS (particularly for HPC) to handle the fact that initialisers now get run earlier than they did before. The __stginit symbols are still generated, and the hs_add_root() function still exists (but does nothing), for backwards compatibility.
* Replace some exit(n) calls with stg_exit(n); fixes trac #4445Ian Lynagh2010-10-281-2/+2
| | | | Also changed exitcode of -1 to 1 in hpc.
* use FMT_Word64 instead of locally-defined versionSimon Marlow2010-03-301-8/+1
|
* Stifle warning about printf format stringsbenl@cse.unsw.edu.au2010-02-031-1/+1
|
* RTS tidyup sweep, first phaseSimon Marlow2009-08-021-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Allow the exact HPC tix filename to be given in the HPCTIXFILE env varIan Lynagh2008-07-011-1/+7
|
* Fixing HPCTIXDIR problem with mkdir usage on Windowsandy@galois.com2008-04-111-1/+6
|
* Adding environment variable HPCTIXDIR, a directory to place tix results.andy@galois.com2008-04-081-3/+23
|
* Fix more warningsSimon Marlow2007-10-231-4/+4
|
* FIX BUILD (on 32-bit platforms): hs_hpc_module() type mismatchSimon Marlow2007-10-231-4/+4
|
* Change some ints to unsigned intsSimon Marlow2007-10-181-5/+5
| | | | Fixes some gratuitous warnings when compiling via C with -fhpc
* Writing out .tix file only if you are the original process, not a child.andy@galois.com2007-09-171-2/+11
| | | | | | | This lets us gain coverage on programs that use fork, like xmonad. * To be merged to STABLE *
* removing the functions hs_hpc_read and hs_hpc_write inside Hpc.c, they are ↵andy@galois.com2007-09-171-38/+0
| | | | | | | dead code. * To be merged to STABLE. *
* Cleaning up Hpc.c; adding support for reflection into Hpc.andy@galois.com2007-06-271-12/+9
|
* Cleanup Hpc sub-system, remove hpc-tracer implementation.andy@galois.com2007-06-261-280/+11
|
* Adding new ffi calls into the Hpc rts subsystemandy@galois.com2007-06-121-94/+117
| | | | | | | | | foreign import ccall unsafe hs_hpc_write :: CString -> IO () foreign import ccall unsafe hs_hpc_read :: CString -> IO () These write a Hpc description of the state of the world to a file, or read a description into the current Hpc tickbox subsystem.
* Changing internal data structures used by Hpcandy@galois.com2007-04-301-70/+83
| | | | | | | | | - .tix files are now a list of MixModule, which contain a hash of the contents of the .mix file. - .mix files now have (the same) hash number. This changes allow different binaries that use the same module compiled in the same way to share coverage information.
* Fixing bad allocation of tix box breakpointing array.andy@galois.com2007-02-131-1/+4
|
* Using RTS debug tracing support inside Hpc.candy@galois.com2007-02-131-61/+57
|
* Changing bootstrapping for pipes between debugger and debuggeeandy@galois.com2007-01-101-34/+48
| | | | | | | | | - Now we use two pipes and a fork rather than use named pipes - We use the HPCRIX env var to send the pipe numbers in %d:%d format - We now always breakpoint for special events - We check to see we are the original process before each breakpoint event sub processes are not debugged; this lets us debug the debugger.
* Dynamically allocating the tix box breakpoint arrayandy@galois.com2007-01-091-1/+5
|
* Adding command channel for the hpc debugger to the hpc part of the RTSandy@galois.com2007-01-091-50/+201
|
* Updating rix output to new standard.andy@galois.com2006-12-141-4/+4
|
* Removing unused argument to a printf.andy@galois.com2006-12-131-1/+1
|
* Misc Hpc improvement to dynamic tracer outputandy@galois.com2006-12-131-49/+66
| | | | | | | - Added HPCRIX support for passing tracer filename. - Added thread tracing support. - Cleaned up use of HsFFI.h
* Adding tracing supportandy@galois.com2006-12-091-4/+86
|
* Misc unsigned printing issues; adding magicTixNumber.andy@galois.com2006-11-301-8/+13
|
* Added a workaround for format specifier mismatchsven.panne@aedion.de2006-11-101-1/+8
|
* Changing Main.tix to <prog_name>.tix in the Hpc RTSandy@galois.com2006-10-251-1/+6
|
* Haskell Program Coverageandy@galois.com2006-10-241-0/+324
This large checkin is the new ghc version of Haskell Program Coverage, an expression-level coverage tool for Haskell. Parts: - Hpc.[ch] - small runtime support for Hpc; reading/writing *.tix files. - Coverage.lhs - Annotates the HsSyn with coverage tickboxes. - New Note's in Core, - TickBox -- ticked on entry to sub-expression - BinaryTickBox -- ticked on exit to sub-expression, depending -- on the boolean result. - New Stg level TickBox (no BinaryTickBoxes, though) You can run the coverage tool with -fhpc at compile time. Main must be compiled with -fhpc.