Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono-tools.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMassimiliano Mantione <massi@mono-cvs.ximian.com>2008-10-10 18:20:42 +0400
committerMassimiliano Mantione <massi@mono-cvs.ximian.com>2008-10-10 18:20:42 +0400
commit348248edb15c4370a7fca451cda2da070ad4fe46 (patch)
treed1d284b3803454592801e875778a0320b0dc676c /Mono.Profiler
parent198a8665153aadb61b6ab4d91881dc22509f6742 (diff)
Add "jit time support" to the call stack.
svn path=/trunk/mono-tools/; revision=115433
Diffstat (limited to 'Mono.Profiler')
-rw-r--r--Mono.Profiler/profiler-decoder-library/ChangeLog4
-rw-r--r--Mono.Profiler/profiler-decoder-library/EventProcessor.cs3
-rw-r--r--Mono.Profiler/profiler-decoder-library/ObjectModel.cs43
3 files changed, 41 insertions, 9 deletions
diff --git a/Mono.Profiler/profiler-decoder-library/ChangeLog b/Mono.Profiler/profiler-decoder-library/ChangeLog
index 74e35833..6ff74049 100644
--- a/Mono.Profiler/profiler-decoder-library/ChangeLog
+++ b/Mono.Profiler/profiler-decoder-library/ChangeLog
@@ -1,3 +1,7 @@
+2008-09-17 Massimiliano Mantione <massi@ximian.com>
+ * ObjectModel.cs: Add "jit time support" to the call stack.
+ * EventProcessor.cs: Likewise.
+
2008-08-21 Massimiliano Mantione <massi@ximian.com>
* BaseTypes.cs: Added support for correct accounting of allocations
which happened at JIT time.
diff --git a/Mono.Profiler/profiler-decoder-library/EventProcessor.cs b/Mono.Profiler/profiler-decoder-library/EventProcessor.cs
index c3eb08ed..65c76b52 100644
--- a/Mono.Profiler/profiler-decoder-library/EventProcessor.cs
+++ b/Mono.Profiler/profiler-decoder-library/EventProcessor.cs
@@ -211,6 +211,7 @@ namespace Mono.Profiler {
if (caller == null) {
if ((stack != null) && (stack.StackTop != null)) {
caller = stack.StackTop.Method;
+ jitTime = stack.StackTop.IsBeingJitted;
}
}
c.InstanceCreated (size, caller, jitTime);
@@ -228,10 +229,12 @@ namespace Mono.Profiler {
public override void MethodJitStart (LoadedMethod m, ulong counter) {
m.StartJit = counter;
+ stack.MethodJitStart (m, counter);
}
public override void MethodJitEnd (LoadedMethod m, ulong counter, bool success) {
m.JitClicks += (counter - m.StartJit);
+ stack.MethodJitEnd (m, counter);
}
public override void MethodFreed (LoadedMethod m, ulong counter) {}
diff --git a/Mono.Profiler/profiler-decoder-library/ObjectModel.cs b/Mono.Profiler/profiler-decoder-library/ObjectModel.cs
index 737b5763..23a3d2b2 100644
--- a/Mono.Profiler/profiler-decoder-library/ObjectModel.cs
+++ b/Mono.Profiler/profiler-decoder-library/ObjectModel.cs
@@ -178,6 +178,15 @@ namespace Mono.Profiler {
startCounter = value;
}
}
+ bool isBeingJitted;
+ public bool IsBeingJitted {
+ get {
+ return isBeingJitted;
+ }
+ internal set {
+ isBeingJitted = value;
+ }
+ }
StackFrame caller;
public StackFrame Caller {
get {
@@ -198,25 +207,27 @@ namespace Mono.Profiler {
level = (caller != null) ? (caller.Level + 1) : 1;
}
- internal StackFrame (LoadedMethod method, ulong startCounter, StackFrame caller) {
+ internal StackFrame (LoadedMethod method, ulong startCounter, bool isBeingJitted, StackFrame caller) {
this.method = method;
this.startCounter = startCounter;
+ this.isBeingJitted = isBeingJitted;
this.caller = caller;
SetLevel ();
}
static StackFrame freeFrames = null;
- internal static StackFrame FrameFactory (LoadedMethod method, ulong startCounter, StackFrame caller) {
+ internal static StackFrame FrameFactory (LoadedMethod method, ulong startCounter, bool isBeingJitted, StackFrame caller) {
if (freeFrames != null) {
StackFrame result = freeFrames;
freeFrames = result.Caller;
result.Method = method;
result.startCounter = startCounter;
+ result.isBeingJitted = isBeingJitted;
result.Caller = caller;
result.SetLevel ();
return result;
} else {
- return new StackFrame (method, startCounter, caller);
+ return new StackFrame (method, startCounter, isBeingJitted, caller);
}
}
internal static void FreeFrame (StackFrame frame) {
@@ -245,28 +256,42 @@ namespace Mono.Profiler {
}
}
- internal void MethodEnter (LoadedMethod method, ulong counter) {
- stackTop = StackFrame.FrameFactory (method, counter, stackTop);
- }
- internal void MethodExit (LoadedMethod method, ulong counter) {
+ void PopMethod (LoadedMethod method, ulong counter, bool isBeingJitted) {
while (stackTop != null) {
LoadedMethod topMethod = stackTop.Method;
+ bool topMethodIsBeingJitted = stackTop.IsBeingJitted;
StackFrame callerFrame = stackTop.Caller;
LoadedMethod callerMethod = (callerFrame != null)? callerFrame.Method : null;
- topMethod.MethodCalled (counter - stackTop.StartCounter, callerMethod);
+ if (! topMethodIsBeingJitted) {
+ topMethod.MethodCalled (counter - stackTop.StartCounter, callerMethod);
+ }
StackFrame.FreeFrame (stackTop);
stackTop = callerFrame;
- if (topMethod == method) {
+ if ((topMethod == method) && (topMethodIsBeingJitted == isBeingJitted)) {
return;
}
}
}
+
+ internal void MethodEnter (LoadedMethod method, ulong counter) {
+ stackTop = StackFrame.FrameFactory (method, counter, false, stackTop);
+ }
+ internal void MethodExit (LoadedMethod method, ulong counter) {
+ PopMethod (method, counter, false);
+ }
internal void TopMethodExit (ulong counter) {
MethodExit (stackTop.Method, counter);
}
+ internal void MethodJitStart (LoadedMethod method, ulong counter) {
+ stackTop = StackFrame.FrameFactory (method, counter, true, stackTop);
+ }
+ internal void MethodJitEnd (LoadedMethod method, ulong counter) {
+ PopMethod (method, counter, true);
+ }
+
internal CallStack (ulong threadId) {
this.threadId = threadId;
stackTop = null;