gecko-dev/memory/replace/dmd
Nicholas Nethercote 88cd51aa6d Bug 1628527 - Introduce explicit initialization and finalization of fix-stacks. r=erahm,perftest-reviewers,sparky,gbrown
Currently AWSY-with-DMD doesn't work on Windows. This is because `fix-stacks`
is initialized lazily, and by the time the initialization happens some file
descriptors for files are open, and that leads to some major Python2-on-Windows
sadness as described in the big comment in the commit.

To fix the problem, this commit adds an `init` function to `fix_stacks.py` so
that `fix-stacks` can be initialized eagerly, hopefully before any file
descriptors for files are open.

For `dmd.py`, other than fixing the AWSY problems, this has little effect,
because `fix-stacks` is always initialized.

For `utils.py`, which is used to process the output of most tests, this has a
more noticeable effect: the `fix-stacks` process is always spawned, rather than
being spawned only when needed. If no stack traces appear in the test output,
this means that `fix-stacks` is spawned unnecessarily. But it's cheap to spawn;
the expensive part only happens when stack traces start getting fixed. So I
think this change in behaviour is acceptable.

Furthermore, the commit adds a `finish` function to `fix_stacks.py`, so that
the `fix-stacks` process can be explicitly shut down. This has never been done
for processes spawned for any of the stack fixing scripts. It's never caused
problems on Linux/Mac, but it seems to be necessary on Windows to avoid
similar "this file is locked" problems with the test_dmd.js test.

The commit also renames some things to more standard Python style, e.g.
`json_mode` instead of `jsonMode`.

Finally, Android tests use `utils.py` from the repository but `fix_stacks.py`
from the Android host utils. Because the two scripts must be updated in tandem,
this commit also updates the Android host utils to a version that contains the
updated `fix_stacks.py`. Thanks to aerickson for packaging up the new Android
host utils and providing the change to the `hostutils.manifest` file.

Differential Revision: https://phabricator.services.mozilla.com/D69478
2020-04-20 22:43:25 +00:00
..
test Bug 1615588 - Updated prompt tests. r=marionette-reviewers,johannh,whimboo 2020-04-16 14:44:56 +00:00
block_analyzer.py Bug 1623508 - Print out original argument on error in block_analyzer. r=njn 2020-03-19 00:21:34 +00:00
DMD.cpp Bug 1053379 - Simplify CodeAddressService so non-DMD users can rely on defaults. r=njn 2019-08-06 21:58:12 +00:00
DMD.h Bug 1619840 - Remove fix_{linux,macosx}_stack.py and fix_stack_using_bpsyms.py. r=erahm 2020-04-08 06:55:54 +00:00
dmd.py Bug 1628527 - Introduce explicit initialization and finalization of fix-stacks. r=erahm,perftest-reviewers,sparky,gbrown 2020-04-20 22:43:25 +00:00
moz.build Bug 1571505 - Properly add dbghelp where needed. r=nalexander 2019-08-06 18:14:12 +00:00
README

This is DMD.  See https://wiki.mozilla.org/Performance/MemShrink/DMD for
details on how to use it.