From 8ac662eb4dddde40b0ecfe278ea7fb55b580e4a8 Mon Sep 17 00:00:00 2001
From: Peter Marshall
Date: Mon, 30 Jul 2018 13:54:55 +0200
Subject: deps: backport 4 CPU profiler commits from upstream V8
[cpu-profiler] Add a new profiling mode with a more detailed call tree.
https://chromium.googlesource.com/v8/v8.git/+/ecae80cdb350dde1e654c531b56f5b6c44dc8c77
[cpu-profiler] Reuse free slots in code_entries_
https://chromium.googlesource.com/v8/v8.git/+/3e1126bf15e62c433c4e9cb21316d182f691c63a
[cpu-profiler] Only store deopt inline frames for functions that need it
https://chromium.googlesource.com/v8/v8.git/+/0bfcbdd4726920755e51dab28c18ab93e050819b
[cpu-profiler] Use instruction start as the key for the CodeMap
https://chromium.googlesource.com/v8/v8.git/+/ba752ea4c50713dff1e94f45a79db3ba968a8d66
PR-URL: https://github.com/nodejs/node/pull/22028
Reviewed-By: Ruben Bridgewater
Reviewed-By: Benedikt Meurer
---
deps/v8/include/v8-profiler.h | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
(limited to 'deps/v8/include')
diff --git a/deps/v8/include/v8-profiler.h b/deps/v8/include/v8-profiler.h
index bcb53f1446..af36aa6d2d 100644
--- a/deps/v8/include/v8-profiler.h
+++ b/deps/v8/include/v8-profiler.h
@@ -277,6 +277,16 @@ class V8_EXPORT CpuProfile {
void Delete();
};
+enum CpuProfilingMode {
+ // In the resulting CpuProfile tree, intermediate nodes in a stack trace
+ // (from the root to a leaf) will have line numbers that point to the start
+ // line of the function, rather than the line of the callsite of the child.
+ kLeafNodeLineNumbers,
+ // In the resulting CpuProfile tree, nodes are separated based on the line
+ // number of their callsite in their parent.
+ kCallerLineNumbers,
+};
+
/**
* Interface for controlling CPU profiling. Instance of the
* profiler can be created using v8::CpuProfiler::New method.
@@ -320,6 +330,13 @@ class V8_EXPORT CpuProfiler {
* |record_samples| parameter controls whether individual samples should
* be recorded in addition to the aggregated tree.
*/
+ void StartProfiling(Local title, CpuProfilingMode mode,
+ bool record_samples = false);
+ /**
+ * The same as StartProfiling above, but the CpuProfilingMode defaults to
+ * kLeafNodeLineNumbers mode, which was the previous default behavior of the
+ * profiler.
+ */
void StartProfiling(Local title, bool record_samples = false);
/**
--
cgit v1.2.3