Make heap snapshot string limit configurable.
R=ulan@chromium.org Bug: v8:7402 Change-Id: Ia9d79723ebf63d30528b0d8e639555d08be38531 Reviewed-on: https://chromium-review.googlesource.com/899063 Reviewed-by: Alexei Filippov <alph@chromium.org> Reviewed-by: Ulan Degenbaev <ulan@chromium.org> Commit-Queue: Yang Guo <yangguo@chromium.org> Cr-Commit-Position: refs/heads/master@{#51226}
This commit is contained in:
parent
8d1b4374c0
commit
c9e22a982e
@ -917,6 +917,8 @@ DEFINE_BOOL(heap_profiler_trace_objects, false,
|
||||
"Dump heap object allocations/movements/size_updates")
|
||||
DEFINE_BOOL(heap_profiler_use_embedder_graph, true,
|
||||
"Use the new EmbedderGraph API to get embedder nodes")
|
||||
DEFINE_INT(heap_snapshot_string_limit, 1024,
|
||||
"truncate strings to this length in the heap snapshot")
|
||||
|
||||
// sampling-heap-profiler.cc
|
||||
DEFINE_BOOL(sampling_heap_profiler_suppress_randomness, false,
|
||||
|
@ -80,7 +80,7 @@ const char* StringsStorage::GetVFormatted(const char* format, va_list args) {
|
||||
const char* StringsStorage::GetName(Name* name) {
|
||||
if (name->IsString()) {
|
||||
String* str = String::cast(name);
|
||||
int length = Min(kMaxNameSize, str->length());
|
||||
int length = Min(FLAG_heap_snapshot_string_limit, str->length());
|
||||
int actual_length = 0;
|
||||
std::unique_ptr<char[]> data = str->ToCString(
|
||||
DISALLOW_NULLS, ROBUST_STRING_TRAVERSAL, 0, length, &actual_length);
|
||||
|
@ -31,8 +31,6 @@ class StringsStorage {
|
||||
const char* GetFunctionName(const char* name);
|
||||
|
||||
private:
|
||||
static const int kMaxNameSize = 1024;
|
||||
|
||||
static bool StringsMatch(void* key1, void* key2);
|
||||
const char* AddOrDisposeString(char* str, int len);
|
||||
base::CustomMatcherHashMap::Entry* GetEntry(const char* str, int len);
|
||||
|
Loading…
Reference in New Issue
Block a user