Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(81)

Side by Side Diff: third_party/WebKit/Source/wtf/allocator/PartitionAlloc.cpp

Issue 2045643002: [tracing] Fix light dump of partition alloc dump provider (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 1342 matching lines...) Expand 10 before | Expand all | Expand 10 after
1353 partitionStats.totalActiveBytes += bucketStats[i].activeBytes; 1353 partitionStats.totalActiveBytes += bucketStats[i].activeBytes;
1354 partitionStats.totalDecommittableBytes += bucketStats[i].decommittab leBytes; 1354 partitionStats.totalDecommittableBytes += bucketStats[i].decommittab leBytes;
1355 partitionStats.totalDiscardableBytes += bucketStats[i].discardableBy tes; 1355 partitionStats.totalDiscardableBytes += bucketStats[i].discardableBy tes;
1356 if (!isLightDump) 1356 if (!isLightDump)
1357 partitionStatsDumper->partitionsDumpBucketStats(partitionName, & bucketStats[i]); 1357 partitionStatsDumper->partitionsDumpBucketStats(partitionName, & bucketStats[i]);
1358 } 1358 }
1359 } 1359 }
1360 1360
1361 size_t directMappedAllocationsTotalSize = 0; 1361 size_t directMappedAllocationsTotalSize = 0;
1362 for (size_t i = 0; i < numDirectMappedAllocations; ++i) { 1362 for (size_t i = 0; i < numDirectMappedAllocations; ++i) {
1363 uint32_t size = directMapLengths[i];
1364 directMappedAllocationsTotalSize += size;
1365 if (isLightDump)
1366 continue;
1367
1363 PartitionBucketMemoryStats stats; 1368 PartitionBucketMemoryStats stats;
1364 memset(&stats, '\0', sizeof(stats)); 1369 memset(&stats, '\0', sizeof(stats));
1365 stats.isValid = true; 1370 stats.isValid = true;
1366 stats.isDirectMap = true; 1371 stats.isDirectMap = true;
1367 stats.numFullPages = 1; 1372 stats.numFullPages = 1;
1368 uint32_t size = directMapLengths[i];
1369 stats.allocatedPageSize = size; 1373 stats.allocatedPageSize = size;
1370 stats.bucketSlotSize = size; 1374 stats.bucketSlotSize = size;
1371 stats.activeBytes = size; 1375 stats.activeBytes = size;
1372 stats.residentBytes = size; 1376 stats.residentBytes = size;
1373 directMappedAllocationsTotalSize += size;
1374 partitionStatsDumper->partitionsDumpBucketStats(partitionName, &stats); 1377 partitionStatsDumper->partitionsDumpBucketStats(partitionName, &stats);
1375 } 1378 }
1376 partitionStats.totalResidentBytes += directMappedAllocationsTotalSize; 1379 partitionStats.totalResidentBytes += directMappedAllocationsTotalSize;
1377 partitionStats.totalActiveBytes += directMappedAllocationsTotalSize; 1380 partitionStats.totalActiveBytes += directMappedAllocationsTotalSize;
1378 partitionStatsDumper->partitionDumpTotals(partitionName, &partitionStats); 1381 partitionStatsDumper->partitionDumpTotals(partitionName, &partitionStats);
1379 } 1382 }
1380 1383
1381 void partitionDumpStats(PartitionRoot* partition, const char* partitionName, boo l isLightDump, PartitionStatsDumper* partitionStatsDumper) 1384 void partitionDumpStats(PartitionRoot* partition, const char* partitionName, boo l isLightDump, PartitionStatsDumper* partitionStatsDumper)
1382 { 1385 {
1383 static const size_t kMaxReportableBuckets = 4096 / sizeof(void*); 1386 static const size_t kMaxReportableBuckets = 4096 / sizeof(void*);
(...skipping 18 matching lines...) Expand all
1402 partitionStats.totalDiscardableBytes += memoryStats[i].discardableBy tes; 1405 partitionStats.totalDiscardableBytes += memoryStats[i].discardableBy tes;
1403 if (!isLightDump) 1406 if (!isLightDump)
1404 partitionStatsDumper->partitionsDumpBucketStats(partitionName, & memoryStats[i]); 1407 partitionStatsDumper->partitionsDumpBucketStats(partitionName, & memoryStats[i]);
1405 } 1408 }
1406 } 1409 }
1407 partitionStatsDumper->partitionDumpTotals(partitionName, &partitionStats); 1410 partitionStatsDumper->partitionDumpTotals(partitionName, &partitionStats);
1408 } 1411 }
1409 1412
1410 } // namespace WTF 1413 } // namespace WTF
1411 1414
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698