1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-07 12:20:39 -08:00
Commit graph

38 commits

Author SHA1 Message Date
Richard Brooksby
6c887280e4 Fixing type puns discovered by gcc 4.2.1 on freebsd with -o3.
Copied from Perforce
 Change: 179356
 ServerID: perforce.ravenbrook.com
2012-09-07 22:03:41 +01:00
David Lovemore
4ee202d5cf Adding casts to varargs in diagnostic output
Copied from Perforce
 Change: 178092
 ServerID: perforce.ravenbrook.com
2012-05-03 15:17:04 +01:00
Richard Kistruck
fad9fa8edc Mps br/vmem diag.c: version_diag() emits mpsversion in a diag
Copied from Perforce
 Change: 170229
 ServerID: perforce.ravenbrook.com
2010-03-29 16:37:49 +01:00
Richard Kistruck
7bdbbeb2c9 mps br/vmem: simple-chunk-return:
arenavm.c:
   - M_whole, M_frac: print count of bytes as Megabytes
   - diag on VMCompact after all client-requested traces, plus any others where we returned a chunk.
   - show vmem change, and also trace cond, live / % / stuck(pip), notCond

 mpm.c -- new "$3" format for 0-padding 3-char-wide field, for thousandths of a MB

 zcoll.c -- try some new parameters for tests

 diag.c -- just VMCompact diag

Copied from Perforce
 Change: 170097
 ServerID: perforce.ravenbrook.com
2010-03-23 03:52:41 +00:00
Richard Kistruck
b75de3e923 mps br/vmem: simple-chunk-return:
arenavm.c --  on VMFree(), destroy any empty chunks (except the primary).  (VMFree is not the ideal place to do it, but works for proof of concept).
 tract.c -- fix ChunkCache defects:
  - previously, if cache is empty (chunkCache->chunk == NULL) then other fields are *undefined*; but code looks at them anyway (!) without first checking chunkCache->chunk;
  - change it (.chunk.empty.fields) so that, if cache is empty, other fields have defined values: cache-using code may look at them, and they are chosen so that no cache hit will occur.
  --> this fixes crashing defect shown by changelist 170072
  - AVERT(ChunkCache) in the many places it should be checked;
  - use AVERT_CRITICAL in ChunkEncache, because it is called by ChunkOfAddr;

 Also:
 plan.txt -- notes on use of primary chunk.
 config.h -- DIAG also in ci, please [Do not integ to master]
 diag.c -- skip ChainCondemnAuto diag thanks
 zcoll.c -- move printf announcing Destroying arena etc to just before, not just after, we do it.

Copied from Perforce
 Change: 170082
 ServerID: perforce.ravenbrook.com
2010-03-22 13:24:49 +00:00
Richard Kistruck
e82d034c98 Mps br/vmem: prepare for simple-chunk-return:
arenavm.c: VMFree is okay for testing chunk-ret; though just sparePagesPurge() for now;
  diag.c: show what we want for using zcoll to show chunk-ret:
    VM_ix_Create/Destroy
    TraceStart, excpet only briefly for dyn-crit (why=2) and not at all for minor
  locus.c: no newline on "condemn gens" diag please
  tract.c: ChunkDecache is BROKEN; just add AVER to catch this for now
  vmix.c: VM_ix_Create_ok/VM_ix_Destroy (vmw3.c needs similar)
  zcoll.c:
    release after mps_arena_collect!!!
    make, collect, make, collect, to show chunk-ret
    10MB arena means many chunks
None of this is releaseable quality of course.

Copied from Perforce
 Change: 170071
 ServerID: perforce.ravenbrook.com
2010-03-20 13:51:23 +00:00
Richard Kistruck
6a0d651629 Amc large segment padding (lsp), for job001811:
See design/poolamc for thorough documentation.

AMCBufferFill, for large requests (> 8 ArenaAligns) now gives precisely the requested size to the buffer, and immediately pads the rest [poolamc.c].  See #define AMCLargeSegPAGES 8 [config.h].

New PoolTraceEndMethod -- do end-of-trace work:
Tracer calls PoolTraceEnd() after reclaim, when the trace is TraceFINISHED [trace.c].  AbstractPoolClass uses PoolTrivTraceEnd -- a NOOP [mpm.h, mpmst.h, mpmtypes.h, pool.c, poolabs.c, pooln.c].  AMC overrides with AMCTraceEnd, to emit diagnostic about how well the trace went [poolamc.c].

DIAGNOSTICS:
AMCTraceEnd_pageret: reports page retention (currently gated to only emit if >= 100 pages are retained).
traceSetSignalEmergency: warn when a trace enters emergency mode.
DIAG buffer now 200K, and copes with overflow.

TESTS:
zcoll.c: Test allocation of mixed big and small objects.  Test allocation of big object immediately followed by a retained small object, to test AMC LSP.

Copied from Perforce
 Change: 169898
 ServerID: perforce.ravenbrook.com
2010-03-02 16:41:16 +00:00
Richard Kistruck
7c06dd2ad6 Mps br/padding:
poolamc.c tidy up:
  neater implementation of obj1pip (amcReclaimNailed)
  neater implementation of amcResetTraceIdStats -- no need for a function any more
  delete lots of obsolete temporary diagnostic (superseded by AMCTraceEnd_pageret)
  a few more avers (especially on buffer empty)
also revert temporary diagnostic changes in arena.c, config.h, diag.c, global.c
diag.c: fix diag-buffer at 100 screenfuls (200000 chars).
zcoll.c: reinstate Make 50000 with occasional big objs.

Copied from Perforce
 Change: 168688
 ServerID: perforce.ravenbrook.com
2009-09-17 16:59:39 +01:00
Richard Kistruck
c3bcfc86c9 Mps br/padding poolamc: pageretstruct -- page-based diags about page retention,
emitted as diag AMCTraceEnd_pageret.

Copied from Perforce
 Change: 168562
 ServerID: perforce.ravenbrook.com
2009-09-03 17:17:50 +01:00
Richard Kistruck
09480c095f Mps br/padding: lsp tweaks and diag
zcoll:
  - parameterize BigdropSmall for big-obj size and small-obj ref-type, eg "BigdropSmall(big 28000, small A)"
  - Park, to avoid all those minor collections.  Explanatory comments.
poolamc.c:
  - diags: AMCTraceEnd, AMCTraceEnd_perc (new), AMCTraceEnd_pad_med (new),
  - AMCTraceEnd: c Segs/Pages Whiten/Reclaim, cPagesRet(ained)
  - AMCTraceEnd_perc: percentage of condemned pages retained by ambig refs
  - AMCTraceEnd_pad_med: over-detailed calculations of Gain & Loss for Medium segs,
    requiring knowledge of size of obj1 in each seg.
diag.c:
  - Just show AMCTraceEnd_perc and AMCTraceEnd_pad_med, for zcoll/BigdropSmall's purposes.
Note: poolamc.c now has several episodes of experimental diagnostic in it.
It's time to re-baseline it from an un-hacked version.

Copied from Perforce
 Change: 168512
 ServerID: perforce.ravenbrook.com
2009-08-26 17:34:56 +01:00
Richard Kistruck
bf80a3a11d Mps br/padding: new pooltraceendmethod: do end-of-trace work
Tracer calls PoolTraceEnd() when the trace is TraceFINISHED.
 AbstractPoolClass uses PoolTrivTraceEnd -- a NOOP. [mpm.h, mpmst.h, mpmtypes.h, pool.c, poolabs.c]
 AMC overrides with AMCTraceEnd, to emit diagnostic on how well the trace went! [poolamc.c]

Copied from Perforce
 Change: 168478
 ServerID: perforce.ravenbrook.com
2009-08-20 17:44:16 +01:00
Richard Kistruck
8931f6f510 Mps br/padding diagsystem: diag > buf? set flag, truncate, force output
(instead of asserting)

Copied from Perforce
 Change: 167809
 ServerID: perforce.ravenbrook.com
2009-04-17 17:45:27 +01:00
Richard Kistruck
23bd972843 Mps br.padding: per-seg padstats; report poolsum- totals in amcdescribe.
Copied from Perforce
 Change: 167808
 ServerID: perforce.ravenbrook.com
2009-04-17 17:09:46 +01:00
Richard Kistruck
e3d6c443ad Mps br/padding: diagnostics that show large-segment-padding in action.
zcoll.c: BigSmall() command -- creates small, then big, then small object.
poolamc.c: AMCDescribe(): output AMC Seg maps, showing single big object -- a pad -- at end of large-segment.
arena/config/diag: allow output of AMC Seg maps.

Copied from Perforce
 Change: 167763
 ServerID: perforce.ravenbrook.com
2009-04-09 16:01:21 +01:00
Richard Kistruck
ed1f97ac9f Mps br/padding: more diagnostic for how padding survives a collection.
More diag:
  - new traceSetSignalEmergency;
  - new AMCFix_amcSegCreateNailboard and AMCHeaderFix_amcSegCreateNailboard
    (note: the other, unreported, route to becoming boarded is because of a (mutator) buffer);
  - in traces: show SegBase and zone;
   - in TraceStart: show genZoneSets;
   - in amcReclaimNailed: show cbpip and cbpad.
 zcoll.c:
   - sizemethod 1 to Make command: occasionally makes >1MiB objects;
   - declare root_table all MPS_RANK_AMBIG.

Copied from Perforce
 Change: 167726
 ServerID: perforce.ravenbrook.com
2009-04-02 18:29:10 +01:00
Richard Kistruck
fa6fd160ad Mps br/padding diag.c: show some tracestart diag as well (because, res, com, alignment)
Copied from Perforce
 Change: 167702
 ServerID: perforce.ravenbrook.com
2009-04-01 19:03:27 +01:00
Richard Kistruck
6d25fd294f Mps br/padding poolamc.c: diags for condemn and reclaim of big segs (> 1mib)
Copied from Perforce
 Change: 167695
 ServerID: perforce.ravenbrook.com
2009-04-01 17:34:31 +01:00
David Jones
d6d6a11ef7 Mps: adding uses of diag_decl so that variety=hi builds on os x.
Copied from Perforce
 Change: 163257
 ServerID: perforce.ravenbrook.com
2007-09-19 11:12:21 +01:00
Richard Kistruck
a1ecafc1f8 Mps br/diagtag: diag.c: (comment only) add to todo list: deprecate
un-tagged diags, every diag should end with \n.
poolamc.c: fix spelling of amcScanNailed_loop diag.

Copied from Perforce
 Change: 163125
 ServerID: perforce.ravenbrook.com
2007-08-14 15:59:19 +01:00
Richard Kistruck
557026a790 Mps br/diagtag: diag_prefix_ in config.h, instead of hard-wired.
Note .filter-disable.

Copied from Perforce
 Change: 163119
 ServerID: perforce.ravenbrook.com
2007-08-14 13:31:46 +01:00
Richard Kistruck
2cbc8e1232 Mps br/diagtag: determine diag_buffer_size in config.h; space for
20000 chars (10 screenfuls) in diag varieties, 1 char in others.
Handle diag->buf overflow (in fact was already handled; now tested; 
 in the always-on safety tests, use a condition that is verbatim 
 the same as the corresponding AVER).
Diag type: DiagSig, and AVERT(Diag, diag).  Neater .rules.debug.

Copied from Perforce
 Change: 163114
 ServerID: perforce.ravenbrook.com
2007-08-13 18:07:30 +01:00
Richard Kistruck
d9d4f267df Mps br/diagtag: give helpful message if diag_end tag does not match.
(tidyup) Move RulesGlobal to head of file; write instructions.
(tidyup) Move StringEqual into mpm.c (with StringLength); add AVER.
(cosmetic) Correct case of names: module-interface names begin 
uppercase; local names begin lowercase.  Tags should be C identifiers.

Copied from Perforce
 Change: 163112
 ServerID: perforce.ravenbrook.com
2007-08-13 16:54:40 +01:00
Richard Kistruck
c6663dcbff Mps br/diagtag: matchtag now uses patternoccurs, not stringequal, so
-DIAGTEST/*/*
will filter out all diags whose tags contain "DIAGTEST".
Unit test for PatternOccurs.  (PatternOccurs used to be called 
StringMatch).  

Copied from Perforce
 Change: 163111
 ServerID: perforce.ravenbrook.com
2007-08-13 15:55:32 +01:00
Richard Kistruck
f27629ba7c Mps br/diagtag: .improve.empty-diag: if diag is empty, still allow
it to be output (if rules permit).  Rename FilterOutput as FilterStream_Output.

Copied from Perforce
 Change: 163110
 ServerID: perforce.ravenbrook.com
2007-08-13 15:05:39 +01:00
Richard Kistruck
34c5536455 Mps br/diagtag: note .improve.empty-diag. to do list.
Run diag_test() on first tag begin.

Copied from Perforce
 Change: 163105
 ServerID: perforce.ravenbrook.com
2007-08-11 16:26:51 +01:00
Richard Kistruck
05d91ccd0c Mps br/diagtag: diag.c: before first diag, output rules_diag: list
of all rules.  Aver FilterOutput non-reentrant.  Note: empty diags 
never output.

Copied from Perforce
 Change: 163104
 ServerID: perforce.ravenbrook.com
2007-08-11 12:53:50 +01:00
Richard Kistruck
95761082f4 Mps br/diagtag: (fix w3i3mv build) remove unused vars, unused static fn diagoutput, and add int->char cast in _fputc
Copied from Perforce
 Change: 163083
 ServerID: perforce.ravenbrook.com
2007-08-10 11:48:52 +01:00
Richard Kistruck
5a97a8309e Mps br/diagtag:
locus.c: slightly better ChainCondemnAuto diag.
poolamc.c: tag amcScanNailed-loop diag (as provoked by mpsicv).
(diag.c: (diag filter only) hide amcScanNailed-loop diag)

Copied from Perforce
 Change: 163082
 ServerID: perforce.ravenbrook.com
2007-08-10 10:53:32 +01:00
Richard Kistruck
3cf7d5d66a Mps br/diagtag: whether a rule matches tag and para is constant for
the whole of a given diag, so memoize it (instead of repeating the 
match for every line of the diag).
locus.c: new diag from ChainCondemnAuto.
trace.c: tidy up TraceStart diag, give traceFindGrey diag a tag.

Copied from Perforce
 Change: 163077
 ServerID: perforce.ravenbrook.com
2007-08-09 16:41:59 +01:00
Richard Kistruck
af1160663a Mps br/diagtag: matchpara lets you choose to see the whole of a
diagnostic based on something on one of its lines.  See RulesGlobalX 
for an example.  Implementation currently inefficient (scans whole 
buffer for each line).

Copied from Perforce
 Change: 163073
 ServerID: perforce.ravenbrook.com
2007-08-09 15:40:53 +01:00
Richard Kistruck
e4eafb743e Mps br/diagtag: matchline and lineoutput give line-by-line filtering.
Copied from Perforce
 Change: 163072
 ServerID: perforce.ravenbrook.com
2007-08-09 14:45:14 +01:00
Richard Kistruck
8342669dc9 Mps br/diagtag: diag.c: stringequal(), used to check tags, and
report helpfully if poor programmer forgot to end a tag.
FilterOutput: really filters now, but only on Tag.

Copied from Perforce
 Change: 163070
 ServerID: perforce.ravenbrook.com
2007-08-09 13:40:48 +01:00
Richard Kistruck
55b74f2590 Mps br/diagtag: writef (mpm.c) uses new stream_fputc/s(), but still use mps_lib_file*
and mps_lib_EOF.
diag.c:
  Diag is a buffer capable of holding a diagnostic.
  FilterStream can buffer and filter diagnostics.
  Rule is a selection rule for filtering diagnostics.
  FilterOutput does output (but does not apply the rules yet).
  DiagStream can be switched to either FilterStream() or mps_lib_stdout().  

Copied from Perforce
 Change: 163067
 ServerID: perforce.ravenbrook.com
2007-08-09 12:11:29 +01:00
Richard Kistruck
5cbd84f9b4 Mps br/diagtag:
diag.c: support tagging of diagnostics, and avoid having to 
  say DIAG_STREAM every time, with new macros:
    DIAG_SINGLEF, DIAG_FIRSTF, DIAG_MOREF, DIAG_END.
mpm.c: new WriteF_firstformat_v required by DIAG_MOREF.

Copied from Perforce
 Change: 163059
 ServerID: perforce.ravenbrook.com
2007-08-07 19:09:43 +01:00
Richard Kistruck
2901c70183 Mps master: diag.c's diag_with_stream_and_writef apparatus: now
always present in the source, even for builds (eg. non-diag 
varieties) in which it is not invoked.  (avoids ranlib warning on 
xcppgc).

Copied from Perforce
 Change: 162948
 ServerID: perforce.ravenbrook.com
2007-07-19 17:03:30 +01:00
Richard Kistruck
6749f30dc0 Mps br/diag: diag-out with writef and diag_stream does not work in cet.
Hope to fix in time, but for now I need DIAG-out to work, so switch 
to printf (yes, really, I know, sorry).
Also, only do DIAG-out in variety.di, to avoid damage to .ci.
So for now, remove DIAG_WRITEF and DIAG from arenavm and trace.
To test, add DIAG_PRINTF in trace.

Copied from Perforce
 Change: 162387
 ServerID: perforce.ravenbrook.com
2007-05-21 16:28:50 +01:00
Richard Kistruck
b261b142fd Mps br/diag: variety.ii: now has diagnostics, and no logging (pro tem);
mpm.h: DIAG() et al under control of DIAGNOSTICS;
diag.c: under control of DIAGNOSTICS, plus add header and copyright.

Copied from Perforce
 Change: 162214
 ServerID: perforce.ravenbrook.com
2007-04-27 15:37:16 +01:00
David Jones
afbf0b8ce7 Mps: diag fixes.
Copied from Perforce
 Change: 162163
 ServerID: perforce.ravenbrook.com
2007-04-19 13:02:21 +01:00