Bug 1005442 - Strip moz-nullprincipal UUIDs when diffing memory reports. r=mccr8.

--HG--
extra : rebase_source : 83e9f2d08b1cb1672b9bef0fddcd8bd34cfa4e18
This commit is contained in:
Nicholas Nethercote 2014-05-13 18:14:29 -07:00
parent 3ac0afc071
commit c17eeed597
4 changed files with 9 additions and 4 deletions

View File

@ -752,9 +752,14 @@ function makeDReportMap(aJSONReports)
assert(jr.description !== undefined, "Missing description");
// Strip out some non-deterministic stuff that prevents clean diffs --
// e.g. PIDs, addresses.
// e.g. PIDs, addresses, null principal UUIDs. (Note that we don't strip
// out all UUIDs because some of them -- such as those used by add-ons --
// are deterministic.)
let strippedProcess = jr.process.replace(/pid \d+/, "pid NNN");
let strippedPath = jr.path.replace(/0x[0-9A-Fa-f]+/, "0xNNN");
strippedPath = strippedPath.replace(
/moz-nullprincipal:{........-....-....-....-............}/,
"moz-nullprincipal:{NNNNNNNN-NNNN-NNNN-NNNN-NNNNNNNNNNNN}");
let processPath = strippedProcess + kProcessPathSep + strippedPath;
let rOld = dreportMap[processPath];

View File

@ -13,7 +13,7 @@
{"process": "P", "path": "foobar", "kind": 2, "units": 0, "amount": 100, "description": "Desc."},
{"process": "P", "path": "zero1", "kind": 2, "units": 0, "amount": 0, "description": "Desc."},
{"process": "P2 (pid 22)", "path": "z 0x1234", "kind": 2, "units": 0, "amount": 33, "description": "Desc."},
{"process": "P2 (pid 22)", "path": "z-moz-nullprincipal:{85e250f3-57ae-46c4-a11e-4176dd39d9c5} 0x1234", "kind": 2, "units": 0, "amount": 33, "description": "Desc."},
{"process": "P3", "path": "p3", "kind": 2, "units": 0, "amount": 55, "description": "Desc."},

View File

@ -14,7 +14,7 @@
{"process": "P", "path": "foobaz", "kind": 2, "units": 0, "amount": 0, "description": "Desc."},
{"process": "P2 (pid 33)", "path": "z 0x5678", "kind": 2, "units": 0, "amount": 44, "description": "Desc."},
{"process": "P2 (pid 33)", "path": "z-moz-nullprincipal:{161effaa-c1f7-4010-a08e-e7c9aea01aed} 0x5678", "kind": 2, "units": 0, "amount": 44, "description": "Desc."},
{"process": "P4", "path": "p4", "kind": 2, "units": 0, "amount": 66, "description": "Desc."},

View File

@ -287,7 +287,7 @@ End of P\n\
P2 (pid NNN)\n\
Other Measurements\n\
\n\
11 B ── z 0xNNN\n\
11 B ── z-moz-nullprincipal:{NNNNNNNN-NNNN-NNNN-NNNN-NNNNNNNNNNNN} 0xNNN\n\
\n\
End of P2 (pid NNN)\n\
P3\n\