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

Side by Side Diff: runtime/vm/malloc_hooks_test.cc

Issue 2771293003: Resubmission of native memory allocation info surfacing in Observatory. Fixed crashing tests and st… (Closed)
Patch Set: Added page to Observatory to display native memory allocation information. Created 3 years, 8 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 unified diff | Download patch
« no previous file with comments | « runtime/vm/malloc_hooks_mips.cc ('k') | runtime/vm/malloc_hooks_unsupported.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "platform/globals.h" 5 #include "platform/globals.h"
6 6
7 #if defined(DART_USE_TCMALLOC) && !defined(PRODUCT) && \ 7 #if defined(DART_USE_TCMALLOC) && !defined(PRODUCT) && \
8 !defined(TARGET_ARCH_DBC) && !defined(HOST_OS_FUCHSIA) 8 !defined(TARGET_ARCH_DBC) && !defined(HOST_OS_FUCHSIA)
9 9
10 #include "platform/assert.h" 10 #include "platform/assert.h"
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 (helper_start_address <= address) && (helper_end_address >= address); 149 (helper_start_address <= address) && (helper_end_address >= address);
150 EXPECT(first_result); 150 EXPECT(first_result);
151 address = sample->At(1); 151 address = sample->At(1);
152 bool second_result = 152 bool second_result =
153 (test_start_address <= address) && (test_end_address >= address); 153 (test_start_address <= address) && (test_end_address >= address);
154 EXPECT(second_result); 154 EXPECT(second_result);
155 155
156 if (!(first_result && second_result)) { 156 if (!(first_result && second_result)) {
157 OS::PrintErr( 157 OS::PrintErr(
158 "If this test is failing, it's likely that the value set for" 158 "If this test is failing, it's likely that the value set for"
159 "the number of frames to skip in malloc_hooks.cc is " 159 " the number of frames to skip in malloc_hooks.cc is "
160 "incorrect for this configuration/platform. This value can be" 160 "incorrect for this configuration/platform. This value can be"
161 " found in malloc_hooks.cc in the AllocationInfo class, and " 161 " found in malloc_hooks.cc in the AllocationInfo class, and "
162 "is stored in the kSkipCount constant."); 162 "is stored in the kSkipCount constant.\n");
163 OS::PrintErr("First result: %d Second Result: %d\n", first_result,
164 second_result);
165 OS::PrintErr("Dumping sample stack trace:\n");
166 sample->DumpStackTrace();
163 } 167 }
164 168
165 free(var); 169 free(var);
166 MallocHooks::TearDown(); 170 MallocHooks::TearDown();
167 MallocHooks::set_stack_trace_collection_enabled(enable_stack_traces_saved); 171 MallocHooks::set_stack_trace_collection_enabled(enable_stack_traces_saved);
168 FLAG_enable_malloc_hooks = enable_malloc_hooks_saved; 172 FLAG_enable_malloc_hooks = enable_malloc_hooks_saved;
169 } 173 }
170 174
171 175
172 ISOLATE_UNIT_TEST_CASE(StackTraceMallocHookSimpleJSONTest) { 176 ISOLATE_UNIT_TEST_CASE(StackTraceMallocHookSimpleJSONTest) {
(...skipping 27 matching lines...) Expand all
200 204
201 free(var); 205 free(var);
202 MallocHooks::TearDown(); 206 MallocHooks::TearDown();
203 MallocHooks::set_stack_trace_collection_enabled(enable_stack_traces_saved); 207 MallocHooks::set_stack_trace_collection_enabled(enable_stack_traces_saved);
204 FLAG_enable_malloc_hooks = enable_malloc_hooks_saved; 208 FLAG_enable_malloc_hooks = enable_malloc_hooks_saved;
205 } 209 }
206 210
207 }; // namespace dart 211 }; // namespace dart
208 212
209 #endif // defined(DART_USE_TCMALLOC) && !defined(PRODUCT) 213 #endif // defined(DART_USE_TCMALLOC) && !defined(PRODUCT)
OLDNEW
« no previous file with comments | « runtime/vm/malloc_hooks_mips.cc ('k') | runtime/vm/malloc_hooks_unsupported.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698