• Home
  • Raw
  • Download

Lines Matching refs:size

27         if (index >= extFeatureNames.size()) {  in GetFeatureName()
32 if (index >= featureNames.size()) { in GetFeatureName()
69 if (Write((uint32_t)str.size() + 1)) { // include the ending \0 in Write()
70 return Write(str.c_str(), str.size(), str.size() + 1); in Write()
76 bool PerfFileSection::Write(const char *buf, size_t size) in Write() argument
78 return Write(buf, size, size); in Write()
81 bool PerfFileSection::Write(const char *buf, size_t size, size_t max) in Write() argument
83 if (offset_ + size > maxSize_) { in Write()
84 HLOGE("write out of size!!! offset_ %zu size %zu max %zu", offset_, size, maxSize_); in Write()
88 HLOGE("write out of size!!! offset_ %zu size %zu max %zu", offset_, size, maxSize_); in Write()
91 std::copy(buf, buf + size, wBuffer_ + offset_); in Write()
92 if (size >= max) { in Write()
93 offset_ += size; in Write()
115 uint32_t size = 0; in Read() local
116 if (!Read(size)) { in Read()
121 if (size == 0 or size > maxSize_) { in Read()
124 char buf[size]; in Read()
125 if (!Read(buf, size)) { in Read()
128 if (buf[size - 1] != 0) { in Read()
132 HLOGDUMMY("Read String size %u buf : %s", size, value.c_str()); in Read()
135 void PerfFileSection::Skip(size_t size) in Skip() argument
137 offset_ += size; in Skip()
140 bool PerfFileSection::Read(char *buf, size_t size) in Read() argument
143 if (size == 0) { in Read()
144 HLOGE("read zero size!!! offset_ %zu size %zu max %zu", offset_, size, maxSize_); in Read()
146 } else if (offset_ + size > maxSize_) { in Read()
147 HLOGE("read out of size!!! offset_ %zu size %zu max %zu", offset_, size, maxSize_); in Read()
148 if (memset_s(buf, size, 0, size) != EOK) { // make sure the content return is 0 when failed in Read()
154 HLOGD("PerfFileSection::Read offset_ %zu size %zu maxSize_ %zu", offset_, size, maxSize_); in Read()
155 std::copy((rBuffer_ + offset_), (rBuffer_ + offset_ + size), buf); in Read()
156 offset_ += size; in Read()
157 HLOGDUMMY("after read offset_ %zx size %zu buf %x", offset_, size, buf[0]); in Read()
163 return sizeof(uint32_t) + string.size() + 1; /* '\0' */ in SizeOf()
166 PerfFileSectionString::PerfFileSectionString(FEATURE id, const char *buf, size_t size) in PerfFileSectionString() argument
169 Init(buf, size); in PerfFileSectionString()
181 bool PerfFileSectionString::GetBinary(char *buf, size_t size) in GetBinary() argument
183 if (size < GetSize()) { in GetBinary()
187 Init(buf, size); in GetBinary()
204 size_t size = 0; in GetSize() local
206 size += sizeof(uint32_t); // how many SymbolFileStruct in GetSize()
208 size += SizeOf(symbolFileStruct.filePath_); in GetSize()
209 size += sizeof(symbolFileStruct.symbolType_); in GetSize()
210 size += sizeof(symbolFileStruct.textExecVaddr_); in GetSize()
211 size += sizeof(symbolFileStruct.textExecVaddrFileOffset_); in GetSize()
212 size += SizeOf(symbolFileStruct.buildId_); in GetSize()
214 size += sizeof(uint32_t); // how many SymbolStruct in GetSize()
216 size += sizeof(symbolStruct.vaddr_); in GetSize()
217 size += sizeof(symbolStruct.len_); in GetSize()
218 size += SizeOf(symbolStruct.symbolName_); in GetSize()
221 return size; in GetSize()
224 PerfFileSectionSymbolsFiles::PerfFileSectionSymbolsFiles(FEATURE id, const char *buf, size_t size) in PerfFileSectionSymbolsFiles() argument
227 Init(buf, size); in PerfFileSectionSymbolsFiles()
266 HLOGV(" %zu SymbolStruct read.", symbolFileStruct.symbolStructs_.size()); in PerfFileSectionSymbolsFiles()
268 HLOGV(" %zu SymbolFileStruct read.", symbolFileStructs_.size()); in PerfFileSectionSymbolsFiles()
271 bool PerfFileSectionSymbolsFiles::GetBinary(char *buf, size_t size) in GetBinary() argument
273 HLOGV("PerfFileSectionSymbolsFiles get buffer size %zu.", size); in GetBinary()
274 HLOG_ASSERT(size >= GetSize()); in GetBinary()
276 Init(buf, size); in GetBinary()
277 if (!Write((uint32_t)symbolFileStructs_.size())) { in GetBinary()
278 HLOGE("PerfFileSectionSymbolsFiles write failed with %zu.", symbolFileStructs_.size()); in GetBinary()
288 Write((uint32_t)symbolFileStruct.symbolStructs_.size()); in GetBinary()
295 symbolFileStruct.symbolStructs_.size(), symbolFileStruct.filePath_.c_str(), in GetBinary()
299 HLOGV("%zu SymbolFileStruct writed.", symbolFileStructs_.size()); in GetBinary()
304 PerfFileSectionNrCpus::PerfFileSectionNrCpus(FEATURE id, const char *buf, size_t size) in PerfFileSectionNrCpus() argument
307 Init(buf, size); in PerfFileSectionNrCpus()
319 bool PerfFileSectionNrCpus::GetBinary(char *buf, size_t size) in GetBinary() argument
321 if (size < GetSize()) { in GetBinary()
325 Init(buf, size); in GetBinary()
342 PerfFileSectionU64::PerfFileSectionU64(FEATURE id, const char *buf, size_t size) in PerfFileSectionU64() argument
345 Init(buf, size); in PerfFileSectionU64()
356 bool PerfFileSectionU64::GetBinary(char *buf, size_t size) in GetBinary() argument
358 if (size < GetSize()) { in GetBinary()
362 Init(buf, size); in GetBinary()
384 PerfFileSectionEventDesc::PerfFileSectionEventDesc(FEATURE id, const char *buf, size_t size) in PerfFileSectionEventDesc() argument
388 Init(buf, size); in PerfFileSectionEventDesc()
434 HLOGV("read complete. %zu events", eventDesces_.size()); in PerfFileSectionEventDesc()
437 bool PerfFileSectionEventDesc::GetBinary(char *buf, size_t size) in GetBinary() argument
439 if (size < GetSize()) { in GetBinary()
442 Init(buf, size); in GetBinary()
444 if (!Write(static_cast<uint32_t>(eventDesces_.size()))) { in GetBinary()
454 if (!Write(static_cast<uint32_t>(eventDesc.ids.size()))) { in GetBinary()
462 sizeof(uint64_t) * eventDesc.ids.size())) { in GetBinary()
472 size_t size = sizeof(uint32_t); // nr in GetSize() local
473 size += sizeof(uint32_t); // attr_size in GetSize()
475 size += (eventDesces_.size() * sizeof(perf_event_attr)); in GetSize()
476 size += (eventDesces_.size() * sizeof(uint32_t)); // nr_ids in GetSize()
478 size += SizeOf(eventDesc.name); in GetSize()
479 size += (sizeof(uint64_t) * eventDesc.ids.size()); in GetSize()
481 return size; in GetSize()