1. 26 May, 2011 1 commit
    • Duncan Coutts's avatar
      Rearrange shutdownCapability code slightly · 68b76e0e
      Duncan Coutts authored
      This is mostly for the beneift of having sensible places to put tracing
      code later. We want a code path that has somewhere to trace (in order):
       (1) starting up all capabilities;
       (2) N * starting up an individual capability;
       (3) N * shutting down an individual capability;
       (4) shutting down all capabilities.
      This has to work in both threaded and non-threaded modes.
      Locations (1) and (2) are provided by initCapabilities and
      initCapability respectively. Previously, there was no loccation for (4)
      and while shutdownCapability should be usable for (3) it was only called
      in the !THREADED_RTS case.
      Now, shutdownCapability is called unconditionally (and the body is
      conditonal on THREADED_RTS) and there is a new shutdownCapabilities that
      calls shutdownCapability in a loop.
  2. 25 May, 2011 2 commits
  3. 24 May, 2011 1 commit
  4. 22 May, 2011 1 commit
  5. 19 May, 2011 2 commits
  6. 18 May, 2011 1 commit
  7. 14 May, 2011 1 commit
  8. 13 May, 2011 1 commit
    • Duncan Coutts's avatar
      Make the GHCi linker handle partially stripped object files (#5004) · cfbf0eb1
      Duncan Coutts authored
      When you use 'strip --strip-unneeded' on a ELF format .o or .a file, if
      the object file has no global/exported symbols then 'strip' ends up
      removing the symbol table entirely. Previously the GHCi linker assumed
      there would always be exactly one symbol table and exactly one string
      table. In fact, in ELF object files there is no such limitation, instead
      each section points to the other sections it needs, in particular
      relocation sections have a link to the symbol table section they use and
      symbol table sections have a link to the corresponding string table.
      So instead of assuming there will always be a global symbol and string
      table, all we have to do is validate and follow these links. Then, when
      we encounter an empty object file that has no symbols then we handle it
      correctly, because since it's empty we never process any relocations and
      so never have to follow any links to non-existant symbol tables.
      Also, in the case where an object is fully stripped, we can now detect
      this more reliably and emit a more helpful error message, e.g:
      libHSghc-7.1.20110509.a(DsMeta.o): relocation section #2 has no symbol table
      This object file has probably been fully striped. Such files cannot be linked.
  9. 11 May, 2011 1 commit
  10. 10 May, 2011 1 commit
    • dmp's avatar
      Fix bug in one-line stats printing · 8ae1fd33
      dmp authored
      The code that prints the "one-line" stats (i.e. the RTS -t flag) was
      incorreclty printing zeros for some time values. These time values
      were computed inside a conditional that was only true when printing
      detailed stats (i.e. the RTS -s or -S flags).
      This commit simply moves the computation out of the conditional so
      they are available for the one-line stats output.
  11. 09 May, 2011 1 commit
  12. 07 May, 2011 1 commit
  13. 23 Apr, 2011 2 commits
  14. 20 Apr, 2011 2 commits
  15. 15 Apr, 2011 2 commits
  16. 14 Apr, 2011 2 commits
    • Ian Lynagh's avatar
      Refactor how dependencies are included; fixes #5109 · ae587ec8
      Ian Lynagh authored
      This avoids duplicating some logic around the build system.
    • Simon Marlow's avatar
      Avoid accumulating slop in the pinned_object_block. · cc2ea98a
      Simon Marlow authored
      The pinned_object_block is where we allocate small pinned ByteArray#
      objects.  At a GC the pinned_object_block was being treated like other
      large objects and promoted to the next step/generation, even if it was
      only partly full.  Under some ByteString-heavy workloads this would
      accumulate on average 2k of slop per GC, and this memory is never
      released until the ByteArray# objects in the block are freed.
      So now, we keep allocating into the pinned_object_block until it is
      completely full, at which point it is handed over to the GC as before.
      The pinned_object_block might therefore contain objects which a large
      range of ages, but I don't think this is any worse than the situation
      before.  We still have the fragmentation issue in general, but the new
      scheme can improve the memory overhead for some workloads
  17. 13 Apr, 2011 1 commit
  18. 12 Apr, 2011 4 commits
    • Erik de Castro Lopo's avatar
      Fix compiling on linux-powerpc. · 243c3042
      Erik de Castro Lopo authored
    • Simon Marlow's avatar
      Change the way module initialisation is done (#3252, #4417) · a52ff761
      Simon Marlow authored
      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
       - 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
      The __stginit symbols are still generated, and the hs_add_root()
      function still exists (but does nothing), for backwards compatibility.
    • Simon Marlow's avatar
      Cleanup sweep and fix a bug in RTS flag processing. · 5463b55b
      Simon Marlow authored
      This code has accumulated a great deal of cruft over the years, this
      pass cleans up a lot of the surrounding cruft but leaves the actual
      argument processing alone - so there's still more that could be done.
      Bug fixed:
        - ghc_rts_opts should not be subject to the --rtsopts setting.  If
          the programmer explicitly declares options with ghc_rts_opts, they
          shouldn't also have to accept command-line RTS options to make them
    • Simon Marlow's avatar
      isAlive: re-apply the tag if we find a forwarding pointer. This is a · 4f018b47
      Simon Marlow authored
      real bug, spotted by Marcin Orczyk (thanks!).  I'm not sure if it lead
      to any actual crashes.
  19. 11 Apr, 2011 2 commits
    • Simon Marlow's avatar
      Refactoring and tidy up · 1fb38442
      Simon Marlow authored
      This is a port of some of the changes from my private local-GC branch
      (which is still in darcs, I haven't converted it to git yet).  There
      are a couple of small functional differences in the GC stats: first,
      per-thread GC timings should now be more accurate, and secondly we now
      report average and maximum pause times. e.g. from minimax +RTS -N8 -s:
                                          Tot time (elapsed)  Avg pause  Max pause
        Gen  0      2755 colls,  2754 par   13.16s    0.93s     0.0003s    0.0150s
        Gen  1       769 colls,   769 par    3.71s    0.26s     0.0003s    0.0059s
    • Simon Marlow's avatar
      add casMutVar# · 521b7925
      Simon Marlow authored
  20. 09 Apr, 2011 1 commit
  21. 08 Apr, 2011 1 commit
  22. 03 Apr, 2011 1 commit
    • Ian Lynagh's avatar
      Take strlen of archive filenames. · be895313
      Ian Lynagh authored
      On OS X at least, the filename size is the size of the filename
      field. The actual filename may be shorter.
      Also a number of code style improvements and debug prints.
      This is part of the patch from #5062, from Greg Wright.
  23. 30 Mar, 2011 2 commits
  24. 29 Mar, 2011 2 commits
  25. 18 Mar, 2011 1 commit
  26. 21 Mar, 2011 1 commit
  27. 09 Mar, 2011 1 commit
  28. 16 Mar, 2011 1 commit