Commit Graph

47 Commits

Author SHA1 Message Date
Nicholas Nethercote
c423f95668 Bug 1499907 - Add a jsonEscape argument to fixSymbols. r=erahm
So that dmd.py isn't broken by function names that, after stack fixing, contain
escape-worthy chars such as " and /.
2018-11-21 10:28:00 +11:00
Eric Rahm
b1413b551b Bug 1409739 - Part 1: Accept SmokeDMD when filtering test DMD stacks. r=njn
On some builds we only get 'SmokeDMD' references during testing rather than a full file path. This adds 'SmokeDMD' to the acceptable frame description list.
2018-10-01 16:38:17 -07:00
Cosmin Sabou
27c9274b42 Backed out 3 changesets (bug 1409739) for causing Linux x64 ccov & fuzzing bustages. a=backout
Backed out changeset 387f946c7c48 (bug 1409739)
Backed out changeset 617288a6b2d9 (bug 1409739)
Backed out changeset fcdc1d5eaf1a (bug 1409739)
2018-10-03 20:29:42 +03:00
Eric Rahm
95e7cfedf3 Bug 1409739 - Part 1: Accept SmokeDMD when filtering test DMD stacks. r=njn
On some builds we only get 'SmokeDMD' references during testing rather than a full file path. This adds 'SmokeDMD' to the acceptable frame description list.
2018-10-01 16:38:17 -07:00
Coroiu Cristina
4ee6d0ac9e Backed out 3 changesets (bug 1409739) for xpcshell failures at memory/replace/dmd/test/test_dmd.js
Backed out changeset dc3c5143ba4e (bug 1409739)
Backed out changeset e37ea5eb932a (bug 1409739)
Backed out changeset d39c2dfcc700 (bug 1409739)
2018-10-03 02:07:19 +03:00
Eric Rahm
790d5c4016 Bug 1409739 - Part 1: Accept SmokeDMD when filtering test DMD stacks. r=njn
On some builds we only get 'SmokeDMD' references during testing rather than a full file path. This adds 'SmokeDMD' to the acceptable frame description list.
2018-10-01 16:38:17 -07:00
Gurzau Raul
e1763a61fb Backed out 3 changesets (bug 1409739) for failing at /dmd/test/test_dmd.js on a CLOSED TREE
Backed out changeset 39c8abcf9cb2 (bug 1409739)
Backed out changeset c0da83c08b62 (bug 1409739)
Backed out changeset 1192c15fc934 (bug 1409739)
2018-10-02 18:43:32 +03:00
Eric Rahm
d8435fee96 Bug 1409739 - Part 1: Accept SmokeDMD when filtering test DMD stacks. r=njn
On some builds we only get 'SmokeDMD' references during testing rather than a full file path. This adds 'SmokeDMD' to the acceptable frame description list.
2018-10-01 16:38:17 -07:00
Eric Rahm
91db97a03d Bug 1470268 - Add allocation filter to dmd.py. r=njn
This adds an '--allocation-filter' param that can be used to limit output to
only allocations that include the filter in their stack. For example:
  dmd.py --allocation-filter fontconfig dmd.json.gz
limits its output to just allocations that have an instance of 'fontconfig' in
in one of their stack frames.
2018-06-20 13:11:50 -07:00
Sylvestre Ledru
a9c291ac34 Bug 1464869 - Fix flake8/pep8 issue by hand in memory/ r=njn
MozReview-Commit-ID: 8bkhAB4g6rv
2018-05-25 23:27:02 -07:00
Sylvestre Ledru
fca21b5bcc Bug 1464869 - Run autopep8 on memory/ r=njn
MozReview-Commit-ID: GzFGXZ8WLX5
2018-05-25 23:16:07 -07:00
Mike Hommey
cefc0cb9e6 Bug 1423114 - Remove moz_xposix_memalign and moz_xvalloc. r=njn
They are both infallible wrappers of posix_memalign and valloc.
There is also moz_xmemalign, which wraps memalign, which is mostly
always available as of bug 1402647.

None of them are actually used, but it's still desirable to at least
have one infallible variant, so keep moz_xmemalign and remove the other
two.

While here, we actually make both memalign and moz_xmemalign always
available.
2017-12-05 17:34:19 +09:00
Narcis Beleuzu
f7f7d94a91 Backed out changeset 8a4050c7e0fd (bug 1423114) for bustages on memory/mozalloc/mozalloc.cpp r=backout on a CLOSED TREE 2017-12-06 00:27:11 +02:00
Mike Hommey
45528a9e9e Bug 1423114 - Remove moz_xposix_memalign and moz_xvalloc. r=njn
They are both infallible wrappers of posix_memalign and valloc.
There is also moz_xmemalign, which wraps memalign, which is always
available as of bug 1402647.

None of them are actually used, but it's still desirable to at least
have one infallible variant, so keep moz_xmemalign and remove the other
two.

While here, we actually make moz_xmemalign always available, since
memalign is always available.
2017-12-05 17:34:19 +09:00
Nicholas Nethercote
4e99065a7a Bug 1387940 - Make --max-frames=8 the default for dmd.py. r=mccr8.
The current default is 24, which is equal to the maximum number of stack frames
that DMD will record. And that's a terrible value because it splits up too many
related stack traces into separate records. There is no single best value, but
8 is a much better default.
2017-08-07 14:56:15 +10:00
Nicholas Nethercote
8471aee532 Bug 1260329 - Properly escape the frameTable when running |dmd.py --clamp-contents|. r=mccr8. 2016-03-29 13:34:57 +11:00
Nicholas Nethercote
ff76c7b6be Bug 1253512 (part 1) - Overhaul DMD's "sampling". r=erahm.
DMD currently uses a very hacky form of "sampling" by default to avoid
recording stack traces for all blocks. This makes DMD run faster than when it
records all stack traces.

This patch changes the sampling method used; in fact, it avoids "sampling" at
all. The existence of all heap blocks is now recorded exactly, but by default
we only record an allocation stack for each heap block if a Bernoulli trial
succeeds. This choice works well because getting the stack trace is ~100x
slower than recording the block's existence.

Overall, this approach is simpler and it also gives better output -- the choice
of which blocks to record allocation stacks for is mathematically sound, no
stack trace gets blamed for allocations it didn't do, and block counts and
sizes are now always exact.

Other specific things changed.

- All notion of sampling is removed from the various data structures.

- The --sample-below option is removed in favour of --stacks={partial,full}.

- The format of the JSON output file has changed.

- The names of various test files have changed to reflect concept changes.
2016-02-24 14:42:22 +11:00
Andrew McCreight
4d6f7d4b52 Bug 1058178, part 2 - Implement address clamping analysis for DMD scan logs. r=njn
This adds a new option --clamp-contents to dmd.py. This replaces every value
contained in the memory contents in the log with a pointer to the start of a live
block, if the value is a pointer into the middle of that block. All other values
are replaced with 0. This conservative analysis makes it easier to determine
which blocks point to other blocks.
2015-06-30 11:54:15 -07:00
Andrew McCreight
556ea5c728 Bug 1058178, part 1 - Implement DMD heap scanning mode. r=njn
This implements a new "scan" mode for DMD that records the address
and contents of every live unsampled block in the DMD log. This
enables the low-level analysis of references from one block to
another, which can help leak investigations.
2015-06-30 11:54:15 -07:00
Mike Hommey
4d93988786 Bug 1134923 - Remove NS_Alloc/NS_Realloc/NS_Free. r=nfroyd
They are kept around for the sake of the standalone glue, which is used
for e.g. webapprt, which doesn't have direct access to jemalloc, and thus
still needs a wrapper to go through the xpcom function list and get to
jemalloc from there.
2015-05-01 09:40:30 +09:00
Nicholas Nethercote
175ee20d94 Bug 1121830 - DMD: add "num" property to blocks in the output. r=mccr8.
The new "num" property lets identical blocks be aggregated in the output. This
patch only uses the "num" property for dead blocks, because that's where the
greatest potential benefit lies, but it could be used for live blocks as well.

On one test case (a complex PDF file) running with --mode=cumulative
--sample-below=1 this patch had the following effects.

- Change in running speed was negligible.

- Compressed output file size dropped from 8.8 to 5.0 MB.

- Compressed output file size dropped from 297 to 50 MB.

- dmd.py runtime (without stack fixing) dropped from 30 to 8 seconds.
2015-01-15 20:38:38 -08:00
Nicholas Nethercote
0e5f1d058a Bug 1112968 - dmd.py: Tweak the --alloc-fns list for better effect on Windows. r=mccr8. 2014-12-18 18:59:53 -08:00
Nicholas Nethercote
14fbd0e896 Bug 1112968 - dmd.py: Tweak the --alloc-fns list for better effect on Mac. r=mccr8. 2014-12-17 19:10:59 -08:00
Nicholas Nethercote
b6bbde9078 Bug 1110455 - Add --sort-by=num-blocks option to dmd.py. r=mccr8. 2014-12-15 15:04:39 -08:00
Nicholas Nethercote
327fd8b037 Bug 1111419 - dmd.py: add a cache for recordKeyParts. r=mccr8.
This reduces the runtime on my Linux machine for one large DMD output file from
235 seconds to 105 seconds.
2014-12-15 15:04:34 -08:00
Nicholas Nethercote
fc52cc1d2d Bug 1100851 - Print the mode in dmd.py's output. r=mccr8. 2014-12-10 13:33:50 -08:00
Nicholas Nethercote
84279946f2 Bug 1100851 - Tweak DMD to account for the fact that $DMD can now be undefined. r=glandium.
Now that defining $DMD is no longer necessary to run DMD, this patch does the
following.
- Removes all the places where we set DMD=1 (test harnesses, etc.)
- Still handles DMD=1, for backwards compatibility.
- Prints "$DMD is undefined" at DMD start-up if appropriate.
- Writes a |null| value for |dmdEnvVar| in the JSON if $DMD is undefined. Bumps
  the DMD output version number accordingly.
- Changes a bunch of the test files accordingly, including changing the mode of
  script-ignore-alloc-fns.json in order to test a case where $DMD is undefined.
2014-11-27 21:04:46 -08:00
Nicholas Nethercote
4beda4eda0 Bug 1094552 (part 6) - DMD: add support for cumulative heap profiling. r=mccr8.
By adding a new "cumulative" mode.
2014-10-30 20:22:47 -07:00
Nicholas Nethercote
1794d21329 Bug 1094552 (part 5) - DMD: choose the profiling mode at start-up. r=mccr8.
This patch moves profiling mode selection from post-processing (in dmd.py) to
DMD start-up. This will make it easier to add new kinds of profiling, such as
cumulative heap profiling.

Specifically:

- There's a new --mode option. |LiveWithReports| is the default, as it is
  currently.

- dmd.py's --ignore-reports option is gone.

- There's a new |mode| field in the JSON output.

- Reports-related operations are now no-ops if DMD isn't in LiveWithReports
  mode.

- Diffs are only allowed for output files that have the same mode.

- A new function ResetEverything() replaces the SetSampleBelowSize() and
  ClearBlocks(), which were used by the test to change DMD options.

- The tests in SmokeDMD.cpp are split up so they can be run multiple times, in
  different modes. The exact combinations of tests and modes has been changed a
  bit.
2014-12-08 14:45:14 -08:00
Nicholas Nethercote
b1e12b65db Bug 1085727 (part 3, attempt 2) - Print dmd.py's invocation at the top of its output. r=mccr8. 2014-10-20 17:45:58 -07:00
Nicholas Nethercote
90dca5176e Bug 1085727 (part 2, attempt 2) - Remove dmd.py's -b option and make its behaviour the default. r=mccr8. 2014-10-20 17:45:45 -07:00
Nicholas Nethercote
5e928fed05 Bug 1014343 (attempt 2) - Add diff support to dmd.py. r=mccr8. 2014-10-16 19:06:45 -07:00
Nicholas Nethercote
b6b6a322b0 Bug 1076446 (attempt 2) - Make the DMD test work on Windows. r=glandium. 2014-10-09 19:28:33 -07:00
Carsten "Tomcat" Book
112c54a4be Backed out changeset 835fbe63da4a (bug 1076446) for perma failure in 10.8 mozilla-inbound debug test xpcshell 2014-10-24 12:32:38 +02:00
Carsten "Tomcat" Book
fdb06a33c7 Backed out changeset 94c5d968e7e8 (bug 1014343) 2014-10-24 12:32:05 +02:00
Carsten "Tomcat" Book
1df6842c3c Backed out changeset 2cfce41bed5c (bug 1085727) 2014-10-24 12:32:00 +02:00
Carsten "Tomcat" Book
05b0225a1f Backed out changeset 1bb832d0c539 (bug 1085727) 2014-10-24 12:31:51 +02:00
Nicholas Nethercote
575594fdfa Bug 1085727 (part 3) - Print dmd.py's invocation at the top of its output. r=mccr8. 2014-10-20 17:45:58 -07:00
Nicholas Nethercote
896ff2b374 Bug 1085727 (part 2) - Remove dmd.py's -b option and make its behaviour the default. r=mccr8. 2014-10-20 17:45:45 -07:00
Nicholas Nethercote
25cfb18467 Bug 1014343 - Add diff support to dmd.py. r=mccr8. 2014-10-16 19:06:45 -07:00
Nicholas Nethercote
b8036ed928 Bug 1076446 - Make the DMD test work on Windows. r=glandium. 2014-10-09 19:28:33 -07:00
Nicholas Nethercote
fe9efe71c7 Bug 1078981 - Teach dmd.py how to handle gzipped files. r=mccr8. 2014-10-03 00:52:27 -07:00
Nicholas Nethercote
52dc2df1dc Bug 1078979 - Add more testing of dmd.py. r=erahm. 2014-10-09 16:50:12 -07:00
Nicholas Nethercote
083e90569a Bug 1077230 - Enable the DMD test on Mac 10.8. r=glandium. 2014-10-07 23:29:07 -07:00
Nicholas Nethercote
5eb54cdff0 Bug 1073312 - Test DMD on TBPL (Linux-only). r=glandium. 2014-09-28 20:50:52 -07:00
Nicholas Nethercote
809661c409 Bug 1074008 - Add a --fix-stacks option to dmd.py. r=glandium. 2014-09-28 18:36:49 -07:00
Nicholas Nethercote
2e4ef63638 Bug 1044709 - DMD: emit JSON output and use Python for post-processing. r=mccr8. 2014-09-02 20:34:58 -07:00