aboutsummaryrefslogtreecommitdiffstats
path: root/mps/code/trace.c
diff options
context:
space:
mode:
authorRichard Kistruck2007-07-20 18:30:06 +0100
committerRichard Kistruck2007-07-20 18:30:06 +0100
commitf6fb026068b5a0ddd5189ddca09e32bea563e7aa (patch)
tree89feedda770101cf58bc300cabd74fe4a9986c24 /mps/code/trace.c
parentd6b020e5246febf74562a0c783fb126a0d0fcc82 (diff)
downloademacs-f6fb026068b5a0ddd5189ddca09e32bea563e7aa.tar.gz
emacs-f6fb026068b5a0ddd5189ddca09e32bea563e7aa.zip
Mps br/gcdiag: trace.c tracestart: separate tracestartgendesc_diag
function, and use it to show &arena->topGen. Copied from Perforce Change: 162967 ServerID: perforce.ravenbrook.com
Diffstat (limited to 'mps/code/trace.c')
-rw-r--r--mps/code/trace.c49
1 files changed, 31 insertions, 18 deletions
diff --git a/mps/code/trace.c b/mps/code/trace.c
index 806953b0ad2..5692660ce87 100644
--- a/mps/code/trace.c
+++ b/mps/code/trace.c
@@ -20,6 +20,7 @@ Bool traceBandAdvance(Trace);
20Bool traceBandFirstStretch(Trace); 20Bool traceBandFirstStretch(Trace);
21void traceBandFirstStretchDone(Trace); 21void traceBandFirstStretchDone(Trace);
22DIAG_DECL( static void traceFindGrey_diag(Bool found, Rank rank); ) 22DIAG_DECL( static void traceFindGrey_diag(Bool found, Rank rank); )
23static void TraceStartGenDesc_diag(GenDesc desc);
23 24
24/* Types */ 25/* Types */
25 26
@@ -1879,7 +1880,6 @@ void TraceStart(Trace trace, double mortality, double finishingTime)
1879 trace->why, traceStartWhyToString(trace->why), 1880 trace->why, traceStartWhyToString(trace->why),
1880 NULL )); 1881 NULL ));
1881 1882
1882 /* This one makes too much output; should be #if0 in master */
1883 DIAG( ArenaDescribe(arena, DIAG_STREAM); ); 1883 DIAG( ArenaDescribe(arena, DIAG_STREAM); );
1884 1884
1885 DIAG_WRITEF(( DIAG_STREAM, 1885 DIAG_WRITEF(( DIAG_STREAM,
@@ -1887,9 +1887,10 @@ void TraceStart(Trace trace, double mortality, double finishingTime)
1887 trace->white, 1887 trace->white,
1888 NULL )); 1888 NULL ));
1889 1889
1890 { /* @@ */ 1890 {
1891 /* Iterate over all chains, all GenDescs within a chain, and all */ 1891 /* @@ */
1892 /* PoolGens within a GenDesc. */ 1892 /* Iterate over all chains, all GenDescs within a chain, */
1893 /* (and all PoolGens within a GenDesc). */
1893 Ring node, nextNode; 1894 Ring node, nextNode;
1894 Index i; 1895 Index i;
1895 1896
@@ -1900,23 +1901,16 @@ void TraceStart(Trace trace, double mortality, double finishingTime)
1900 NULL )); 1901 NULL ));
1901 1902
1902 for(i = 0; i < chain->genCount; ++i) { 1903 for(i = 0; i < chain->genCount; ++i) {
1903 Ring n, nn;
1904 GenDesc desc = &chain->gens[i]; 1904 GenDesc desc = &chain->gens[i];
1905 DIAG_WRITEF(( DIAG_STREAM, 1905 TraceStartGenDesc_diag(desc);
1906 "MPS: GenDesc [$U] $P capacity: $U KiB, mortality $D\n",
1907 i, (void *)desc, desc->capacity, desc->mortality,
1908 "MPS: ZoneSet:$B\n", desc->zones,
1909 NULL ));
1910 RING_FOR(n, &desc->locusRing, nn) {
1911 PoolGen gen = RING_ELT(PoolGen, genRing, n);
1912 DIAG_WRITEF(( DIAG_STREAM,
1913 "MPS: PoolGen $U ($S)", gen->nr, gen->pool->class->name,
1914 " totalSize $U", gen->totalSize,
1915 " newSize $U\n", gen->newSizeAtCreate,
1916 NULL ));
1917 }
1918 } 1906 }
1919 } 1907 }
1908
1909 /* Now do topgen GenDesc (and all PoolGens within it). */
1910 DIAG_WRITEF(( DIAG_STREAM,
1911 "MPS: topGen\n",
1912 NULL ));
1913 TraceStartGenDesc_diag(&arena->topGen);
1920 } 1914 }
1921 1915
1922 res = RootsIterate(ArenaGlobals(arena), rootGrey, (void *)trace); 1916 res = RootsIterate(ArenaGlobals(arena), rootGrey, (void *)trace);
@@ -1955,6 +1949,25 @@ void TraceStart(Trace trace, double mortality, double finishingTime)
1955} 1949}
1956 1950
1957 1951
1952static void TraceStartGenDesc_diag(GenDesc desc)
1953{
1954 Ring n, nn;
1955 DIAG_WRITEF(( DIAG_STREAM,
1956 "MPS: GenDesc [top] $P capacity: $U KiB, mortality $D\n",
1957 (void *)desc, desc->capacity, desc->mortality,
1958 "MPS: ZoneSet:$B\n", desc->zones,
1959 NULL ));
1960 RING_FOR(n, &desc->locusRing, nn) {
1961 PoolGen gen = RING_ELT(PoolGen, genRing, n);
1962 DIAG_WRITEF(( DIAG_STREAM,
1963 "MPS: PoolGen $U ($S)", gen->nr, gen->pool->class->name,
1964 " totalSize $U", gen->totalSize,
1965 " newSize $U\n", gen->newSizeAtCreate,
1966 NULL ));
1967 }
1968}
1969
1970
1958/* traceWorkClock -- a measure of the work done for this trace 1971/* traceWorkClock -- a measure of the work done for this trace
1959 * 1972 *
1960 * .workclock: Segment and root scanning work is the regulator. */ 1973 * .workclock: Segment and root scanning work is the regulator. */