mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-01-18 00:50:44 -08:00
Adding casts to varargs in diagnostic output
Copied from Perforce Change: 178092 ServerID: perforce.ravenbrook.com
This commit is contained in:
parent
c36033e00c
commit
4ee202d5cf
6 changed files with 82 additions and 69 deletions
|
|
@ -1086,9 +1086,10 @@ static Res vmArenaExtend(VMArena vmArena, Size size)
|
|||
|
||||
|
||||
DIAG_SINGLEF(( "vmArenaExtend_Start",
|
||||
"to accommodate size $W, try chunkSize $W", size, chunkSize,
|
||||
"to accommodate size $W, try chunkSize $W", (WriteFW)size, (WriteFW)chunkSize,
|
||||
" (VMArenaReserved currently $W bytes)\n",
|
||||
VMArenaReserved(VMArena2Arena(vmArena)), NULL ));
|
||||
(WriteFW)VMArenaReserved(VMArena2Arena(vmArena)),
|
||||
NULL ));
|
||||
|
||||
/* .chunk-create.fail: If we fail, try again with a smaller size */
|
||||
{
|
||||
|
|
@ -1111,9 +1112,10 @@ static Res vmArenaExtend(VMArena vmArena, Size size)
|
|||
for(; chunkSize > chunkHalf; chunkSize -= sliceSize) {
|
||||
if(chunkSize < chunkMin) {
|
||||
DIAG_SINGLEF(( "vmArenaExtend_FailMin",
|
||||
"no remaining address-space chunk >= min($W)", chunkMin,
|
||||
"no remaining address-space chunk >= min($W)", (WriteFW)chunkMin,
|
||||
" (so VMArenaReserved remains $W bytes)\n",
|
||||
VMArenaReserved(VMArena2Arena(vmArena)), NULL ));
|
||||
(WriteFW)VMArenaReserved(VMArena2Arena(vmArena)),
|
||||
NULL ));
|
||||
return ResRESOURCE;
|
||||
}
|
||||
res = VMChunkCreate(&newChunk, vmArena, chunkSize);
|
||||
|
|
@ -1126,9 +1128,10 @@ static Res vmArenaExtend(VMArena vmArena, Size size)
|
|||
vmArenaExtend_Done:
|
||||
|
||||
DIAG_SINGLEF(( "vmArenaExtend_Done",
|
||||
"Request for new chunk of VM $W bytes succeeded", chunkSize,
|
||||
"Request for new chunk of VM $W bytes succeeded", (WriteFW)chunkSize,
|
||||
" (VMArenaReserved now $W bytes)\n",
|
||||
VMArenaReserved(VMArena2Arena(vmArena)), NULL ));
|
||||
(WriteFW)VMArenaReserved(VMArena2Arena(vmArena)),
|
||||
NULL ));
|
||||
|
||||
return res;
|
||||
}
|
||||
|
|
@ -1689,16 +1692,22 @@ static void VMCompact(Arena arena, Trace trace)
|
|||
|| vmem0 != vmem1
|
||||
|| vmem1 != vmem2) {
|
||||
DIAG_SINGLEF(( "VMCompact",
|
||||
"pre-collection vmem was $Um$3, ", M_whole(vmem0), M_frac(vmem0),
|
||||
"peaked at $Um$3, ", M_whole(vmem1), M_frac(vmem1),
|
||||
"released $Um$3, ", M_whole(vmemD), M_frac(vmemD),
|
||||
"now $Um$3", M_whole(vmem2), M_frac(vmem2),
|
||||
" (why $U", trace->why,
|
||||
": $Um$3", M_whole(trace->condemned), M_frac(trace->condemned),
|
||||
"[->$Um$3", M_whole(live), M_frac(live),
|
||||
" $U%-live", livePerc,
|
||||
" $Um$3-stuck]", M_whole(trace->preservedInPlaceSize), M_frac(trace->preservedInPlaceSize),
|
||||
" ($Um$3-not)", M_whole(trace->notCondemned), M_frac(trace->notCondemned),
|
||||
"pre-collection vmem was $Um$3, ",
|
||||
(WriteFU)M_whole(vmem0), (WriteFU)M_frac(vmem0),
|
||||
"peaked at $Um$3, ", (WriteFU)M_whole(vmem1), (WriteFU)M_frac(vmem1),
|
||||
"released $Um$3, ", (WriteFU)M_whole(vmemD), (WriteFU)M_frac(vmemD),
|
||||
"now $Um$3", (WriteFU)M_whole(vmem2), (WriteFU)M_frac(vmem2),
|
||||
" (why $U", (WriteFU)trace->why,
|
||||
": $Um$3",
|
||||
(WriteFU)M_whole(trace->condemned), (WriteFU)M_frac(trace->condemned),
|
||||
"[->$Um$3", (WriteFU)M_whole(live), (WriteFU)M_frac(live),
|
||||
" $U%-live", (WriteFU)livePerc,
|
||||
" $Um$3-stuck]",
|
||||
(WriteFU)M_whole(trace->preservedInPlaceSize),
|
||||
(WriteFU)M_frac(trace->preservedInPlaceSize),
|
||||
" ($Um$3-not)",
|
||||
(WriteFU)M_whole(trace->notCondemned),
|
||||
(WriteFU)M_frac(trace->notCondemned),
|
||||
" )",
|
||||
NULL));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -194,7 +194,7 @@ enum {
|
|||
static void version_diag(void)
|
||||
{
|
||||
DIAG_SINGLEF(( "MPSVersion",
|
||||
"$S", MPSVersion(), NULL ));
|
||||
"$S", (WriteFS)MPSVersion(), NULL ));
|
||||
}
|
||||
|
||||
static void rules_diag(Rule rules)
|
||||
|
|
@ -207,8 +207,8 @@ static void rules_diag(Rule rules)
|
|||
" rules:\n", NULL ));
|
||||
for(ir = 0; rules[ir].action != NULL; ir++) {
|
||||
DIAG_DECL( Rule rule = &rules[ir]; )
|
||||
DIAG_MOREF(( "$S$S/$S/$S\n", rule->action, rule->tag,
|
||||
rule->para, rule->line,
|
||||
DIAG_MOREF(( "$S$S/$S/$S\n", (WriteFS)rule->action, (WriteFS)rule->tag,
|
||||
(WriteFS)rule->para, (WriteFS)rule->line,
|
||||
NULL ));
|
||||
}
|
||||
DIAG_END("DiagFilter_Rules");
|
||||
|
|
@ -378,7 +378,7 @@ static void filterStream_Output(Diag diag, Rule rules)
|
|||
if(rules[ir].action[0] == '+' || diag->overflow) {
|
||||
if(nolinesyet) {
|
||||
res = WriteF(filterStream_under(),
|
||||
DIAG_PREFIX_TAGSTART "$S {", diag->tag, NULL);
|
||||
DIAG_PREFIX_TAGSTART "$S {", (WriteFS)diag->tag, NULL);
|
||||
AVER(res == ResOK);
|
||||
nolinesyet = FALSE;
|
||||
}
|
||||
|
|
@ -452,7 +452,7 @@ static void filterStream_TagEnd(mps_lib_FILE *stream, const char *tag)
|
|||
(void) WriteF(filterStream_under(),
|
||||
"\nWARNING: diag tag \"$S\" is current, "
|
||||
"but got DIAG_END(\"$S\"). (They must match).",
|
||||
diag->tag, tag, NULL);
|
||||
(WriteFS)diag->tag, (WriteFS)tag, NULL);
|
||||
}
|
||||
AVER(StringEqual(diag->tag, tag));
|
||||
|
||||
|
|
@ -551,7 +551,7 @@ static void diagTagBegin(mps_lib_FILE *stream, const char *tag)
|
|||
filterStream_TagBegin(stream, tag);
|
||||
} else {
|
||||
Res res;
|
||||
res = WriteF(stream, DIAG_PREFIX_TAGSTART "$S {\n", tag, NULL);
|
||||
res = WriteF(stream, DIAG_PREFIX_TAGSTART "$S {\n", (WriteFS)tag, NULL);
|
||||
AVER(res == ResOK);
|
||||
}
|
||||
}
|
||||
|
|
@ -672,7 +672,7 @@ static void patternOccurs_test(Bool expect, const char *patt,
|
|||
|
||||
static void diag_test(void)
|
||||
{
|
||||
DIAG_SINGLEF(( "DIAGTEST_Tag1", "text $U.\n", 42, NULL ));
|
||||
DIAG_SINGLEF(( "DIAGTEST_Tag1", "text $U.\n", (WriteFU)42, NULL ));
|
||||
|
||||
DIAG_SINGLEF(( "DIAGTEST_EmptyDiag", NULL ));
|
||||
|
||||
|
|
@ -682,12 +682,12 @@ static void diag_test(void)
|
|||
StringEqual("Fred", "Fred"),
|
||||
NULL
|
||||
));
|
||||
DIAG_MOREF(("Fred = Tom: $U.\n", StringEqual("Fred", "Tom"), NULL));
|
||||
DIAG_MOREF(("Tom = Fred: $U.\n", StringEqual("Tom", "Fred"), NULL));
|
||||
DIAG_MOREF(("0 = Fred: $U.\n", StringEqual("", "Fred"), NULL));
|
||||
DIAG_MOREF(("Fred = 0: $U.\n", StringEqual("Fred", ""), NULL));
|
||||
DIAG_MOREF(("0 = 0: $U.\n", StringEqual("", ""), NULL));
|
||||
DIAG_MOREF(("0 = 000: $U.\n", StringEqual("", "\0\0"), NULL));
|
||||
DIAG_MOREF(("Fred = Tom: $U.\n", (WriteFU)StringEqual("Fred", "Tom"), NULL));
|
||||
DIAG_MOREF(("Tom = Fred: $U.\n", (WriteFU)StringEqual("Tom", "Fred"), NULL));
|
||||
DIAG_MOREF(("0 = Fred: $U.\n", (WriteFU)StringEqual("", "Fred"), NULL));
|
||||
DIAG_MOREF(("Fred = 0: $U.\n", (WriteFU)StringEqual("Fred", ""), NULL));
|
||||
DIAG_MOREF(("0 = 0: $U.\n", (WriteFU)StringEqual("", ""), NULL));
|
||||
DIAG_MOREF(("0 = 000: $U.\n", (WriteFU)StringEqual("", "\0\0"), NULL));
|
||||
DIAG_END("DIAGTEST_StringEqual");
|
||||
|
||||
DIAG_FIRSTF(( "DIAGTEST_patternOccurs", NULL ));
|
||||
|
|
@ -718,11 +718,11 @@ static void diag_test(void)
|
|||
DIAG_END("DIAGTEST_patternOccurs");
|
||||
|
||||
#if 0
|
||||
DIAG_FIRSTF(( "TestTag2", "text $U.\n", 42, NULL ));
|
||||
DIAG_FIRSTF(( "TestTag2", "text $U.\n", (WriteFU)42, NULL ));
|
||||
DIAG_MOREF(( NULL ));
|
||||
DIAG_MOREF(( "string $S.\n", "fooey!", NULL ));
|
||||
DIAG_MOREF(( "string $S.\n", (WriteFS)"fooey!", NULL ));
|
||||
DIAG_MOREF(( NULL ));
|
||||
DIAG_MOREF(( "Another string $S.\n", "baloney!", NULL ));
|
||||
DIAG_MOREF(( "Another string $S.\n", (WriteFS)"baloney!", NULL ));
|
||||
DIAG_END( "TestTag2" );
|
||||
#endif
|
||||
}
|
||||
|
|
|
|||
|
|
@ -296,9 +296,9 @@ Res ChainCondemnAuto(double *mortalityReturn, Chain chain, Trace trace)
|
|||
} while (genNewSize >= gen->capacity * (Size)1024);
|
||||
|
||||
DIAG_SINGLEF(( "ChainCondemnAuto",
|
||||
"condemn gens [0..$U]", topCondemnedGenSerial,
|
||||
" (of $U)", chain->genCount,
|
||||
" of this chain $P.", (void*)chain,
|
||||
"condemn gens [0..$U]", (WriteFU)topCondemnedGenSerial,
|
||||
" (of $U)", (WriteFU)chain->genCount,
|
||||
" of this chain $P.", (WriteFP)chain,
|
||||
NULL ));
|
||||
|
||||
/* Condemn everything in these zones. */
|
||||
|
|
|
|||
|
|
@ -2219,28 +2219,28 @@ static void AMCTraceEnd(Pool pool, Trace trace)
|
|||
|
||||
if(amc->pageretstruct[ti].pRet >= pRetMin) {
|
||||
DIAG_SINGLEF(( "AMCTraceEnd_pageret",
|
||||
" $U", ArenaEpoch(pool->arena),
|
||||
" $U", trace->why,
|
||||
" $S", trace->emergency ? "Emergency" : "-",
|
||||
" $U", amc->pageretstruct[ti].pCond,
|
||||
" $U", amc->pageretstruct[ti].pRet, ",",
|
||||
" $U", amc->pageretstruct[ti].pCS,
|
||||
" $U", amc->pageretstruct[ti].pRS, ",",
|
||||
" $U", amc->pageretstruct[ti].sCM,
|
||||
" $U", amc->pageretstruct[ti].pCM,
|
||||
" $U", amc->pageretstruct[ti].sRM,
|
||||
" $U", amc->pageretstruct[ti].pRM,
|
||||
" $U", amc->pageretstruct[ti].pRM1,
|
||||
" $U", amc->pageretstruct[ti].pRMrr,
|
||||
" $U", amc->pageretstruct[ti].pRMr1, ",",
|
||||
" $U", amc->pageretstruct[ti].sCL,
|
||||
" $U", amc->pageretstruct[ti].pCL,
|
||||
" $U", amc->pageretstruct[ti].sRL,
|
||||
" $U", amc->pageretstruct[ti].pRL,
|
||||
" $U", amc->pageretstruct[ti].pRLr,
|
||||
" (page = $Ub,", ArenaAlign(pool->arena),
|
||||
" Large >= $Up,", AMCLargeSegPAGES,
|
||||
" pRetMin $U)", pRetMin,
|
||||
" $U", (WriteFU)ArenaEpoch(pool->arena),
|
||||
" $U", (WriteFU)trace->why,
|
||||
" $S", (WriteFS)(trace->emergency ? "Emergency" : "-"),
|
||||
" $U", (WriteFU)amc->pageretstruct[ti].pCond,
|
||||
" $U", (WriteFU)amc->pageretstruct[ti].pRet, ",",
|
||||
" $U", (WriteFU)amc->pageretstruct[ti].pCS,
|
||||
" $U", (WriteFU)amc->pageretstruct[ti].pRS, ",",
|
||||
" $U", (WriteFU)amc->pageretstruct[ti].sCM,
|
||||
" $U", (WriteFU)amc->pageretstruct[ti].pCM,
|
||||
" $U", (WriteFU)amc->pageretstruct[ti].sRM,
|
||||
" $U", (WriteFU)amc->pageretstruct[ti].pRM,
|
||||
" $U", (WriteFU)amc->pageretstruct[ti].pRM1,
|
||||
" $U", (WriteFU)amc->pageretstruct[ti].pRMrr,
|
||||
" $U", (WriteFU)amc->pageretstruct[ti].pRMr1, ",",
|
||||
" $U", (WriteFU)amc->pageretstruct[ti].sCL,
|
||||
" $U", (WriteFU)amc->pageretstruct[ti].pCL,
|
||||
" $U", (WriteFU)amc->pageretstruct[ti].sRL,
|
||||
" $U", (WriteFU)amc->pageretstruct[ti].pRL,
|
||||
" $U", (WriteFU)amc->pageretstruct[ti].pRLr,
|
||||
" (page = $Ub,", (WriteFU)ArenaAlign(pool->arena),
|
||||
" Large >= $Up,", (WriteFU)AMCLargeSegPAGES,
|
||||
" pRetMin $U)", (WriteFU)pRetMin,
|
||||
NULL ));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -309,7 +309,7 @@ static void traceSetSignalEmergency(TraceSet ts, Arena arena)
|
|||
Trace trace;
|
||||
|
||||
DIAG_SINGLEF(( "traceSetSignalEmergency",
|
||||
"traceSet: $B", ts, NULL ));
|
||||
"traceSet: $B", (WriteFB)ts, NULL ));
|
||||
|
||||
TRACE_SET_ITER(ti, trace, ts, arena)
|
||||
trace->emergency = TRUE;
|
||||
|
|
@ -1527,20 +1527,20 @@ static void TraceStartGenDesc_diag(GenDesc desc, int i)
|
|||
NULL ));
|
||||
} else {
|
||||
DIAG_WRITEF(( DIAG_STREAM,
|
||||
" GenDesc [$U]", i,
|
||||
" GenDesc [$U]", (WriteFU)i,
|
||||
NULL ));
|
||||
}
|
||||
DIAG_WRITEF(( DIAG_STREAM,
|
||||
" $P capacity: $U KiB, mortality $D\n",
|
||||
(void *)desc, desc->capacity, desc->mortality,
|
||||
" ZoneSet:$B\n", desc->zones,
|
||||
(WriteFP)desc, (WriteFU)desc->capacity, (WriteFD)desc->mortality,
|
||||
" ZoneSet:$B\n", (WriteFB)desc->zones,
|
||||
NULL ));
|
||||
RING_FOR(n, &desc->locusRing, nn) {
|
||||
DIAG_DECL( PoolGen gen = RING_ELT(PoolGen, genRing, n); )
|
||||
DIAG_WRITEF(( DIAG_STREAM,
|
||||
" PoolGen $U ($S)", gen->nr, gen->pool->class->name,
|
||||
" totalSize $U", gen->totalSize,
|
||||
" newSize $U\n", gen->newSizeAtCreate,
|
||||
" PoolGen $U ($S)", (WriteFU)gen->nr, (WriteFS)gen->pool->class->name,
|
||||
" totalSize $U", (WriteFU)gen->totalSize,
|
||||
" newSize $U\n", (WriteFU)gen->newSizeAtCreate,
|
||||
NULL ));
|
||||
}
|
||||
}
|
||||
|
|
@ -1606,14 +1606,14 @@ void TraceStart(Trace trace, double mortality, double finishingTime)
|
|||
|
||||
DIAG_FIRSTF(( "TraceStart",
|
||||
"because code $U: $S\n",
|
||||
trace->why, TraceStartWhyToString(trace->why),
|
||||
(WriteFU)trace->why, (WriteFS)TraceStartWhyToString(trace->why),
|
||||
NULL ));
|
||||
|
||||
DIAG( ArenaDescribe(arena, DIAG_STREAM); );
|
||||
|
||||
DIAG_MOREF((
|
||||
" white set:$B\n",
|
||||
trace->white,
|
||||
(WriteFB)trace->white,
|
||||
NULL ));
|
||||
|
||||
{
|
||||
|
|
@ -1626,7 +1626,7 @@ void TraceStart(Trace trace, double mortality, double finishingTime)
|
|||
RING_FOR(node, &arena->chainRing, nextNode) {
|
||||
Chain chain = RING_ELT(Chain, chainRing, node);
|
||||
DIAG_WRITEF(( DIAG_STREAM,
|
||||
" Chain $P\n", (void *)chain,
|
||||
" Chain $P\n", (WriteFP)chain,
|
||||
NULL ));
|
||||
|
||||
for(i = 0; i < chain->genCount; ++i) {
|
||||
|
|
|
|||
|
|
@ -164,7 +164,9 @@ Res VMCreate(VM *vmReturn, Size size)
|
|||
DIAG_SINGLEF((
|
||||
"VM_ix_Create_ok",
|
||||
"[$W..<$W>..$W)",
|
||||
vm->base, (char*)vm->limit - (char*)vm->base, vm->limit,
|
||||
(WriteFW)vm->base,
|
||||
(WriteFW)AddrOffset(vm->base, vm->limit),
|
||||
(WriteFW)vm->limit,
|
||||
NULL ));
|
||||
|
||||
*vmReturn = vm;
|
||||
|
|
@ -188,7 +190,9 @@ void VMDestroy(VM vm)
|
|||
DIAG_SINGLEF((
|
||||
"VM_ix_Destroy",
|
||||
"[$W..<$W>..$W)",
|
||||
vm->base, (char*)vm->limit - (char*)vm->base, vm->limit,
|
||||
(WriteFW)vm->base,
|
||||
(WriteFW)AddrOffset(vm->base, vm->limit),
|
||||
(WriteFW)vm->limit,
|
||||
NULL ));
|
||||
|
||||
/* This appears to be pretty pointless, since the descriptor */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue