Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Adam Duskett <adam.duskett@amarulasolutions.com>
To: buildroot@buildroot.org
Cc: Adam Duskett <adam.duskett@amarulasolutions.com>
Subject: [Buildroot] [PATCH/next v2 4/9] package/flutter-engine: Add profile runtime mode selection
Date: Sat, 18 Nov 2023 15:12:00 -0700	[thread overview]
Message-ID: <20231118221206.1369389-4-adam.duskett@amarulasolutions.com> (raw)
In-Reply-To: <20231118221206.1369389-1-adam.duskett@amarulasolutions.com>

There are only two possible modes for Flutter: Debug and release. However,
there is a third mode available to users: profile.

As Flutter projects can be pretty heavy and consume a lot of resources, it is
necessary to allow users to profile their Flutter application during
development.

Add a new choice: FLUTTER_ENGINE_RUNTIME_MODE_PROFILE. If unselected, the
global option BR2_ENABLE_RUNTIME_DEBUG determines whether to build Flutter
in release or debug mode.

Signed-off-by: Adam Duskett <adam.duskett@amarulasolutions.com>
---
v1 -> v2: Only add the profile option and rely on the global
          BR2_ENABLE_RUNTIME_DEBUG option for release and debug [Yann]

 package/flutter-engine/Config.in         | 25 ++++++++++++++++++++++++
 package/flutter-engine/flutter-engine.mk |  4 +++-
 2 files changed, 28 insertions(+), 1 deletion(-)

diff --git a/package/flutter-engine/Config.in b/package/flutter-engine/Config.in
index 2ec5b90ffd..3c92e40f74 100644
--- a/package/flutter-engine/Config.in
+++ b/package/flutter-engine/Config.in
@@ -39,6 +39,31 @@ config BR2_PACKAGE_FLUTTER_ENGINE
 
 	  https://github.com/flutter/engine
 
+if BR2_PACKAGE_FLUTTER_ENGINE
+
+config FLUTTER_ENGINE_RUNTIME_MODE_PROFILE
+	bool "enable profiling"
+	help
+	  Some debugging ability is maintained—enough to profile your
+	  apps performance. Profile mode is disabled on the emulator
+	  and simulator, because their behavior is not representative
+	  of real performance. Profile mode is similar to release mode,
+	  with the following differences:
+
+	  - Some service extensions, such as the one that enables the
+	    performance overlay, are enabled.
+
+	  - Tracing is enabled, and tools supporting source-level
+	    debugging (such as DevTools) can connect to the process.
+
+	  If this option is left unselected, the global option
+	  BR2_ENABLE_RUNTIME_DEBUG determines whether to build Flutter
+	  in release or debug mode.
+
+	  https://docs.flutter.dev/testing/build-modes#profile
+
+endif
+
 comment "flutter-engine needs an OpenGL or OpenGLES backend"
 	depends on BR2_PACKAGE_FLUTTER_ENGINE_ARCH_SUPPORTS
 	depends on !BR2_PACKAGE_HAS_LIBGL && !BR2_PACKAGE_HAS_LIBGLES
diff --git a/package/flutter-engine/flutter-engine.mk b/package/flutter-engine/flutter-engine.mk
index 58ebda5ca9..d0ce792c44 100644
--- a/package/flutter-engine/flutter-engine.mk
+++ b/package/flutter-engine/flutter-engine.mk
@@ -52,7 +52,9 @@ FLUTTER_ENGINE_TARGET_ARCH = x64
 FLUTTER_ENGINE_TARGET_TRIPPLE = x86_64-unknown-linux-gnu
 endif
 
-ifeq ($(BR2_ENABLE_RUNTIME_DEBUG),y)
+ifeq ($(FLUTTER_ENGINE_RUNTIME_MODE_PROFILE),y)
+FLUTTER_ENGINE_RUNTIME_MODE=profile
+else ifeq ($(BR2_ENABLE_RUNTIME_DEBUG),y)
 FLUTTER_ENGINE_RUNTIME_MODE=debug
 else
 FLUTTER_ENGINE_RUNTIME_MODE=release
-- 
2.42.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

  parent reply	other threads:[~2023-11-18 22:12 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-18 22:11 [Buildroot] [PATCH/next v2 1/9] package/xdg-user-dirs: new package Adam Duskett
2023-11-18 22:11 ` [Buildroot] [PATCH/next v2 2/9] package/flutter-sdk-bin: bump version to 3.16.0 Adam Duskett
2023-11-18 22:11 ` [Buildroot] [PATCH/next v2 3/9] package/flutter-engine: " Adam Duskett
2023-11-18 22:12 ` Adam Duskett [this message]
2023-11-18 22:12 ` [Buildroot] [PATCH/next v2 5/9] package/flutter-sdk-bin/Config.in.host: add pub-cache location option Adam Duskett
2023-11-19  8:21   ` Yann E. MORIN
2023-11-19 17:47     ` Adam Duskett
2023-11-19 19:45       ` Yann E. MORIN
2023-11-19 20:41         ` Arnout Vandecappelle via buildroot
2023-11-19 20:43   ` Arnout Vandecappelle via buildroot
2023-11-19 21:08     ` Adam Duskett
2023-11-19 21:53       ` Yann E. MORIN
2023-11-20 16:40         ` Adam Duskett

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231118221206.1369389-4-adam.duskett@amarulasolutions.com \
    --to=adam.duskett@amarulasolutions.com \
    --cc=buildroot@buildroot.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox