summaryrefslogtreecommitdiff
path: root/src/jit/jit.h
diff options
context:
space:
mode:
authorPeter Kukol <pkukol@users.noreply.github.com>2016-09-28 18:29:33 -0700
committerGitHub <noreply@github.com>2016-09-28 18:29:33 -0700
commitf20f51697d2c61ce998ed7514a327e3c1e1936bc (patch)
treee0285a495133411d5d993a9ba65a1e3d22a4756d /src/jit/jit.h
parent0d46a91f2f48282fd004a35c8a28ddb24432237e (diff)
downloadcoreclr-f20f51697d2c61ce998ed7514a327e3c1e1936bc.tar.gz
coreclr-f20f51697d2c61ce998ed7514a327e3c1e1936bc.tar.bz2
coreclr-f20f51697d2c61ce998ed7514a327e3c1e1936bc.zip
Add option to measure time spent inside calls to the CLR. (#7357)
* Add option to measure time spent inside calls to the CLR (off by default).
Diffstat (limited to 'src/jit/jit.h')
-rw-r--r--src/jit/jit.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/jit/jit.h b/src/jit/jit.h
index d4e40acf84..8ef0dcfa8c 100644
--- a/src/jit/jit.h
+++ b/src/jit/jit.h
@@ -488,6 +488,25 @@ typedef ptrdiff_t ssize_t;
#define LOOP_HOIST_STATS 0 // You can set this to 1 to get loop hoist stats in retail, as well
#endif
+// Timing calls to clr.dll is only available under certain conditions.
+#ifndef FEATURE_JIT_METHOD_PERF
+#define MEASURE_CLRAPI_CALLS 0 // Can't time these calls without METHOD_PERF.
+#endif
+#ifdef DEBUG
+#define MEASURE_CLRAPI_CALLS 0 // No point in measuring DEBUG code.
+#endif
+#if !defined(_HOST_X86_) && !defined(_HOST_AMD64_)
+#define MEASURE_CLRAPI_CALLS 0 // Cycle counters only hooked up on x86/x64.
+#endif
+#if !defined(_MSC_VER) && !defined(__clang__)
+#define MEASURE_CLRAPI_CALLS 0 // Only know how to do this with VC and Clang.
+#endif
+
+// If none of the above set the flag to 0, it's available.
+#ifndef MEASURE_CLRAPI_CALLS
+#define MEASURE_CLRAPI_CALLS 0 // Set to 1 to measure time in ICorJitInfo calls.
+#endif
+
/*****************************************************************************/
/* Portability Defines */
/*****************************************************************************/