1. 20 Feb, 2003 1 commit
    • simonmar's avatar
      [project @ 2003-02-20 15:39:59 by simonmar] · 51a1c2a2
      simonmar authored
      closureSatisfiesConstraints: check whether the retainer set is valid
      before attempting to match it against a constraint.  It might not be
      valid if the object is an ex-weak-pointer which was finalized after
      the last GC.
      
      MERGE TO STABLE
      51a1c2a2
  2. 23 Jan, 2003 2 commits
    • simonmar's avatar
      [project @ 2003-01-23 16:39:30 by simonmar] · e989066d
      simonmar authored
      Fix compilation with DEBUG
      e989066d
    • simonmar's avatar
      [project @ 2003-01-23 12:13:10 by simonmar] · 70c1ca01
      simonmar authored
      - Add a new flag, -xt, which enables inclusion of TSOs in a heap profile.
      
      - Include large objects in heap profiles (except TSOs unless the -xt flag
        is given).
      
      - In order to make this work, I had to set the bd->free field of the
        block descriptor for a large object to the correct value.  Previously,
        it pointed to the start of the block (i.e. the same as bd->start).
        I hope this doesn't have any other consequences; it looks more
        correct this way in any case.
      70c1ca01
  3. 11 Dec, 2002 1 commit
    • simonmar's avatar
      [project @ 2002-12-11 15:36:20 by simonmar] · 0bffc410
      simonmar authored
      Merge the eval-apply-branch on to the HEAD
      ------------------------------------------
      
      This is a change to GHC's evaluation model in order to ultimately make
      GHC more portable and to reduce complexity in some areas.
      
      At some point we'll update the commentary to describe the new state of
      the RTS.  Pending that, the highlights of this change are:
      
        - No more Su.  The Su register is gone, update frames are one
          word smaller.
      
        - Slow-entry points and arg checks are gone.  Unknown function calls
          are handled by automatically-generated RTS entry points (AutoApply.hc,
          generated by the program in utils/genapply).
      
        - The stack layout is stricter: there are no "pending arguments" on
          the stack any more, the stack is always strictly a sequence of
          stack frames.
      
          This means that there's no need for LOOKS_LIKE_GHC_INFO() or
          LOOKS_LIKE_STATIC_CLOSURE() any more, and GHC doesn't need to know
          how to find the boundary between the text and data segments (BIG WIN!).
      
        - A couple of nasty hacks in the mangler caused by the neet to
          identify closure ptrs vs. info tables have gone away.
      
        - Info tables are a bit more complicated.  See InfoTables.h for the
          details.
      
        - As a side effect, GHCi can now deal with polymorphic seq.  Some bugs
          in GHCi which affected primitives and unboxed tuples are now
          fixed.
      
        - Binary sizes are reduced by about 7% on x86.  Performance is roughly
          similar, some programs get faster while some get slower.  I've seen
          GHCi perform worse on some examples, but haven't investigated
          further yet (GHCi performance *should* be about the same or better
          in theory).
      
        - Internally the code generator is rather better organised.  I've moved
          info-table generation from the NCG into the main codeGen where it is
          shared with the C back-end; info tables are now emitted as arrays
          of words in both back-ends.  The NCG is one step closer to being able
          to support profiling.
      
      This has all been fairly thoroughly tested, but no doubt I've messed
      up the commit in some way.
      0bffc410
  4. 01 Nov, 2002 1 commit
    • simonmar's avatar
      [project @ 2002-11-01 11:05:46 by simonmar] · 6226441f
      simonmar authored
      Fix the heapCensus crash.
      
      It turned out that after a GC, the small_alloc_list might be non-empty
      if a new finalizer thread had been started.  The last block on
      small_alloc_list doesn't have the free pointer set correctly (as a
      small optimisation, we don't normally set the free pointer after each
      allocation, only when the block is full).  The result was that the
      free pointer contains the wrong value, and the heap census traverses
      garbage.  The fix is to set the free pointer correctly before
      traversing small_alloc_list.
      
      The bug doesn't show up when DEBUG is on, because extra DEBUG checks
      cause the free pointer to be initialised to a sensible(-ish) value.
      Hence my difficulty in reproducing the bug.
      
      To reproduce: compile ghc-regress/lib/should_run/memo002 with
      profiling and run it with a sufficiently small sample interval (-i0.02
      did it for me).
      
      Thanks to the kind folks at ARM for helping out with the debugging of
      this one.
      
      MERGE TO STABLE
      6226441f
  5. 16 Aug, 2002 1 commit
  6. 18 Jul, 2002 1 commit
  7. 07 May, 2002 1 commit
  8. 12 Dec, 2001 3 commits
    • simonmar's avatar
      [project @ 2001-12-12 15:59:33 by simonmar] · 7738ad97
      simonmar authored
      Include the CCS ID in the heap profile, so you can find the full CCS
      description in <foo>.prof or the XML profile output.
      7738ad97
    • simonmar's avatar
      [project @ 2001-12-12 15:01:25 by simonmar] · 8098d689
      simonmar authored
      Fix a couple of assertions.
      8098d689
    • simonmar's avatar
      [project @ 2001-12-12 14:31:42 by simonmar] · 55c8be52
      simonmar authored
      - Add a new type of restriction: -hC, which restricts to closures
        whose CCS contains the specified CCs *anywhere* (not just at the
        top).
      
      - Complain if the user tries to request both retainer and biographical
        profiling.  We don't support both simultaneously, because they use
        the same header word in the closure.
      
      - Allow for the fact that the heap might contain some closures which
        don't have a valid retainer set during the heap census.  The only
        known closures of this kind so far are DEAD_WEAK closures.
      
      - Some cruft-removal and renaming of functions to follow conventions.
      55c8be52
  9. 29 Nov, 2001 1 commit
    • simonmar's avatar
      [project @ 2001-11-29 16:38:13 by simonmar] · b560e2a5
      simonmar authored
      Fix for heap profiling when selecting by lag/drag/void/use: I forgot
      to make the final LdvCensusKillAll() call just before outputing the
      census info.
      
      Having tested this stuff on the compiler itself, I now declare it to
      be working (famous last words!).
      b560e2a5
  10. 28 Nov, 2001 3 commits
    • simonmar's avatar
      [project @ 2001-11-28 17:45:13 by simonmar] · 20977132
      simonmar authored
      oops, I broke standard -hb profiles.  Unbreak them again.
      20977132
    • simonmar's avatar
      [project @ 2001-11-28 15:43:23 by simonmar] · f1829925
      simonmar authored
      Make it work in a DEBUG world again (when DEBUG is on we have ancient
      support for doing a heap profile based on info-tables - it is still
      there, but I haven't tested it).
      f1829925
    • simonmar's avatar
      [project @ 2001-11-28 15:01:02 by simonmar] · 6313b907
      simonmar authored
      As promised: allow selecting by lag, drag, void or use.  Currently
      this involves keeping around all the information about previous
      censuses, so memory use could get quite large.  If this turns out to
      be a problem, then we have a plan to throw away some of the info after
      each census.
      6313b907
  11. 27 Nov, 2001 1 commit
  12. 26 Nov, 2001 1 commit
    • simonmar's avatar
      [project @ 2001-11-26 16:54:21 by simonmar] · dbef766c
      simonmar authored
      Profiling cleanup.
      
      This commit eliminates some duplication in the various heap profiling
      subsystems, and generally centralises much of the machinery.  The key
      concept is the separation of a heap *census* (which is now done in one
      place only instead of three) from the calculation of retainer sets.
      Previously the retainer profiling code also did a heap census on the
      fly, and lag-drag-void profiling had its own census machinery.
      
      Value-adds:
      
         - you can now restrict a heap profile to certain retainer sets,
           but still display by cost centre (or type, or closure or
           whatever).
      
         - I've added an option to restrict the maximum retainer set size
           (+RTS -R<size>, defaulting to 8).
      
         - I've cleaned up the heap profiling options at the request of
           Simon PJ.  See the help text for details.  The new scheme
           is backwards compatible with the old.
      
         - I've removed some odd bits of LDV or retainer profiling-specific
           code from various parts of the system.
      
         - the time taken doing heap censuses (and retainer set calculation)
           is now accurately reported by the RTS when you say +RTS -Sstderr.
      
      Still to come:
      
         - restricting a profile to a particular biography
           (lag/drag/void/use).  This requires keeping old heap censuses
           around, but the infrastructure is now in place to do this.
      dbef766c
  13. 22 Nov, 2001 1 commit
    • simonmar's avatar
      [project @ 2001-11-22 14:25:11 by simonmar] · db61851c
      simonmar authored
      Retainer Profiling / Lag-drag-void profiling.
      
      This is mostly work by Sungwoo Park, who spent a summer internship at
      MSR Cambridge this year implementing these two types of heap profiling
      in GHC.
      
      Relative to Sungwoo's original work, I've made some improvements to
      the code:
      
         - it's now possible to apply constraints to retainer and LDV profiles
           in the same way as we do for other types of heap profile (eg.
           +RTS -hc{foo,bar} -hR -RTS gives you a retainer profiling considering
           only closures with cost centres 'foo' and 'bar').
      
         - the heap-profile timer implementation is cleaned up.
      
         - heap profiling no longer has to be run in a two-space heap.
      
         - general cleanup of the code and application of the SDM C coding
           style guidelines.
      
      Profiling will be a little slower and require more space than before,
      mainly because closures have an extra header word to support either
      retainer profiling or LDV profiling (you can't do both at the same
      time).
      
      We've used the new profiling tools on GHC itself, with moderate
      success.  Fixes for some space leaks in GHC to follow...
      db61851c
  14. 14 Aug, 2001 1 commit
    • sewardj's avatar
      [project @ 2001-08-14 13:40:07 by sewardj] · bc5c8021
      sewardj authored
      Change the story about POSIX headers in C compilation.
      
      Until now, all C code in the RTS and library cbits has by default been
      compiled with settings for POSIXness enabled, that is:
         #define _POSIX_SOURCE   1
         #define _POSIX_C_SOURCE 199309L
         #define _ISOC9X_SOURCE
      If you wanted to negate this, you'd have to define NON_POSIX_SOURCE
      before including headers.
      
      This scheme has some bad effects:
      
      * It means that ccall-unfoldings exported via interfaces from a
        module compiled with -DNON_POSIX_SOURCE may not compile when
        imported into a module which does not -DNON_POSIX_SOURCE.
      
      * It overlaps with the feature tests we do with autoconf.
      
      * It seems to have caused borkage in the Solaris builds for some
        considerable period of time.
      
      The New Way is:
      
      * The default changes to not-being-in-Posix mode.
      
      * If you want to force a C file into Posix mode, #include as
        the **first** include the new file ghc/includes/PosixSource.h.
        Most of the RTS C sources have this include now.
      
      * NON_POSIX_SOURCE is almost totally expunged.  Unfortunately
        we have to retain some vestiges of it in ghc/compiler so that
        modules compiled via C on Solaris using older compilers don't
        break.
      bc5c8021
  15. 07 Aug, 2001 1 commit
  16. 23 Jul, 2001 1 commit
    • simonmar's avatar
      [project @ 2001-07-23 17:23:19 by simonmar] · dfd7d6d0
      simonmar authored
      Add a compacting garbage collector.
      
      It isn't enabled by default, as there are still a couple of problems:
      there's a fallback case I haven't implemented yet which means it will
      occasionally bomb out, and speed-wise it's quite a bit slower than the
      copying collector (about 1.8x slower).
      
      Until I can make it go faster, it'll only be useful when you're
      actually running low on real memory.
      
      '+RTS -c' to enable it.
      
      Oh, and I cleaned up a few things in the RTS while I was there, and
      fixed one or two possibly real bugs in the existing GC.
      dfd7d6d0
  17. 19 Jul, 2001 1 commit
    • andy's avatar
      [project @ 2001-07-19 07:28:00 by andy] · c95b2db6
      andy authored
      Re-adding the -i flag for heap profiling.
      
      The problem was that profiling forces 2-space collection,
      and the census was done on *every* GC. Now, we still keep
      the 2-space for profiling, but just do the census periodically,
      according to a new flag, -i<secs>.
      c95b2db6
  18. 14 Mar, 2001 1 commit
    • sewardj's avatar
      [project @ 2001-03-14 11:18:18 by sewardj] · bc210f7d
      sewardj authored
      Add closure selection for heap profiling.  You can use
      -hc{cc_names}, -hd{descrs}, -hy{types}, -hm{mods} to restrict profiled
      closures to the specified sets.  Multiple restrictions are allowed.
      bc210f7d
  19. 11 Dec, 2000 1 commit
  20. 04 Dec, 2000 1 commit
  21. 13 Nov, 2000 1 commit
  22. 07 Nov, 2000 1 commit
    • simonmar's avatar
      [project @ 2000-11-07 18:00:26 by simonmar] · 4e9a8fa4
      simonmar authored
      URK!  when scanning the heap we might find a DEAD_WEAK that either (a)
      is the size of a WEAK, because we just overwrote its info table, or
      (b) is the size of a DEAD_WEAK, because its been around at least one
      GC.  The code herein only accounted for case (a).
      
      Fix: check the word at location p+sizeof(DEAD_WEAK), see whether it
      looks like an info table ptr, and if so we're in case (b).  This is
      guaranteed to work, because we know that in case (a) the appropriate
      word will be a closure pointer.
      4e9a8fa4
  23. 09 Jul, 2000 1 commit
  24. 08 Jul, 2000 1 commit
  25. 12 Jun, 2000 1 commit
  26. 12 May, 2000 1 commit
  27. 19 Apr, 2000 1 commit
  28. 05 Apr, 2000 1 commit
    • simonmar's avatar
      [project @ 2000-04-05 15:32:08 by simonmar] · 90515a13
      simonmar authored
      Preliminary support for heap profiles by module, type, or closure
      description (ie. +RTS -h{Y,D,M}).
      
      The hash tables are dynamically expanding, but lookup seems fairly
      slow so the implementation may need to change at some point.
      90515a13
  29. 03 Apr, 2000 1 commit
  30. 31 Mar, 2000 1 commit
    • hwloidl's avatar
      [project @ 2000-03-31 03:09:35 by hwloidl] · dd4c28a9
      hwloidl authored
      Numerous changes in the RTS to get GUM-4.06 working (currently works with
      parfib-ish programs). Most changes are isolated in the rts/parallel dir.
      
      rts/parallel/:
        The most important changes are a rewrite of the (un-)packing code (Pack.c)
        and changes in LAGA, GALA table operations (Global.c) expecially in
        rebuilding the tables during GC.
      
      rts/:
        Minor changes in Schedule.c, GC.c (interface to par specific root marking
        and evacuation), and lots of additions to Sanity.c (surprise ;-)
        Main.c change for startup: I use a new function rts_evalNothing to
        start non-main-PEs in a PAR || SMP setup (RtsAPI.c)
      
      includes/:
        Updated GranSim macros in PrimOps.h.
      
      lib/std:
        Few changes in PrelHandle.c etc replacing ForeignObj by Addr in a PAR
        setup (we still don't support ForeignObjs or WeakPtrs in GUM).
        Typically use
          #define FILE_OBJECT	    Addr
        when dealing with files.
      
      hslibs/lang/:
        Same as above (in Foreign(Obj).lhs, Weak.lhs, IOExts.lhs etc).
      
      -- HWL
      dd4c28a9
  31. 23 Mar, 2000 2 commits
  32. 08 Mar, 2000 1 commit
    • simonmar's avatar
      [project @ 2000-03-08 17:48:24 by simonmar] · de896403
      simonmar authored
      - generalise the per-module initialisation stubs so that we use it
        in normal (non-profiled) code too.  The initialisation stubs are
        now called '__init_<module>' rather than '_reg<module>'.
      
      - Register foreign exported functions as stable pointers in the
        initialisation code for the module.  This fixes the foreign export
        problems reported by several people.
      
      - remove the concept of "module groups" from the profiling subsystem.
      
      - change the profiling semantics slightly; it should be unnecessary
        to use '-caf-all' to get reasonable profiles now.
      de896403
  33. 07 Mar, 2000 2 commits