| commit | 4d76b821a989514c6619928b94f0a28597cec282 | [log] [tgz] |
|---|---|---|
| author | Przemyslaw Pietrzkiewicz <ppi@chromium.org> | Mon Sep 07 14:05:44 2015 +0200 |
| committer | Przemyslaw Pietrzkiewicz <ppi@chromium.org> | Mon Sep 07 14:05:44 2015 +0200 |
| tree | 4e42e5a705d101bba96aec2ca8852686bb98f943 | |
| parent | 62541a9fb8065c2ebdd792a9832df64cc71230c8 [diff] |
Teach mojo_benchmark to control caching conditions. This patch makes mojo_benchmark run each benchmark twice, first with a flushed cache and again without clearing the cache, yielding cold start and warm start results. This currently supports only flushing the url_response_disk_cache, we will want to clear the network service cache too. R=qsr@google.com Review URL: https://codereview.chromium.org/1320403003 . Cr-Mirrored-From: https://github.com/domokit/mojo Cr-Mirrored-Commit: 152015f44e134512ba45524e562c7c547b28886d
Unopinionated tools for running, debugging and testing Mojo apps.
git clone https://github.com/domokit/devtools.git
Devtools offers the following tools:
mojo_run - shell runnermojo_test - apptest runnermojo_debug - debugger supporting interactive tracing and debugging of a running mojo shellAdditionally, remote_adb_setup script helps to configure adb on a remote machine to communicate with a device attached to a local machine, forwarding the ports used by mojo_run.
mojo_run allows you to run a Mojo shell either on the host, or on an attached Android device.
mojo_run APP_URL # Run on the host. mojo_run APP_URL --android # Run on Android device. mojo_run "APP_URL APP_ARGUMENTS" # Run an app with startup arguments
Unless running within a Mojo checkout, we need to indicate the path to the shell binary:
mojo_run --shell-path path/to/shell/binary APP_URL
Some applications are meant to be run embedded in a window manager. To run these, you can pass the app url using the --embed flag. This will run the window manager and pass the given url to it:
mojo_run --embed APP_URL [--android]
By default, mojo_run uses https://core.mojoapps.io/kiosk_wm.mojo as the window manager. You can pass a different window manager url using the --window-manager flag to override this.
mojo_debug allows you to interactively inspect a running shell, collect performance traces and attach a gdb debugger.
Performance traces can either be collected by Mojo Shell during its startup, or collected interactively by mojo_debug.
To trace the Mojo Shell startup, use the --trace-startup flag:
mojo_run --trace-startup APP_URL [--android]
In order to collect traces interactively through mojo_debug, make sure that the app being inspected was run with --debugger switch. E.g.:
mojo_run --debugger APP_URL [--android]
While Mojo Shell is running, tracing can be started and stopped by these two commands respectively:
mojo_debug tracing start mojo_debug tracing stop [result.json]
Trace files can be then loaded using the trace viewer in Chrome available at about://tracing.
It is possible to inspect a Mojo Shell process using GDB. The mojo_debug script can be used to launch GDB and attach it to a running shell process (android only):
mojo_debug gdb attach
Once started, GDB will first stop the Mojo Shell execution, then load symbols from loaded Mojo applications. Please note that this initial step can take some time (up to several minutes in the worst case).
After each execution pause, GDB will update the set of loaded symbols based on the selected thread only. If you need symbols for all threads, use the update-symbols GDB command:
(gdb) update-symbols
If you only want to update symbols for the current selected thread (for example, after changing threads), use the current option:
(gdb) update-symbols current
If you want to debug the startup of your application, you can pass --wait-for-debugger to mojo_run to have the Mojo Shell stop and wait to be attached by gdb before continuing.
When Mojo shell crashes on Android (“Unfortunately, Mojo shell has stopped.”) due to a crash in native code, mojo_debug can be used to find and symbolize the stack trace present in the device log:
mojo_debug device stack
The library is canonically developed in the mojo repository, https://github.com/domokit/devtools is a mirror allowing to consume it separately.