InstrumentingProfiler.cpp File Reference
#include "ProfilerCompatibility.h"#include "SysprogsProfilerInterface.h"#include <string.h>#include "DebuggerChecker.h"#include "SmallNumberCoder.h"Namespaces | |
| SysprogsInstrumentingProfiler | |
| SysprogsInstrumentingProfiler::Chronometer | |
| SysprogsInstrumentingProfiler::VendorSpecificWorkarounds | |
| SysprogsStackVerifier | |
| OverheadMeasurementFunctions | |
Macros | |
| #define | SYSPROGS_PROFILER_MAX_THREADS 16 |
| #define | __countof(array) (sizeof(array) / sizeof((array)[0])) |
| #define | SysprogsInstrumentingProfiler_QueryAndResetPerformanceCounter SysprogsInstrumentingProfiler_QueryAndResetPerformanceCounter_Inline |
| #define | DWT_CYCCNT (*((unsigned *)0xE0001004)) |
| #define | DWT_CTRL (*((unsigned *)0xE0001000)) |
| #define | COREDEBUG_DEMCR (*((unsigned *)0xe000edfc)) |
| #define | CLEAR_R0_BIT_0() |
| #define | SYSPROGS_THUMB_HOOK_PROLOGUE() |
| #define | SYSPROGS_THUMB_HOOK_EPILOGUE() |
| #define | SYSPROGS_THUMB_HOOK_PROLOGUE_WITH_TAG_PUSHES_R1() |
| #define | SYSPROGS_PROFILER_EXIT_IF_SUSPENDED(exitLabelName) |
Typedefs | |
| typedef unsigned long long | ProfilerTimeType |
| typedef unsigned | uintptr_t |
| typedef unsigned | SysprogsInstrumentingProfiler::ProfilerUIntPtr |
Functions | |
| void | SysprogsInstrumentingProfiler::__attribute__ ((noinline)) RaiseError(InstrumentingProfilerErrorCode errorCode |
| SysprogsInstrumentingProfiler::if (s_ThreadIDReportPending) | |
| SysprogsInstrumentingProfiler::for (const InstrumentedFrame *pFrame=pTopFrame;pFrame;pFrame=pFrame->pNextFrame) | |
| SysprogsInstrumentingProfiler::if ((int) unreportedFrames< 0) unreportedFrames | |
| SysprogsInstrumentingProfiler::if (!coder.WritePackedUIntPair(totalFrames-unreportedFrames, unreportedFrames)) RaiseError(ipeScratchBufferOverflow) | |
| SysprogsInstrumentingProfiler::while (unreportedFrames) | |
| SysprogsInstrumentingProfiler::if (!coder.WriteSmallUnsignedIntWithFlag(ProfilerTimeToUInt32(runTime), pTopFrame->FoldedTime!=0)) RaiseError(ipeScratchBufferOverflow) | |
| SysprogsInstrumentingProfiler::if (pTopFrame->FoldedTime) if(!coder.WriteSmallUnsignedInt(ProfilerTimeToUInt32(pTopFrame-> FoldedTime))) RaiseError(ipeScratchBufferOverflow) | |
| SysprogsInstrumentingProfiler::while (!SysprogsProfiler_WriteData(pdcInstrumentationProfilerNormalStream,(char *) coder.GetBuffer(), 0, coder.GetBuffer(), coder.GetOffset())) | |
| SysprogsInstrumentingProfiler::while (!SysprogsProfiler_WriteData(pdcRealTimeAnalysisStream,&rec, sizeof(rec), 0, 0)&&!g_FastSemihostingCallActive) | |
| void | SysprogsInstrumentingProfiler::SysprogsInstrumentingProfilerReturnHookImpl (void **pStack) |
| SysprogsInstrumentingProfiler::__attribute__ ((always_inline)) static inline bool IsProcessStackMode(void) | |
| void | SysprogsInstrumentingProfiler::SysprogsInstrumentingProfilerHookImpl (void **pStack) |
| void | SysprogsInstrumentingProfiler::ReportThreadCreated (void *newThread, const char *pThreadName) |
| void | SysprogsInstrumentingProfiler::ReportThreadSwitch (void *newThread) |
| __attribute__ ((naked)) void SysprogsInstrumentingProfilerHook() | |
| volatile void * | __attribute__ ((alias("SysprogsProfiler_FunctionHookTable"))) SysprogsProfiler_FunctionHookTableEnd |
| OverheadMeasurementFunctions::__attribute__ ((noinline, naked, optimize("-O0"))) void NonInstrumented() | |
| void | SysprogsProfiler_RTOSThreadSwitched (void *newThread, const char *pThreadName, void *pStackLimit) |
| void | SysprogsProfiler_RTOSThreadDeleted (void *thread) |
| void | SysprogsProfiler_ReportResourceTaken (void *pResource, void *pOwner, unsigned optional24BitTag) |
| void | SysprogsProfiler_ReportResourceReleased (void *pResource, void *pOwner, unsigned optional24BitTag) |
| void | SysprogsProfiler_ReportIntegralValue (void *pResource, unsigned value, int reportAsSigned) |
| void | SysprogsProfiler_ReportFPValue (void *pResource, double value) |
| void | SysprogsProfiler_ReportGenericEvent (void *pResource, const char *pEvent) |
| void | SysprogsProfiler_ReportGenericEventEx (void *pResource, void *argument, RealTimeEventArgType argType, int argSize) |
| void | __attribute__ ((weak)) InitializeProfilerRTOSHooks() |
| void | ReportTicksPerSecond (unsigned ticksPerSecond) |
| Reports the profiler clock resolution to the host. More... | |
| void | InitializeCustomRealTimeWatch () |
Macro Definition Documentation
| #define __countof | ( | array | ) | (sizeof(array) / sizeof((array)[0])) |
| #define CLEAR_R0_BIT_0 | ( | ) |
Value:
asm("lsr r0, #1"); \
asm("lsl r0, #1");
| #define COREDEBUG_DEMCR (*((unsigned *)0xe000edfc)) |
| #define DWT_CTRL (*((unsigned *)0xE0001000)) |
| #define DWT_CYCCNT (*((unsigned *)0xE0001004)) |
| #define SYSPROGS_PROFILER_EXIT_IF_SUSPENDED | ( | exitLabelName | ) |
Value:
asm("ldr r0, =g_SuppressInstrumentingProfiler"); \
asm("ldr r0, [r0]"); \
asm("tst r0, r0"); \
asm("bne " exitLabelName);
| #define SYSPROGS_PROFILER_MAX_THREADS 16 |
| #define SYSPROGS_THUMB_HOOK_EPILOGUE | ( | ) |
Value:
asm("pop {r0}"); \
asm("mov lr, r0"); \
asm("pop {r0, pc}");
| #define SYSPROGS_THUMB_HOOK_PROLOGUE | ( | ) |
Value:
/* Old stack layout: [R0] [R1] [LR]. New stack layout: [LR] [R0] [PC]*/ \
asm("str r0, [sp, #4]"); /* [new R0] = r0 */ \
asm("ldr r0, [sp, #8]"); /* r0 = [old LR] */ \
asm("str r0, [sp, #0]"); /* [new LR] = r0 */ \
asm("mov r0, lr"); \
CLEAR_R0_BIT_0() \
asm("ldr r0, [r0, #0]"); /* r0 = [original PC] */ \
asm("str r0, [sp, #8]"); /* [new PC] = r0 */
| #define SYSPROGS_THUMB_HOOK_PROLOGUE_WITH_TAG_PUSHES_R1 | ( | ) |
Value:
/* Old stack layout: [R0] [R1] [LR]. New stack layout: [LR] [R0] [PC]*/ \
asm("str r0, [sp, #4]"); /* [new R0] = r0 */ \
asm("ldr r0, [sp, #8]"); /* r0 = [old LR] */ \
asm("str r0, [sp, #0]"); /* [new LR] = r0 */ \
asm("mov r0, lr"); \
CLEAR_R0_BIT_0() \
asm("push {r1}"); \
asm("ldr r1, [r0, #0]"); /* r0 = [original PC] */ \
asm("str r1, [sp, #12]"); /* [new PC] = r0 */
| #define SysprogsInstrumentingProfiler_QueryAndResetPerformanceCounter SysprogsInstrumentingProfiler_QueryAndResetPerformanceCounter_Inline |
Typedef Documentation
| typedef unsigned long long ProfilerTimeType |
| typedef unsigned uintptr_t |
Enumeration Type Documentation
Function Documentation
| __attribute__ | ( | (naked) | ) |
| volatile void* __attribute__ | ( | (alias("SysprogsProfiler_FunctionHookTable")) | ) |
| void __attribute__ | ( | (weak) | ) |
| void InitializeCustomRealTimeWatch | ( | ) |
| void ReportTicksPerSecond | ( | unsigned | ticksPerSecond | ) |
Reports the profiler clock resolution to the host.
Use this function to report the resolution of the profiler clock (i.e. the meaning of the values returned by SysprogsInstrumentingProfiler_QueryAndResetPerformanceCounter) to the host. This allows VisualGDB to report physical time values instead of just ticks.
| void SysprogsProfiler_ReportFPValue | ( | void * | pResource, |
| double | value | ||
| ) |
| void SysprogsProfiler_ReportGenericEvent | ( | void * | pResource, |
| const char * | pEvent | ||
| ) |
| void SysprogsProfiler_ReportGenericEventEx | ( | void * | pResource, |
| void * | argument, | ||
| RealTimeEventArgType | argType, | ||
| int | argSize | ||
| ) |
| void SysprogsProfiler_ReportIntegralValue | ( | void * | pResource, |
| unsigned | value, | ||
| int | reportAsSigned | ||
| ) |
| void SysprogsProfiler_ReportResourceReleased | ( | void * | pResource, |
| void * | pOwner, | ||
| unsigned | optional24BitTag | ||
| ) |
| void SysprogsProfiler_ReportResourceTaken | ( | void * | pResource, |
| void * | pOwner, | ||
| unsigned | optional24BitTag | ||
| ) |
| void SysprogsProfiler_RTOSThreadDeleted | ( | void * | thread | ) |
| void SysprogsProfiler_RTOSThreadSwitched | ( | void * | newThread, |
| const char * | pThreadName, | ||
| void * | pStackLimit | ||
| ) |
Variable Documentation
| int g_FastSemihostingCallActive |
| InstrumentingProfilerFlags g_InstrumentingProfilerRTOSFlags |
| int g_StopOnRealTimeReportingBufferOverflow = 0 |
| int g_SuppressInstrumentingProfiler = 1 |
| volatile void* SysprogsProfiler_FunctionHookTable |
