Backed out changeset 2cfce41bed5c (bug 1085727)

This commit is contained in:
Carsten "Tomcat" Book 2014-10-24 12:32:00 +02:00
parent f98aae3139
commit 2645f2042d
18 changed files with 100 additions and 74 deletions

View File

@ -77,7 +77,7 @@ class Record(object):
self.reqSize == 0 and \
self.slopSize == 0 and \
self.usableSize == 0 and \
len(self.usableSizes) == 0
(not args.show_all_block_sizes or len(self.usableSizes) == 0)
def negate(self):
self.numBlocks = -self.numBlocks
@ -195,6 +195,9 @@ variable is used to find breakpad symbols for stack fixing.
p.add_argument('-a', '--ignore-alloc-fns', action='store_true',
help='ignore allocation functions at the start of traces')
p.add_argument('-b', '--show-all-block-sizes', action='store_true',
help='show individual block sizes for each record')
p.add_argument('--no-fix-stacks', action='store_true',
help='do not fix stacks')
@ -556,16 +559,24 @@ def printDigest(args, digest):
format(number(record.usableSize, isSampled),
number(record.reqSize, isSampled),
number(record.slopSize, isSampled)))
out(' {:4.2f}% of the heap ({:4.2f}% cumulative)'.
format(perc(record.usableSize, heapUsableSize),
perc(kindCumulativeUsableSize, heapUsableSize)))
if args.ignore_reports:
pass
else:
out(' {:4.2f}% of {:} ({:4.2f}% cumulative)'.
format(perc(record.usableSize, kindUsableSize),
recordKind,
perc(kindCumulativeUsableSize, kindUsableSize)))
abscmp = lambda ((usableSize1, _1a), _1b), \
((usableSize2, _2a), _2b): \
cmp(abs(usableSize1), abs(usableSize2))
usableSizes = sorted(record.usableSizes.items(), cmp=abscmp,
reverse=True)
if args.show_all_block_sizes:
abscmp = lambda ((usableSize1, _1a), _1b), \
((usableSize2, _2a), _2b): \
cmp(abs(usableSize1), abs(usableSize2))
usableSizes = sorted(record.usableSizes.items(), cmp=abscmp,
reverse=True)
hasSingleBlock = len(usableSizes) == 1 and usableSizes[0][1] == 1
if not hasSingleBlock:
out(' Individual block sizes: ', end='')
if len(usableSizes) == 0:
out('(no change)', end='')
@ -580,16 +591,6 @@ def printDigest(args, digest):
isFirst = False
out()
out(' {:4.2f}% of the heap ({:4.2f}% cumulative)'.
format(perc(record.usableSize, heapUsableSize),
perc(kindCumulativeUsableSize, heapUsableSize)))
if args.ignore_reports:
pass
else:
out(' {:4.2f}% of {:} ({:4.2f}% cumulative)'.
format(perc(record.usableSize, kindUsableSize),
recordKind,
perc(kindCumulativeUsableSize, kindUsableSize)))
out(' Allocated at {')
printStack(record.allocatedAtDesc)
out(' }')

View File

@ -10,7 +10,6 @@ Invocation {
Live {
~4 blocks in heap block record 1 of 7
~512 bytes (~512 requested / ~0 slop)
Individual block sizes: ~128 x 3; 128
35.96% of the heap (35.96% cumulative)
Allocated at {
#01: ... DMD.cpp ...

View File

@ -28,7 +28,6 @@ Live {
Live {
9 blocks in heap block record 3 of 12
1,008 bytes (900 requested / 108 slop)
Individual block sizes: 112 x 9
8.34% of the heap (84.58% cumulative)
Allocated at {
#01: ... DMD.cpp ...
@ -38,7 +37,6 @@ Live {
Live {
6 blocks in heap block record 4 of 12
528 bytes (528 requested / 0 slop)
Individual block sizes: 128; 112; 96; 80; 64; 48
4.37% of the heap (88.95% cumulative)
Allocated at {
#01: ... DMD.cpp ...
@ -48,7 +46,6 @@ Live {
Live {
6 blocks in heap block record 5 of 12
528 bytes (528 requested / 0 slop)
Individual block sizes: 128; 112; 96; 80; 64; 48
4.37% of the heap (93.32% cumulative)
Allocated at {
#01: ... DMD.cpp ...

View File

@ -10,7 +10,6 @@ Invocation {
Live {
9 blocks in heap block record 1 of 9
1,008 bytes (900 requested / 108 slop)
Individual block sizes: 112 x 9
35.49% of the heap (35.49% cumulative)
Allocated at {
#01: ... DMD.cpp ...
@ -20,7 +19,6 @@ Live {
Live {
6 blocks in heap block record 2 of 9
528 bytes (528 requested / 0 slop)
Individual block sizes: 128; 112; 96; 80; 64; 48
18.59% of the heap (54.08% cumulative)
Allocated at {
#01: ... DMD.cpp ...
@ -30,7 +28,6 @@ Live {
Live {
6 blocks in heap block record 3 of 9
528 bytes (528 requested / 0 slop)
Individual block sizes: 128; 112; 96; 80; 64; 48
18.59% of the heap (72.68% cumulative)
Allocated at {
#01: ... DMD.cpp ...

View File

@ -14,7 +14,6 @@ Invocation {
Unreported {
~4 blocks in heap block record 1 of 7
~512 bytes (~512 requested / ~0 slop)
Individual block sizes: ~128 x 3; 128
35.96% of the heap (35.96% cumulative)
35.96% of unreported (35.96% cumulative)
Allocated at {

View File

@ -76,7 +76,6 @@ Twice-reported {
Unreported {
9 blocks in heap block record 1 of 3
1,008 bytes (900 requested / 108 slop)
Individual block sizes: 112 x 9
8.34% of the heap (8.34% cumulative)
81.82% of unreported (81.82% cumulative)
Allocated at {
@ -87,7 +86,6 @@ Unreported {
Unreported {
2 blocks in heap block record 2 of 3
112 bytes (112 requested / 0 slop)
Individual block sizes: 64; 48
0.93% of the heap (9.27% cumulative)
9.09% of unreported (90.91% cumulative)
Allocated at {
@ -98,7 +96,6 @@ Unreported {
Unreported {
2 blocks in heap block record 3 of 3
112 bytes (112 requested / 0 slop)
Individual block sizes: 64; 48
0.93% of the heap (10.19% cumulative)
9.09% of unreported (100.00% cumulative)
Allocated at {
@ -150,7 +147,6 @@ Once-reported {
Once-reported {
2 blocks in heap block record 4 of 11
240 bytes (240 requested / 0 slop)
Individual block sizes: 128; 112
1.99% of the heap (82.46% cumulative)
2.27% of once-reported (94.18% cumulative)
Allocated at {
@ -164,7 +160,6 @@ Once-reported {
Once-reported {
2 blocks in heap block record 5 of 11
240 bytes (240 requested / 0 slop)
Individual block sizes: 128; 112
1.99% of the heap (84.45% cumulative)
2.27% of once-reported (96.45% cumulative)
Allocated at {

View File

@ -44,7 +44,6 @@ Twice-reported {
Unreported {
9 blocks in heap block record 1 of 3
1,008 bytes (900 requested / 108 slop)
Individual block sizes: 112 x 9
35.49% of the heap (35.49% cumulative)
48.84% of unreported (48.84% cumulative)
Allocated at {
@ -55,7 +54,6 @@ Unreported {
Unreported {
6 blocks in heap block record 2 of 3
528 bytes (528 requested / 0 slop)
Individual block sizes: 128; 112; 96; 80; 64; 48
18.59% of the heap (54.08% cumulative)
25.58% of unreported (74.42% cumulative)
Allocated at {
@ -66,7 +64,6 @@ Unreported {
Unreported {
6 blocks in heap block record 3 of 3
528 bytes (528 requested / 0 slop)
Individual block sizes: 128; 112; 96; 80; 64; 48
18.59% of the heap (72.68% cumulative)
25.58% of unreported (100.00% cumulative)
Allocated at {

View File

@ -15,7 +15,6 @@ Invocation 2 {
Twice-reported {
~-1 blocks in heap block record 1 of 1
~-1,088 bytes (~-1,064 requested / ~-24 slop)
Individual block sizes: -1,024; ~-127; ~63
15.46% of the heap (15.46% cumulative)
100.00% of twice-reported (100.00% cumulative)
Allocated at {
@ -32,9 +31,8 @@ Twice-reported {
#-----------------------------------------------------------------
Unreported {
4 blocks in heap block record 1 of 5
4 blocks in heap block record 1 of 4
16,384 bytes (16,384 requested / 0 slop)
Individual block sizes: 4,096 x 4
-232.76% of the heap (-232.76% cumulative)
371.01% of unreported (371.01% cumulative)
Allocated at {
@ -43,9 +41,8 @@ Unreported {
}
Unreported {
~7 blocks in heap block record 2 of 5
~7 blocks in heap block record 2 of 4
~-11,968 bytes (~-12,016 requested / ~48 slop)
Individual block sizes: -15,360; 2,048; 512 x 2; 128; ~-127; 64 x 4; ~63
170.02% of the heap (-62.74% cumulative)
-271.01% of unreported (100.00% cumulative)
Allocated at {
@ -54,9 +51,8 @@ Unreported {
}
Unreported {
0 blocks in heap block record 3 of 5
0 blocks in heap block record 3 of 4
0 bytes (-384 requested / 384 slop)
Individual block sizes: (no change)
-0.00% of the heap (-62.74% cumulative)
0.00% of unreported (100.00% cumulative)
Allocated at {
@ -65,9 +61,8 @@ Unreported {
}
Unreported {
-2 blocks in heap block record 4 of 5
-2 blocks in heap block record 4 of 4
0 bytes (0 requested / 0 slop)
Individual block sizes: 8,192 x 2; -4,096 x 4
-0.00% of the heap (-62.74% cumulative)
0.00% of unreported (100.00% cumulative)
Allocated at {
@ -75,23 +70,11 @@ Unreported {
}
}
Unreported {
0 blocks in heap block record 5 of 5
0 bytes (0 requested / 0 slop)
Individual block sizes: 20,480; -16,384; -8,192; 4,096
-0.00% of the heap (-62.74% cumulative)
0.00% of unreported (100.00% cumulative)
Allocated at {
#01: G (G.cpp:99)
}
}
#-----------------------------------------------------------------
Once-reported {
-3 blocks in heap block record 1 of 2
-10,240 bytes (-10,192 requested / -48 slop)
Individual block sizes: -4,096 x 2; -2,048
145.48% of the heap (145.48% cumulative)
98.77% of once-reported (98.77% cumulative)
Allocated at {

View File

@ -15,8 +15,8 @@ Invocation 2 {
Live {
4 blocks in heap block record 1 of 6
16,384 bytes (16,384 requested / 0 slop)
Individual block sizes: 4,096 x 4
-232.76% of the heap (-232.76% cumulative)
Individual block sizes: 4,096 x 4
Allocated at {
#01: E (E.cpp:99)
}
@ -25,8 +25,8 @@ Live {
Live {
~5 blocks in heap block record 2 of 6
~-13,183 bytes (~-13,231 requested / ~48 slop)
Individual block sizes: -15,360; 2,048; -1,024; 512 x 2; 128; ~-127 x 3; 64 x 4; ~63 x 2
187.29% of the heap (-45.48% cumulative)
Individual block sizes: -15,360; 2,048; -1,024; 512 x 2; 128; ~-127 x 3; 64 x 4; ~63 x 2
Allocated at {
#01: F (F.cpp:99)
}
@ -35,8 +35,8 @@ Live {
Live {
-3 blocks in heap block record 3 of 6
-10,240 bytes (-10,192 requested / -48 slop)
Individual block sizes: -4,096 x 2; -2,048
145.48% of the heap (100.00% cumulative)
Individual block sizes: -4,096 x 2; -2,048
Allocated at {
#01: D (D.cpp:99)
}
@ -45,8 +45,8 @@ Live {
Live {
0 blocks in heap block record 4 of 6
0 bytes (-384 requested / 384 slop)
Individual block sizes: (no change)
-0.00% of the heap (100.00% cumulative)
Individual block sizes: (no change)
Allocated at {
#01: C (C.cpp:99)
}
@ -55,8 +55,8 @@ Live {
Live {
0 blocks in heap block record 5 of 6
0 bytes (0 requested / 0 slop)
Individual block sizes: 20,480; -16,384; -8,192; 4,096
-0.00% of the heap (100.00% cumulative)
Individual block sizes: 20,480; -16,384; -8,192; 4,096
Allocated at {
#01: G (G.cpp:99)
}
@ -65,8 +65,8 @@ Live {
Live {
-2 blocks in heap block record 6 of 6
0 bytes (0 requested / 0 slop)
Individual block sizes: 8,192 x 2; -4,096 x 4
-0.00% of the heap (100.00% cumulative)
Individual block sizes: 8,192 x 2; -4,096 x 4
Allocated at {
#01: B (B.cpp:99)
}

View File

@ -10,7 +10,6 @@ Invocation {
Live {
4 blocks in heap block record 1 of 1
4,416 bytes (4,404 requested / 12 slop)
Individual block sizes: 4,096; 128; 112; 80
100.00% of the heap (100.00% cumulative)
Allocated at {
#01: E (E.cpp:99)

View File

@ -10,7 +10,6 @@ Invocation {
Live {
2 blocks in heap block record 1 of 3
4,224 bytes (4,224 requested / 0 slop)
Individual block sizes: 4,096; 128
95.65% of the heap (95.65% cumulative)
Allocated at {
#01: E (E.cpp:99)

View File

@ -0,0 +1,25 @@
#-----------------------------------------------------------------
Invocation {
$DMD = '1'
Sample-below size = 4093
}
#-----------------------------------------------------------------
Live {
~15 blocks in heap block record 1 of 1
~1,343,470 bytes (~1,342,313 requested / ~1,157 slop)
100.00% of the heap (100.00% cumulative)
Individual block sizes: 1,048,576; 65,536 x 3; 40,960; 8,192 x 4; ~4,093 x 6
Allocated at {
#01: A (A.cpp:99)
}
}
#-----------------------------------------------------------------
Summary {
Total: ~1,343,470 bytes in ~15 blocks
}

View File

@ -0,0 +1,35 @@
{
"version": 1,
"invocation": {
"dmdEnvVar": "1",
"sampleBelowSize": 4093
},
"blockList": [
{"req": 1048576, "alloc": "A"},
{"req": 65536, "alloc": "A"},
{"req": 65535, "slop": 1, "alloc": "A"},
{"req": 65534, "slop": 2, "alloc": "A"},
{"req": 40000, "slop": 960, "alloc": "A"},
{"req": 8192, "alloc": "A"},
{"req": 8192, "alloc": "A"},
{"req": 8190, "slop": 2, "alloc": "A"},
{"req": 8000, "slop": 192, "alloc": "A"},
{"alloc": "A"},
{"alloc": "A"},
{"alloc": "A"},
{"alloc": "A"},
{"alloc": "A"},
{"alloc": "A"}
],
"traceTable": {
"A": ["AA"]
},
"frameTable": {
"AA": "#00: A (A.cpp:99)"
}
}

View File

@ -10,7 +10,6 @@ Invocation {
Live {
5 blocks in heap block record 1 of 3
16,392 bytes (16,392 requested / 0 slop)
Individual block sizes: 4,096 x 4; 8
33.33% of the heap (33.33% cumulative)
Allocated at {
#01: A (A.cpp:99)
@ -20,7 +19,6 @@ Live {
Live {
5 blocks in heap block record 2 of 3
16,400 bytes (12,016 requested / 4,384 slop)
Individual block sizes: 4,096 x 4; 16
33.35% of the heap (66.68% cumulative)
Allocated at {
#01: B (B.cpp:99)
@ -30,7 +28,6 @@ Live {
Live {
4 blocks in heap block record 3 of 3
16,384 bytes (8,196 requested / 8,188 slop)
Individual block sizes: 4,096 x 4
33.32% of the heap (100.00% cumulative)
Allocated at {
#01: C (C.cpp:99)

View File

@ -10,7 +10,6 @@ Invocation {
Live {
4 blocks in heap block record 1 of 3
16,384 bytes (8,196 requested / 8,188 slop)
Individual block sizes: 4,096 x 4
33.32% of the heap (33.32% cumulative)
Allocated at {
#01: C (C.cpp:99)
@ -20,7 +19,6 @@ Live {
Live {
5 blocks in heap block record 2 of 3
16,400 bytes (12,016 requested / 4,384 slop)
Individual block sizes: 4,096 x 4; 16
33.35% of the heap (66.67% cumulative)
Allocated at {
#01: B (B.cpp:99)
@ -30,7 +28,6 @@ Live {
Live {
5 blocks in heap block record 3 of 3
16,392 bytes (16,392 requested / 0 slop)
Individual block sizes: 4,096 x 4; 8
33.33% of the heap (100.00% cumulative)
Allocated at {
#01: A (A.cpp:99)

View File

@ -10,7 +10,6 @@ Invocation {
Live {
5 blocks in heap block record 1 of 3
16,400 bytes (12,016 requested / 4,384 slop)
Individual block sizes: 4,096 x 4; 16
33.35% of the heap (33.35% cumulative)
Allocated at {
#01: B (B.cpp:99)
@ -20,7 +19,6 @@ Live {
Live {
5 blocks in heap block record 2 of 3
16,392 bytes (16,392 requested / 0 slop)
Individual block sizes: 4,096 x 4; 8
33.33% of the heap (66.68% cumulative)
Allocated at {
#01: A (A.cpp:99)
@ -30,7 +28,6 @@ Live {
Live {
4 blocks in heap block record 3 of 3
16,384 bytes (8,196 requested / 8,188 slop)
Individual block sizes: 4,096 x 4
33.32% of the heap (100.00% cumulative)
Allocated at {
#01: C (C.cpp:99)

View File

@ -171,6 +171,12 @@ function run_test() {
test("script-ignore-alloc-fns",
["--ignore-reports", "--ignore-alloc-fns", jsonFile.path]);
// This file has numerous allocations of different sizes, some repeated, some
// sampled, that all end up in the same record.
jsonFile = FileUtils.getFile("CurWorkD", ["script-show-all-block-sizes.json"]);
test("script-show-all-block-sizes",
["--ignore-reports", "--show-all-block-sizes", jsonFile.path]);
// This tests diffs. The first invocation has no options, the second has
// several.
jsonFile = FileUtils.getFile("CurWorkD", ["script-diff1.json"]);
@ -178,6 +184,7 @@ function run_test() {
test("script-diff-basic",
[jsonFile.path, jsonFile2.path]);
test("script-diff-options",
["--ignore-reports", jsonFile.path, jsonFile2.path]);
["--ignore-reports", "--show-all-block-sizes",
jsonFile.path, jsonFile2.path]);
}

View File

@ -18,6 +18,8 @@ support-files =
script-sort-by-slop-expected.txt
script-ignore-alloc-fns.json
script-ignore-alloc-fns-expected.txt
script-show-all-block-sizes.json
script-show-all-block-sizes-expected.txt
script-diff1.json
script-diff2.json
script-diff-basic-expected.txt