X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=docs%2Fusers_guide%2Fprofiling.xml;h=5fb53d038e96f81e463c6fde58b411889e385fb9;hb=ebf7a60ced1f32b62d9d1c96c808723e2a784816;hp=f0d96ba98b952acf5148d8475972f5e4e45b5823;hpb=0c12697ef809ab47dd10b6e292fe42140af72c3f;p=ghc-hetmet.git diff --git a/docs/users_guide/profiling.xml b/docs/users_guide/profiling.xml index f0d96ba..5fb53d0 100644 --- a/docs/users_guide/profiling.xml +++ b/docs/users_guide/profiling.xml @@ -280,7 +280,12 @@ main = do let xs = {-# SCC "X" #-} [1..1000000] which gives this heap profile when run: - + + @@ -453,9 +458,10 @@ x = nfib 25 - or : + or or : + time profile @@ -467,9 +473,24 @@ x = nfib 25 The option produces a more detailed report containing the actual time and allocation data as well. (Not used much.) + + The option produces the most detailed + report containing all cost centres in addition to the actual time + and allocation data. + + + RTS + option + + Sets the interval that the RTS clock ticks at, which is + also the sampling interval of the time and allocation profile. + The default is 0.02 second. + + + @@ -525,6 +546,11 @@ x = nfib 25 + You might also want to take a look + at hp2any, + a more advanced suite of tools (not distributed with GHC) for + displaying heap profiles. + RTS options for heap profiling @@ -730,7 +756,8 @@ x = nfib 25 0.1 second). Fractions are allowed: for example will get 5 samples per second. This only affects heap profiling; time profiles are always - sampled on a 1/50 second frequency. + sampled with the frequency of the RTS clock. See + for changing that. @@ -1591,13 +1618,13 @@ Options: (ToDo: document properly.) - It is possible to compile Glasgow Haskell programs so that + It is possible to compile Haskell programs so that they will count lots and lots of interesting things, e.g., number of updates, number of data constructors entered, etc., etc. We call this “ticky-ticky” profiling,ticky-ticky profiling profiling, - ticky-ticky because that's the sound a Sun4 + ticky-ticky because that's the sound a CPU makes when it is running up all those counters (slowly). @@ -1605,25 +1632,52 @@ Options: it is quite separate from the main “cost-centre” profiling system, intended for all users everywhere. - To be able to use ticky-ticky profiling, you will need to - have built the ticky RTS. (This should be described in - the building guide, but amounts to building the RTS with way - "t" enabled.) + + You don't need to build GHC, the libraries, or the RTS a special + way in order to use ticky-ticky profiling. You can decide on a + module-by-module basis which parts of a program have the + counters compiled in, using the + compile-time option. Those modules that + were not compiled with won't contribute + to the ticky-ticky profiling results, and that will normally + include all the pre-compiled packages that your program links + with. + - To get your compiled program to spit out the ticky-ticky - numbers, use a RTS - option-r RTS option. - See . + + To get your compiled program to spit out the ticky-ticky + numbers: - Compiling your program with the - switch yields an executable that performs these counts. Here is a - sample ticky-ticky statistics file, generated by the invocation - foo +RTS -rfoo.ticky. + + + + Link the program with + ( is a synonym + for at link-time). This links in + the debug version of the RTS, which includes the code for + aggregating and reporting the results of ticky-ticky + profilng. + + + + + Run the program with the RTS + option-r RTS option. + See . + + + + + + Here is a sample ticky-ticky statistics file, generated by + the invocation + foo +RTS -rfoo.ticky. + + foo +RTS -rfoo.ticky - ALLOCATIONS: 3964631 (11330900 words total: 3999476 admin, 6098829 goods, 1232595 slop) total words: 2 3 4 5 6+ 69647 ( 1.8%) function values 50.0 50.0 0.0 0.0 0.0