Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(92)

Unified Diff: third_party/WebKit/Source/core/inspector/InspectorTraceEvents.cpp

Issue 1624783002: DevTools: Switch to using fast stack iterator to collect stacks during timeline recording. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update profiler tests Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/inspector/InspectorTraceEvents.cpp
diff --git a/third_party/WebKit/Source/core/inspector/InspectorTraceEvents.cpp b/third_party/WebKit/Source/core/inspector/InspectorTraceEvents.cpp
index 675101a641777e58a9c95989725c3d43b9668423..6e625075be436875e3225776fcda42f8fe16e6a7 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorTraceEvents.cpp
+++ b/third_party/WebKit/Source/core/inspector/InspectorTraceEvents.cpp
@@ -33,6 +33,7 @@
#include "wtf/Vector.h"
#include "wtf/text/TextPosition.h"
#include <inttypes.h>
+#include <v8-profiler.h>
#include <v8.h>
namespace blink {
@@ -52,9 +53,12 @@ void setCallStack(TracedValue* value)
traceCategoryEnabled = TRACE_EVENT_API_GET_CATEGORY_GROUP_ENABLED(TRACE_DISABLED_BY_DEFAULT("devtools.timeline.stack"));
if (!*traceCategoryEnabled)
return;
- RefPtr<ScriptCallStack> scriptCallStack = currentScriptCallStack(ScriptCallStack::maxCallStackSizeToCapture);
- if (scriptCallStack)
+ // The CPU profiler stack trace does not include call site line numbers.
+ // So we collect the top frame with the currentScriptCallStack to get the
+ // binding call site info.
+ if (RefPtr<ScriptCallStack> scriptCallStack = currentScriptCallStack(1))
scriptCallStack->toTracedValue(value, "stackTrace");
+ v8::Isolate::GetCurrent()->GetCpuProfiler()->CollectSample();
}
namespace {

Powered by Google App Engine
This is Rietveld 408576698