Add pseudo/mixed stack support to out of process heap profiling.
This makes OOP HP fully feature compatible with the legacy heap profiling, and
is a first step to removing legacy heap profiling.
The current implementation of pseudo/mixed stacks allows stack frames to contain
a pointer to a static cstring in the TEXT section of the program. The one
exception [which is potentially a bug] is for thread names.
To implement this functionality for OOP HP, I created a new packet type [string
mapping] which describes a mapping between a pointer and a string. This mapping
persists for the lifetime of the process. When a client encounters a new
cstring, it first sends a string mapping packet, and then sends a packet as
usual. The profiling service, when exporting a heap dump, looks up pointers in
its string map and converts back to string if necessary.
The new functionality is available as a command line flag and about://flags
setting as --memlog-stack-mode.
I expanded the test support in ProfilingTestDriver, and removed redundant memlog
e2e tests.
Bug: 758739
Change-Id: I554edb1edbc90dec8f9a77be4b6bbaf19b13fc08
Reviewed-on: https://chromium-review.googlesource.com/850862
Commit-Queue: Erik Chen <[email protected]>
Reviewed-by: Daniel Cheng <[email protected]>
Reviewed-by: Brett Wilson <[email protected]>
Reviewed-by: Albert J. Wong <[email protected]>
Cr-Commit-Position: refs/heads/master@{#528735}
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc
index 44dbac4..181a71e 100644
--- a/chrome/browser/flag_descriptions.cc
+++ b/chrome/browser/flag_descriptions.cc
@@ -514,6 +514,21 @@
"automatically uploaded traces will always be pruned. This only affects "
"manually taken memory-infra traces.";
+const char kOOPHPStackModeName[] =
+ "The type of stack to record for memlog heap dumps";
+const char kOOPHPStackModeDescription[] =
+ "By default, memlog heap dumps record a native stack, which requires "
+ "symbolization. It's also possible to record a pseudo stack using trace "
+ "events as identifiers. It's also possible to do a mix of both.";
+const char kOOPHPStackModeMixed[] =
+ "Record a mix of pseudo and native stack frames";
+const char kOOPHPStackModeNative[] =
+ "Record instruction addresses from unwinding the stack. The result "
+ "requires symbolization. Does not produce valid results on Android on "
+ "official arm32 builds. Requires a custom build with frame pointers "
+ "enabled.";
+const char kOOPHPStackModePseudo[] = "Uses trace events as identifiers";
+
const char kEnablePictureInPictureName[] = "Enable picture in picture.";
const char kEnablePictureInPictureDescription[] =
"Enable the picture in picture feature for videos.";