Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions src/coreclr/gc/gc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50850,7 +50850,7 @@ void gc_heap::record_interesting_info_per_heap()
}

// h# | GC | gen | C | EX | NF | BF | ML | DM || PreS | PostS | Merge | Conv | Pre | Post | PrPo | PreP | PostP |
cprintf (("%2d | %6d | %1d | %1s | %2s | %2s | %2s | %2s | %2s || %5Id | %5Id | %5Id | %5Id | %5Id | %5Id | %5Id | %5Id | %5Id |",
cprintf (("%2d | %6zu | %1d | %1s | %2s | %2s | %2s | %2s | %2s || %5zu | %5zu | %5zu | %5zu | %5zu | %5zu | %5zu | %5zu | %5zu |",
heap_number,
(size_t)settings.gc_index,
settings.condemned_generation,
Expand All @@ -50861,15 +50861,15 @@ void gc_heap::record_interesting_info_per_heap()
((expand_mechanism == expand_reuse_bestfit) ? "X" : ""), // BF
(get_gc_data_per_heap()->is_mechanism_bit_set (gc_mark_list_bit) ? "X" : ""), // ML
(get_gc_data_per_heap()->is_mechanism_bit_set (gc_demotion_bit) ? "X" : ""), // DM
interesting_data_per_gc[idp_pre_short],
interesting_data_per_gc[idp_post_short],
interesting_data_per_gc[idp_merged_pin],
interesting_data_per_gc[idp_converted_pin],
interesting_data_per_gc[idp_pre_pin],
interesting_data_per_gc[idp_post_pin],
interesting_data_per_gc[idp_pre_and_post_pin],
interesting_data_per_gc[idp_pre_short_padded],
interesting_data_per_gc[idp_post_short_padded]));
(size_t)interesting_data_per_gc[idp_pre_short],
(size_t)interesting_data_per_gc[idp_post_short],
(size_t)interesting_data_per_gc[idp_merged_pin],
(size_t)interesting_data_per_gc[idp_converted_pin],
(size_t)interesting_data_per_gc[idp_pre_pin],
(size_t)interesting_data_per_gc[idp_post_pin],
(size_t)interesting_data_per_gc[idp_pre_and_post_pin],
(size_t)interesting_data_per_gc[idp_pre_short_padded],
(size_t)interesting_data_per_gc[idp_post_short_padded]));
}

void gc_heap::record_global_mechanisms()
Expand Down
4 changes: 3 additions & 1 deletion src/coreclr/gc/gc.h
Original file line number Diff line number Diff line change
Expand Up @@ -390,9 +390,11 @@ inline bool IsServerHeap()

#ifdef SIMPLE_DPRINTF

#include <minipal/types.h>

HRESULT initialize_log_file();
void flush_gc_log (bool);
void GCLog (const char *fmt, ... );
void GCLog (const char *fmt, ... ) MINIPAL_ATTR_FORMAT_PRINTF(1, 2);
#define dprintf(l,x) {if ((l == 1) || (l == GTC_LOG)) {GCLog x;}}
#define SIMPLE_DPRINTF_ARG(x) , x

Expand Down
5 changes: 4 additions & 1 deletion src/coreclr/gc/gcpriv.h
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,10 @@ inline void FATAL_GC_ERROR()
#endif //SYNCHRONIZATION_STATS

#ifdef GC_CONFIG_DRIVEN
void GCLogConfig (const char *fmt, ... );

#include <minipal/types.h>

void GCLogConfig (const char *fmt, ... ) MINIPAL_ATTR_FORMAT_PRINTF(1, 2);
#define cprintf(x) {GCLogConfig x;}
#endif //GC_CONFIG_DRIVEN

Expand Down
8 changes: 5 additions & 3 deletions src/coreclr/inc/log.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
#ifndef __LOG_H__
#define __LOG_H__

#include <minipal/types.h>


#define DEFINE_LOG_FACILITY(logname, value) logname = value,

Expand Down Expand Up @@ -74,14 +76,14 @@ extern VOID InitLogging();
extern VOID ShutdownLogging();
extern VOID FlushLogging();

extern VOID LogSpew(DWORD facility, DWORD level, const char *fmt, ... );
extern VOID LogSpew(DWORD facility, DWORD level, const char *fmt, ... ) MINIPAL_ATTR_FORMAT_PRINTF(3, 4);
extern VOID LogSpewValist(DWORD facility, DWORD level, const char *fmt, va_list args);

extern VOID LogSpew2(DWORD facility2, DWORD level, const char *fmt, ... );
extern VOID LogSpew2(DWORD facility2, DWORD level, const char *fmt, ... ) MINIPAL_ATTR_FORMAT_PRINTF(3, 4);
extern VOID LogSpew2Valist(DWORD facility2, DWORD level, const char *fmt, va_list args);

extern VOID LogSpewAlwaysValist(const char *fmt, va_list args);
extern VOID LogSpewAlways (const char *fmt, ... );
extern VOID LogSpewAlways (const char *fmt, ... ) MINIPAL_ATTR_FORMAT_PRINTF(1, 2);
extern VOID EnterLogLock();
extern VOID LeaveLogLock();

Expand Down
5 changes: 3 additions & 2 deletions src/coreclr/inc/sstring.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
#include "utilcode.h"
#include "sbuffer.h"
#include "debugmacros.h"
#include <minipal/types.h>

// ==========================================================================================
// Documentational typedefs: use these to indicate specific representations of 8 bit strings:
Expand Down Expand Up @@ -566,9 +567,9 @@ class EMPTY_BASES_DECL SString : private SBuffer
// Utilities
//---------------------------------------------------------------------

void Printf(const CHAR *format, ...);
void Printf(const CHAR *format, ...) MINIPAL_ATTR_FORMAT_PRINTF(2, 3);
void VPrintf(const CHAR *format, va_list args);
void AppendPrintf(const CHAR *format, ...);
void AppendPrintf(const CHAR *format, ...) MINIPAL_ATTR_FORMAT_PRINTF(2, 3);
void AppendVPrintf(const CHAR *format, va_list args);

public:
Expand Down
6 changes: 3 additions & 3 deletions src/coreclr/inc/stresslog.h
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ class StressLog {
static BOOL InlinedStressLogOn(unsigned facility, unsigned level);
static BOOL InlinedETWLogOn(unsigned facility, unsigned level);

static void LogMsg(unsigned level, unsigned facility, int cArgs, const char* format, ... );
static void LogMsg(unsigned level, unsigned facility, int cArgs, const char* format, ... ) MINIPAL_ATTR_FORMAT_PRINTF(4, 5);

static void LogMsg(unsigned level, unsigned facility, const StressLogMsg& msg);

Expand All @@ -313,7 +313,7 @@ class StressLog {
#endif

static void LogMsgOL(const char* format)
{ LogMsg(LL_ALWAYS, LF_GC, 0, format); }
{ LogMsg(LL_ALWAYS, LF_GC, 0, "%s", format); }

template<typename... Ts>
static void LogMsgOL(const char* format, Ts... args)
Expand Down Expand Up @@ -754,7 +754,7 @@ class ThreadStressLog {
return "StressLog TaskSwitch Marker\n";
}

void LogMsg(unsigned facility, int cArgs, const char* format, ...);
void LogMsg(unsigned facility, int cArgs, const char* format, ...) MINIPAL_ATTR_FORMAT_PRINTF(4, 5);

FORCEINLINE void LogMsg (unsigned facility, int cArgs, const char* format, va_list Args);
#ifdef STRESS_LOG_READONLY
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/jit/codegencommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2016,7 +2016,7 @@ void CodeGen::genGenerateMachineCode()
}

printf(" for ");
printf(Target::g_tgtCPUName);
printf("%s", Target::g_tgtCPUName);

#if defined(TARGET_XARCH)
// Check ISA directly here instead of using
Expand Down
5 changes: 3 additions & 2 deletions src/coreclr/jit/compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#define _COMPILER_H_
/*****************************************************************************/

#include <minipal/types.h>
#include "jit.h"
#include "opcode.h"
#include "varset.h"
Expand Down Expand Up @@ -10833,7 +10834,7 @@ class Compiler

const char* devirtualizationDetailToString(CORINFO_DEVIRTUALIZATION_DETAIL detail);

const char* printfAlloc(const char* format, ...);
const char* printfAlloc(const char* format, ...) MINIPAL_ATTR_FORMAT_PRINTF(2, 3);

void convertUtf16ToUtf8ForPrinting(const char16_t* utf16Src, size_t utf16SrcLen, char* utf8Dst, size_t utf8DstLen);

Expand Down Expand Up @@ -11636,7 +11637,7 @@ class Compiler
// more log information

// levels are currently unused: #define JITDUMP(level,...) ();
void JitLogEE(unsigned level, const char* fmt, ...);
void JitLogEE(unsigned level, const char* fmt, ...) MINIPAL_ATTR_FORMAT_PRINTF(3, 4);

bool compDebugBreak;

Expand Down
15 changes: 8 additions & 7 deletions src/coreclr/jit/emit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#pragma hdrstop
#endif

#include <inttypes.h>
#include "hostallocator.h"
#include "instr.h"
#include "emit.h"
Expand Down Expand Up @@ -7421,9 +7422,9 @@ unsigned emitter::emitEndCodeGen(Compiler* comp,
if (isJccAffectedIns)
{
unsigned bytesCrossedBoundary = (unsigned)(afterInstrAddr & jccAlignBoundaryMask);
printf("; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (%s: %d ; jcc erratum) %dB boundary "
printf("; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (%s: %zu ; jcc erratum) %zuB boundary "
"...............................\n",
codeGen->genInsDisplayName(curInstrDesc), bytesCrossedBoundary, jccAlignBoundary);
codeGen->genInsDisplayName(curInstrDesc), (size_t)bytesCrossedBoundary, (size_t)jccAlignBoundary);
}
}

Expand Down Expand Up @@ -8589,7 +8590,7 @@ void emitter::emitDispDataSec(dataSecDsc* section, AllocMemChunk* dataChunks)
}
else
{
printf("\tdq\t%016llXh", reinterpret_cast<uint64_t>(emitOffsetToPtr(ig->igOffs)));
printf("\tdq\t%016" PRIX64 "h", (uint64_t)reinterpret_cast<uint64_t>(emitOffsetToPtr(ig->igOffs)));
}
#endif // TARGET_64BIT
}
Expand Down Expand Up @@ -8669,7 +8670,7 @@ void emitter::emitDispDataSec(dataSecDsc* section, AllocMemChunk* dataChunks)
{
printf("\t<Unexpected data size %d (expected >= 4)\n", data->dsSize);
}
printf("\tdd\t%08llXh\t", (UINT64) * reinterpret_cast<uint32_t*>(&data->Data()[i]));
printf("\tdd\t%08" PRIX64 "h\t", (uint64_t) * reinterpret_cast<uint32_t*>(&data->Data()[i]));
printf("\t; %9.6g",
FloatingPointUtils::convertToDouble(*reinterpret_cast<float*>(&data->Data()[i])));
i += 4;
Expand All @@ -8680,7 +8681,7 @@ void emitter::emitDispDataSec(dataSecDsc* section, AllocMemChunk* dataChunks)
{
printf("\t<Unexpected data size %d (expected >= 8)\n", data->dsSize);
}
printf("\tdq\t%016llXh", *reinterpret_cast<uint64_t*>(&data->Data()[i]));
printf("\tdq\t%016" PRIX64 "h", *reinterpret_cast<uint64_t*>(&data->Data()[i]));
printf("\t; %12.9g", *reinterpret_cast<double*>(&data->Data()[i]));
i += 8;
break;
Expand Down Expand Up @@ -8738,12 +8739,12 @@ void emitter::emitDispDataSec(dataSecDsc* section, AllocMemChunk* dataChunks)
{
printf("\t<Unexpected data size %d (expected size%%8 == 0)\n", data->dsSize);
}
printf("\tdq\t%016llXh", *reinterpret_cast<uint64_t*>(&data->Data()[i]));
printf("\tdq\t%016" PRIX64 "h", *reinterpret_cast<uint64_t*>(&data->Data()[i]));
for (j = 8; j < 64; j += 8)
{
if (i + j >= data->dsSize)
break;
printf(", %016llXh", *reinterpret_cast<uint64_t*>(&data->Data()[i + j]));
printf(", %016" PRIX64 "h", *reinterpret_cast<uint64_t*>(&data->Data()[i + j]));
}
i += j;
break;
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/jit/emitarm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6817,7 +6817,7 @@ void emitter::emitDispCond(int cond)
const static char* armCond[16] = {"eq", "ne", "hs", "lo", "mi", "pl", "vs", "vc",
"hi", "ls", "ge", "lt", "gt", "le", "AL", "NV"}; // The last two are invalid
assert(0 <= cond && (unsigned)cond < ArrLen(armCond));
printf(armCond[cond]);
printf("%s", armCond[cond]);
}

/*****************************************************************************
Expand Down
32 changes: 16 additions & 16 deletions src/coreclr/jit/emitarm64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12519,11 +12519,11 @@ void emitter::emitDispImm(ssize_t imm, bool addComma, bool alwaysHex /* =false *
{
if (isAddrOffset)
{
printf("0x%llX", imm);
printf("0x%zX", (size_t)imm);
}
else
{
printf("0x%llx", imm);
printf("0x%zx", (size_t)imm);
}
}
else
Expand All @@ -12542,7 +12542,7 @@ void emitter::emitDispImm(ssize_t imm, bool addComma, bool alwaysHex /* =false *
*/
void emitter::emitDispElementIndex(const ssize_t imm, const bool addComma)
{
printf("[%d]", imm);
printf("[%zd]", (size_t)imm);

if (addComma)
{
Expand Down Expand Up @@ -12622,7 +12622,7 @@ void emitter::emitDispCond(insCond cond)
"hi", "ls", "ge", "lt", "gt", "le", "AL", "NV"}; // The last two are invalid
unsigned imm = (unsigned)cond;
assert((0 <= imm) && (imm < ArrLen(armCond)));
printf(armCond[imm]);
printf("%s", armCond[imm]);
}

/*****************************************************************************
Expand All @@ -12635,7 +12635,7 @@ void emitter::emitDispFlags(insCflags flags)
"n", "nv", "nc", "ncv", "nz", "nzv", "nzc", "nzcv"};
unsigned imm = (unsigned)flags;
assert((0 <= imm) && (imm < ArrLen(armFlags)));
printf(armFlags[imm]);
printf("%s", armFlags[imm]);
}

/*****************************************************************************
Expand All @@ -12648,7 +12648,7 @@ void emitter::emitDispBarrier(insBarrier barrier)
"#8", "ishld", "ishst", "ish", "#12", "ld", "st", "sy"};
unsigned imm = (unsigned)barrier;
assert((0 <= imm) && (imm < ArrLen(armBarriers)));
printf(armBarriers[imm]);
printf("%s", armBarriers[imm]);
}

/*****************************************************************************
Expand Down Expand Up @@ -12705,7 +12705,7 @@ void emitter::emitDispExtendOpts(insOpts opt)
void emitter::emitDispReg(regNumber reg, emitAttr attr, bool addComma)
{
emitAttr size = EA_SIZE(attr);
printf(emitRegName(reg, size));
printf("%s", emitRegName(reg, size));

if (addComma)
emitDispComma();
Expand All @@ -12717,7 +12717,7 @@ void emitter::emitDispReg(regNumber reg, emitAttr attr, bool addComma)
void emitter::emitDispVectorReg(regNumber reg, insOpts opt, bool addComma)
{
assert(isVectorRegister(reg));
printf(emitVectorRegName(reg));
printf("%s", emitVectorRegName(reg));
emitDispArrangement(opt);

if (addComma)
Expand All @@ -12730,7 +12730,7 @@ void emitter::emitDispVectorReg(regNumber reg, insOpts opt, bool addComma)
void emitter::emitDispVectorRegIndex(regNumber reg, emitAttr elemsize, ssize_t index, bool addComma)
{
assert(isVectorRegister(reg));
printf(emitVectorRegName(reg));
printf("%s", emitVectorRegName(reg));
emitDispElemsize(elemsize);
printf("[%d]", (int)index);

Expand Down Expand Up @@ -12775,7 +12775,7 @@ void emitter::emitDispVectorElemList(
printf("{");
for (unsigned i = 0; i < listSize; i++)
{
printf(emitVectorRegName(currReg));
printf("%s", emitVectorRegName(currReg));
emitDispElemsize(elemsize);
const bool notLastRegister = (i != listSize - 1);
if (notLastRegister)
Expand Down Expand Up @@ -12850,7 +12850,7 @@ void emitter::emitDispArrangement(insOpts opt)
assert(!"Invalid insOpt");
}
printf(".");
printf(str);
printf("%s", str);
}

//------------------------------------------------------------------------
Expand Down Expand Up @@ -12880,7 +12880,7 @@ void emitter::emitDispElemsize(emitAttr elemsize)
break;
}

printf(str);
printf("%s", str);
}

//------------------------------------------------------------------------
Expand All @@ -12892,7 +12892,7 @@ void emitter::emitDispShiftedReg(regNumber reg, insOpts opt, ssize_t imm, emitAt
assert((imm & 0x003F) == imm);
assert(((imm & 0x0020) == 0) || (size == EA_8BYTE));

printf(emitRegName(reg, size));
printf("%s", emitRegName(reg, size));

if (imm > 0)
{
Expand Down Expand Up @@ -13008,14 +13008,14 @@ void emitter::emitDispAddrRI(regNumber reg, insOpts opt, ssize_t imm)

if (insOptsPreIndex(opt))
{
printf(operStr);
printf("%s", operStr);
}

emitDispReg(reg, EA_8BYTE, false);

if (insOptsPostIndex(opt))
{
printf(operStr);
printf("%s", operStr);
}

if (insOptsIndexed(opt))
Expand Down Expand Up @@ -13429,7 +13429,7 @@ void emitter::emitDispInsHelp(
printf("@RWD%02u", doffs);

if (imm != 0)
printf("%+Id", imm);
printf("%+zd", (size_t)imm);
}
else
{
Expand Down
Loading
Loading