Commit Graph
113 Commits
Author SHA1 Message Date
Jon Coppeard d7f739d415 Bug 1232672 - Use MOZ_WARN_UNUSED_RESULT to make hash table clients check for failure r=luke r=billm r=njn 2015-12-22 13:29:43 +00:00
Jon Coppeard 109829c8f1 Bug 1207519 - Prevent HashTable shrink from ignoring allocation failures that may have been reported r=Waldo 2015-09-30 11:34:49 +01:00
Jon Coppeard 7de6ae17fa Bug 1200642 - Add checkSimulatedOOM() to AllocPolicy r=Waldo 2015-09-30 11:34:44 +01:00
Birunthan Mohanathas a29151dc87 Bug 1182996 - Fix and add missing namespace comments. rs=ehsan
The bulk of this commit was generated by running:

  run-clang-tidy.py \
    -checks='-*,llvm-namespace-comment' \
    -header-filter=^/.../mozilla-central/.* \
    -fix
2015-07-13 08:25:42 -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
Benoit Girard ef41ed062b Bug 1172216 - Move nsStackwalk to mozglue. r=glandium 2015-06-10 16:32:45 -04:00
Andrew McCreight 4ef05109d4 Bug 1171647, part 2 - Remove redundant assertion for dark matter mode. r=njn 2015-06-06 14:44:19 -07:00
Andrew McCreight 1ada1e321c Bug 1171647, part 1 - Define a new function to convert the mode to a string. r=njn 2015-06-06 14:44:19 -07:00
Jed Davis ff9adb621a Bug 1102388 - Fix DMD static constructor ordering dependency. r=mccr8
Sometimes, at least on Linux, DMDFuncs::sSingleton's static initializer
(in libxul) was being called before sDMDBridge's (in libdmd).
Thus sDMDBridge wasn't constructed yet in the path where its
address is taken, passed down through {replace_,}get_bridge to
ReplaceMallocBridge::Get, and its mVersion field is read.

This patch uses dynamic allocation, following what's done for other
globals in the same situation in this file.

Also, naming convention fix: leading "s" is for C++ class statics;
C-style static globals should be "g".
2015-04-20 23:05:00 +02:00
Jed Davis db050f614f Bug 1128705 - Don't redefine PAGE_SIZE in DMD if it's already defined. r=erahm 2015-04-20 14:15:00 +02:00
Ehsan Akhgari ea41d8de48 Bug 1145631 - Part 1: Replace MOZ_OVERRIDE and MOZ_FINAL with override and final in the tree; r=froydnj
This patch was automatically generated using the following script:

function convert() {
echo "Converting $1 to $2..."
find . \
       ! -wholename "*/.git*" \
       ! -wholename "obj-ff-dbg*" \
         -type f \
      \( -iname "*.cpp" \
         -o -iname "*.h" \
         -o -iname "*.c" \
         -o -iname "*.cc" \
         -o -iname "*.idl" \
         -o -iname "*.ipdl" \
         -o -iname "*.ipdlh" \
         -o -iname "*.mm" \) | \
    xargs -n 1 sed -i -e "s/\b$1\b/$2/g"
}

convert MOZ_OVERRIDE override
convert MOZ_FINAL final
2015-03-21 12:28:04 -04: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 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 5a1116e588 Bug 1094552 (part 4) - Rename AnalyzeReports() as Analyze(). r=mccr8.
Because DMD is no longer just about measuring memory reports coverage, but is
also used for more general heap profiling.
2014-12-08 14:45:13 -08:00
Nicholas Nethercote 359fa156fe Bug 1102525 (part 1) - Add InfallibleAllocPolicy to mozalloc. r=glandium. 2014-12-08 14:45:10 -08:00
Nicholas Nethercote d71b83ac3e Bug 1094552 (part 3) - DMD: rename |Block| as |LiveBlock|. r=mccr8.
This is to give better contrast with |DeadBlock|, which will be added in the
next patch.
2014-11-18 18:57:20 -08:00
Nicholas Nethercote 68e5feba63 Bug 1094552 (part 2) - DMD: tweak Range and Enum use. r=mccr8.
This patch:

- Uses |auto| in Range loops, so more of them fit on a single line.

- Converts one use of HashSet::Enum (which is only needed if you're modifying
  the HashSet as you iterate) to HashSet::Range.
2014-11-23 17:39:17 -08:00
Nicholas Nethercote f09200b4e3 Bug 1094552 (part 1) - DMD: rename mSampled field. r=mccr8.
The getter is called IsSampled(), so the field should match that.
2014-11-18 19:11:36 -08:00
Mike Hommey 42980011ad Bug 1097507 - Make libxul independent of libdmd when DMD is enabled. r=njn
This also effectively changes how DMD is enabled from requiring both
replace-malloc initialization and the DMD environment variable to
requiring only the former. The DMD environment variable can still be
used to specify options, but not to disable entirely.

This however doesn't touch all the parts that do enable DMD by setting
the DMD environment variable to 1, so the code to handle this value
is kept.
2014-11-18 19:21:06 +09:00
Mike Hommey b5346751fb Bug 1097506 - Pass a JSONWriteFunc to dmd::AnalyzeReports instead of a JSONWriter. r=njn
The interesting feature JSONWriteFunc has, contrary to JSONWriter, is that it
only has virtual methods, which makes it a better candidate to be passed
around between libraries not linked against each other.

This will allow to make dmd and libxul independent from each other.
2014-11-13 09:24:28 +09:00
Nicholas Nethercote a8b3ee787f Bug 1085727 (part 1, attempt 2) - DMD: make some very short functions one-liners. r=mccr8. 2014-10-20 17:45:09 -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
Andrew McCreight 17f450dd4e Bug 1082128 - Make id to string conversion in DMD use a class. r=njn 2014-10-24 13:44: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 d034b57bc4 Backed out changeset 450c187cbc1b (bug 1085727) 2014-10-24 12:32:03 +02:00
Nicholas Nethercote 493610a871 Bug 1085727 (part 1) - DMD: make some very short functions one-liners. r=mccr8. 2014-10-20 17:45:09 -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 52dc2df1dc Bug 1078979 - Add more testing of dmd.py. r=erahm. 2014-10-09 16:50:12 -07:00
Nicholas Nethercote e17e0749b6 Bug 1079660 - DMD: don't call malloc et al. directly in the test. r=glandium. 2014-10-07 21:44:42 -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 74467bfdc8 Bug 1079657 - DMD: Remove the "stress" mode. r=erahm. 2014-10-08 14:56:46 -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
Nicholas Nethercote aba5072dce Bug 1062709 (part 1, attempt 2) - Add a frame number argument to NS_WalkStackCallback. r=dbaron. 2014-09-10 21:47:01 -07:00
Ed Morley 1c977f5017 Backed out changeset a0b82c954206 (bug 1062709) for Windows mochitest 5 hangs 2014-10-03 15:06:16 +01:00
Nicholas Nethercote 52aecfdcd6 Bug 1062709 (part 1) - Add a frame number argument to NS_WalkStackCallback. r=dbaron. 2014-09-10 21:47:01 -07:00
Cervantes Yu b662cccda6 Bug 1051633: Make sure magic file descriptors in the content process will not be taken for other uses. r=khuey 2014-09-30 00:00:00 +08:00
Carsten "Tomcat" Book d3eb07ba53 Backed out changeset 1e25cd3e8219 (bug 1051633) for B2G ICS Emulator Opt m4 test failures 2014-09-24 11:28:37 +02:00
Cervantes Yu 5927c5ac47 Bug 1051633: Make sure magic file descriptors in the content process will not be taken for other uses. r=khuey 2014-08-15 17:19:05 +08:00
Nicholas Nethercote f54004414d Bug 1063321 - Print to the console the paths of all files that DMD opens. r=mccr8. 2014-09-04 20:45:22 -07:00
Nicholas Nethercote f30e108c5e Bug 1050601 - Remove fix-linux-stack.pl. r=ted. 2014-09-03 09:24:38 -07:00
Nicholas Nethercote f4dc45968a Bug 1061385 - Remove |Writer| parameter from CodeAddressService. r=mccr8. 2014-09-01 20:03:06 -07:00
Andrew McCreight c2d0686d75 Bug 1058169 - Add explicit ctor annotations in DMD.cpp. r=njn 2014-08-28 12:53:47 -07:00
Terrence Cole 639426bab4 Bug 1033442 - Remove non-pod realloc from MallocProvider and AllocPolicy; r=jonco 2014-08-05 14:06:35 -07:00
Terrence Cole 141bb16882 Bug 1033442 - Remove non-pod malloc from MallocProvider and AllocPolicy; r=jonco 2014-08-08 13:22:39 -07:00
Terrence Cole 845c16df98 Bug 1033442 - Remove non-pod calloc from MallocProvider and AllocPolicy; r=jonco 2014-08-05 14:06:35 -07:00
Andrew McCreight 8f96a9fb10 Bug 1004609, part 9 - Rename DMDLocationService to CodeAddressService. r=njn 2014-07-31 16:39:26 -07:00
Andrew McCreight 4c51c9513d Bug 1004609, part 7 - Move LocationService into xpcom. r=njn,froydnj 2014-07-31 16:39:25 -07:00
Andrew McCreight af9744adb4 Bug 1004609, part 5 - Templatize LocationService over the lock. r=njn 2014-07-31 16:39:25 -07:00