summaryrefslogtreecommitdiff
path: root/src/vm/perfmap.h
diff options
context:
space:
mode:
authorBrian Robbins <brianrob@microsoft.com>2015-04-13 16:18:16 -0700
committerBrian Robbins <brianrob@microsoft.com>2015-04-22 08:47:12 -0700
commite406060ba14e532d964dbe64be23afe1b510aa6f (patch)
treea3b5c1719a6270da2ce9ee49548a164b190c3f40 /src/vm/perfmap.h
parent1426853c339e0c101e9301bf442c94e2afb7555f (diff)
downloadcoreclr-e406060ba14e532d964dbe64be23afe1b510aa6f.tar.gz
coreclr-e406060ba14e532d964dbe64be23afe1b510aa6f.tar.bz2
coreclr-e406060ba14e532d964dbe64be23afe1b510aa6f.zip
Adds support for resolving JIT compiled managed call frames in perf_events.
Diffstat (limited to 'src/vm/perfmap.h')
-rw-r--r--src/vm/perfmap.h49
1 files changed, 49 insertions, 0 deletions
diff --git a/src/vm/perfmap.h b/src/vm/perfmap.h
new file mode 100644
index 0000000000..e0539150fc
--- /dev/null
+++ b/src/vm/perfmap.h
@@ -0,0 +1,49 @@
+//
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+//
+// ===========================================================================
+// File: perfmap.h
+//
+#ifndef PERFPID_H
+#define PERFPID_H
+
+#include "sstring.h"
+#include "fstream.h"
+
+class PerfMap
+{
+private:
+ // The one and only PerfMap for the process.
+ static PerfMap * s_Current;
+
+ // The file stream to write the map to.
+ CFileStream * m_FileStream;
+
+ // Set to true if an error is encountered when writing to the file.
+ bool m_ErrorEncountered;
+
+ // Construct a new map.
+ PerfMap(int pid);
+
+ // Clean-up resources.
+ ~PerfMap();
+
+ // Does the actual work to log to the map.
+ void Log(MethodDesc * pMethod, PCODE pCode, size_t codeSize);
+
+ // Does the actual work to close and flush the map.
+ void Close();
+
+public:
+ // Initialize the map for the current process.
+ static void Initialize();
+
+ // Log a method to the map.
+ static void LogMethod(MethodDesc * pMethod, PCODE pCode, size_t codeSize);
+
+ // Close the map and flush any remaining data.
+ static void Destroy();
+};
+
+#endif // PERFPID_H