summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Kotas <jkotas@microsoft.com>2017-07-06 09:01:53 +0200
committerGitHub <noreply@github.com>2017-07-06 09:01:53 +0200
commit32b52269a270f9b7800da3ba119b92061f528789 (patch)
tree48bccdd51ad43531124de5ae2e2c54fbccdc6a1f
parent79ce844d7a68a62ad0a49a5db202dabf343ecad7 (diff)
downloadcoreclr-32b52269a270f9b7800da3ba119b92061f528789.tar.gz
coreclr-32b52269a270f9b7800da3ba119b92061f528789.tar.bz2
coreclr-32b52269a270f9b7800da3ba119b92061f528789.zip
Fix DumpLog to be compatible with CoreRT (#12636)
-rw-r--r--src/ToolBox/SOS/Strike/stressLogDump.cpp2
-rw-r--r--src/inc/stresslog.h26
-rw-r--r--src/utilcode/stresslog.cpp2
3 files changed, 15 insertions, 15 deletions
diff --git a/src/ToolBox/SOS/Strike/stressLogDump.cpp b/src/ToolBox/SOS/Strike/stressLogDump.cpp
index 9dfbe1ed5e..9c0ba1ed07 100644
--- a/src/ToolBox/SOS/Strike/stressLogDump.cpp
+++ b/src/ToolBox/SOS/Strike/stressLogDump.cpp
@@ -505,7 +505,7 @@ HRESULT StressLog::Dump(ULONG64 outProcLog, const char* fileName, struct IDebugD
else
{
args = latestMsg->args;
- formatOutput(memCallBack, file, format, latestLog->threadId, deltaTime, latestMsg->facility, args);
+ formatOutput(memCallBack, file, format, (unsigned)latestLog->threadId, deltaTime, latestMsg->facility, args);
}
}
msgCtr++;
diff --git a/src/inc/stresslog.h b/src/inc/stresslog.h
index 55fb27a56d..d109778a65 100644
--- a/src/inc/stresslog.h
+++ b/src/inc/stresslog.h
@@ -423,14 +423,14 @@ inline BOOL StressLog::LogOn(unsigned facility, unsigned level)
struct StressMsg {
union {
struct {
- DWORD_PTR numberOfArgs : 3; // at most 7 arguments
- DWORD_PTR formatOffset : 29; // offset of string in mscorwks
+ uint32_t numberOfArgs : 3; // at most 7 arguments
+ uint32_t formatOffset : 29; // offset of string in mscorwks
};
- DWORD_PTR fmtOffsCArgs; // for optimized access
+ uint32_t fmtOffsCArgs; // for optimized access
};
- DWORD_PTR facility; // facility used to log the entry
- unsigned __int64 timeStamp; // time when mssg was logged
- void* args[0]; // size given by numberOfArgs
+ uint32_t facility; // facility used to log the entry
+ uint64_t timeStamp; // time when mssg was logged
+ void* args[0]; // size given by numberOfArgs
static const size_t maxArgCnt = 7;
static const size_t maxOffset = 0x20000000;
@@ -512,17 +512,17 @@ struct StressLogChunk
// to the corresponding field
class ThreadStressLog {
ThreadStressLog* next; // we keep a linked list of these
- unsigned threadId; // the id for the thread using this buffer
- BOOL isDead; // Is this thread dead
+ uint64_t threadId; // the id for the thread using this buffer
+ uint8_t isDead; // Is this thread dead
+ uint8_t readHasWrapped; // set when read ptr has passed chunListTail
+ uint8_t writeHasWrapped; // set when write ptr has passed chunListHead
StressMsg* curPtr; // where packets are being put on the queue
StressMsg* readPtr; // where we are reading off the queue (used during dumping)
- BOOL readHasWrapped; // set when read ptr has passed chunListTail
- BOOL writeHasWrapped; // set when write ptr has passed chunListHead
StressLogChunk * chunkListHead; //head of a list of stress log chunks
StressLogChunk * chunkListTail; //tail of a list of stress log chunks
StressLogChunk * curReadChunk; //the stress log chunk we are currently reading
StressLogChunk * curWriteChunk; //the stress log chunk we are currently writing
- LONG chunkListLength; // how many stress log chunks are in this stress log
+ long chunkListLength; // how many stress log chunks are in this stress log
#ifdef STRESS_LOG_READONLY
FORCEINLINE StressMsg* AdvanceRead();
@@ -698,14 +698,14 @@ public:
return "StressLog TaskSwitch Marker\n";
}
- void LogMsg ( DWORD_PTR facility, int cArgs, const char* format, ... )
+ void LogMsg (unsigned facility, int cArgs, const char* format, ... )
{
va_list Args;
va_start(Args, format);
LogMsg (facility, cArgs, format, Args);
va_end(Args);
}
- void LogMsg ( DWORD_PTR facility, int cArgs, const char* format, va_list Args);
+ void LogMsg (unsigned facility, int cArgs, const char* format, va_list Args);
#ifdef STRESS_LOG_READONLY
static size_t OffsetOfNext () {return offsetof (ThreadStressLog, next);}
static size_t OffsetOfListHead () {return offsetof (ThreadStressLog, chunkListHead);}
diff --git a/src/utilcode/stresslog.cpp b/src/utilcode/stresslog.cpp
index 91c5c0e8ef..95c088fb86 100644
--- a/src/utilcode/stresslog.cpp
+++ b/src/utilcode/stresslog.cpp
@@ -529,7 +529,7 @@ void TrackSO(BOOL tolerance)
/*********************************************************************************/
/* fetch a buffer that can be used to write a stress message, it is thread safe */
-void ThreadStressLog::LogMsg ( DWORD_PTR facility, int cArgs, const char* format, va_list Args)
+void ThreadStressLog::LogMsg(unsigned facility, int cArgs, const char* format, va_list Args)
{
STATIC_CONTRACT_NOTHROW;
STATIC_CONTRACT_FORBID_FAULT;