Skip to content

Commit 270bc08

Browse files
mralephCommit Queue
authored andcommitted
[vm] Exclude timeline from Flutter linux release engine
This undoes size regression introduced commit 489f63a This also exclude timeline from Dart binaries built in PRODUCT mode - but not from PRODUCT AOT runtime built as part of normal SDK. This CL also fixes the build with DART_DISABLE_TIMELINE. TEST=manually by building Linux engine Change-Id: Ie43826ea4150aac6bdb686f37215ba0c6a6a6964 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/459600 Commit-Queue: Slava Egorov <vegorov@google.com> Reviewed-by: Ryan Macnak <rmacnak@google.com>
1 parent 793d8cc commit 270bc08

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

runtime/BUILD.gn

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ config("dart_maybe_product_config") {
3131
}
3232
assert(!dart_debug)
3333
defines += [ "PRODUCT" ]
34+
if (target_os == "linux") {
35+
defines += [ "DART_DISABLE_TIMELINE" ]
36+
}
3437
}
3538
}
3639

runtime/vm/globals.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,11 +114,14 @@ const intptr_t kDefaultNewGenSemiMaxSize = (kWordSize <= 4) ? 8 : 16;
114114
// whenever timeline with perfetto support is included as well as in
115115
// precompiler builds (to enable stack dumping when precompiler crashes).
116116
#if !defined(PRODUCT) || \
117-
(defined(SUPPORT_TIMELINE) && defined(SUPPORT_PERFETTO)) || \
118-
defined(DART_PRECOMPILER)
117+
(defined(SUPPORT_TIMELINE) && defined(SUPPORT_PERFETTO))
119118
#define DART_INCLUDE_PROFILER 1
120119
#endif
121120

121+
#if defined(DART_INCLUDE_PROFILER) || defined(DART_PRECOMPILER)
122+
#define DART_INCLUDE_STACK_DUMPER 1
123+
#endif
124+
122125
// Include IL printer and disassembler functionality into non-PRODUCT builds,
123126
// in all AOT compiler builds or when forced.
124127
#if !defined(PRODUCT) || defined(DART_PRECOMPILER) || \

runtime/vm/profiler.cc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ DEFINE_FLAG(
7070
"the oldest ones. This flag itself does not enable the profiler; the "
7171
"profiler must be enabled separately, e.g. with --profiler.");
7272

73-
#if defined(DART_INCLUDE_PROFILER)
73+
#if defined(DART_INCLUDE_STACK_DUMPER)
7474
ProfilerCounters Profiler::counters_ = {};
7575

7676
static void DumpStackFrame(uword pc, uword fp, const char* name, uword offset) {
@@ -367,6 +367,7 @@ static bool ValidateThreadStackBounds(uintptr_t fp,
367367
return true;
368368
}
369369

370+
#if defined(DART_INCLUDE_PROFILER)
370371
// Get |thread|'s stack boundary and verify that |sp| and |fp| are within
371372
// it. Return |false| if anything looks suspicious.
372373
static bool GetAndValidateThreadStackBounds(OSThread* os_thread,
@@ -410,6 +411,7 @@ static bool GetAndValidateThreadStackBounds(OSThread* os_thread,
410411

411412
return ValidateThreadStackBounds(fp, sp, *stack_lower, *stack_upper);
412413
}
414+
#endif // defined(DART_INCLUDE_PROFILER)
413415

414416
static bool GetAndValidateCurrentThreadStackBounds(uintptr_t fp,
415417
uintptr_t sp,
@@ -600,6 +602,9 @@ void Profiler::DumpStackTrace(uword sp, uword fp, uword pc, bool for_crash) {
600602

601603
DumpCompilerState(thread);
602604
}
605+
#endif // defined(DART_INCLUDE_STACK_DUMPER)
606+
607+
#if defined(DART_INCLUDE_PROFILER)
603608

604609
RelaxedAtomic<bool> Profiler::initialized_ = false;
605610
SampleBlockBuffer* Profiler::sample_block_buffer_ = nullptr;

0 commit comments

Comments
 (0)