From: Ruben Ayrapetyan Date: Fri, 15 Sep 2017 18:49:35 +0000 (+0300) Subject: Speed up parsing by skipping unused data for each display mode. X-Git-Tag: submit/tizen/20180620.112952^2~32^2~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cf014e2bfe0439ca4e4d8bc288be8378a49909b1;p=sdk%2Ftools%2Fheaptrack.git Speed up parsing by skipping unused data for each display mode. --- diff --git a/src/analyze/accumulatedtracedata.cpp b/src/analyze/accumulatedtracedata.cpp index e1db005..ab68fb9 100644 --- a/src/analyze/accumulatedtracedata.cpp +++ b/src/analyze/accumulatedtracedata.cpp @@ -279,6 +279,11 @@ bool AccumulatedTraceData::read(istream& in, const ParsePass pass) int prot, fd; TraceIndex traceIndex; + if (AllocationData::display == AllocationData::DisplayId::malloc) { + // we don't need the mmap/munmap details information for malloc statistics + continue; + } + if (!(reader >> length) || !(reader >> prot) || !(reader >> fd) @@ -312,6 +317,11 @@ bool AccumulatedTraceData::read(istream& in, const ParsePass pass) } else if (reader.mode() == '/') { uint64_t length, ptr; + if (AllocationData::display == AllocationData::DisplayId::malloc) { + // we don't need the mmap/munmap details information for malloc statistics + continue; + } + if (!(reader >> length) || !(reader >> ptr)) { cerr << "failed to parse line: " << reader.line() << endl; @@ -446,6 +456,11 @@ bool AccumulatedTraceData::read(istream& in, const ParsePass pass) continue; } + if (AllocationData::display == AllocationData::DisplayId::malloc) { + // we don't need the physical memory consumption details information for malloc statistics + continue; + } + uint64_t addr, diff, size, privateDirty, privateClean, sharedDirty, sharedClean; int prot; @@ -483,6 +498,12 @@ bool AccumulatedTraceData::read(istream& in, const ParsePass pass) } else if (reader.mode() == '+') { AllocationInfo info; AllocationIndex allocationIndex; + + if (AllocationData::display != AllocationData::DisplayId::malloc) { + // we don't need the malloc/calloc/realloc/free details information for malloc statistics + continue; + } + if (fileVersion >= 1) { if (!(reader >> allocationIndex.index)) { cerr << "failed to parse line: " << reader.line() << endl; @@ -533,6 +554,12 @@ bool AccumulatedTraceData::read(istream& in, const ParsePass pass) } else if (reader.mode() == '-') { AllocationIndex allocationInfoIndex; bool temporary = false; + + if (AllocationData::display != AllocationData::DisplayId::malloc) { + // we don't need the malloc/calloc/realloc/free details information for malloc statistics + continue; + } + if (fileVersion >= 1) { if (!(reader >> allocationInfoIndex.index)) { cerr << "failed to parse line: " << reader.line() << endl;