• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) Huawei Technologies Co., Ltd. 2023. All rights reserved.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 #include "activity_monitor_stdtype.h"
16 
17 namespace SysTuning {
18 namespace TraceStdtype {
AppendNewHidumpInfo(uint64_t timeStamp,uint32_t fps)19 size_t Hidump::AppendNewHidumpInfo(uint64_t timeStamp, uint32_t fps)
20 {
21     timeStamps_.emplace_back(timeStamp);
22     fpss_.emplace_back(fps);
23     return Size() - 1;
24 }
Fpss() const25 const std::deque<uint32_t> &Hidump::Fpss() const
26 {
27     return fpss_;
28 }
Clear()29 void Hidump::Clear()
30 {
31     CacheBase::Clear();
32     fpss_.clear();
33 }
34 
AppendNewData(const DiskIoRow & diskioRow)35 void DiskIOData::AppendNewData(const DiskIoRow &diskioRow)
36 {
37     timeStamps_.emplace_back(diskioRow.ts);
38     durs_.emplace_back(diskioRow.dur);
39     rdDatas_.emplace_back(diskioRow.rd);
40     wrDatas_.emplace_back(diskioRow.wr);
41     rdPerSec_.emplace_back(diskioRow.rdPerSec);
42     wrPerSec_.emplace_back(diskioRow.wrPerSec);
43     rdCountPerSec_.emplace_back(diskioRow.rdCountPerSec);
44     wrCountPerSec_.emplace_back(diskioRow.wrCountPerSec);
45     rdCountDatas_.emplace_back(diskioRow.rdCount);
46     wrCountDatas_.emplace_back(diskioRow.wrCount);
47 }
Durs() const48 const std::deque<uint64_t> &DiskIOData::Durs() const
49 {
50     return durs_;
51 }
RdDatas() const52 const std::deque<uint64_t> &DiskIOData::RdDatas() const
53 {
54     return rdDatas_;
55 }
WrDatas() const56 const std::deque<uint64_t> &DiskIOData::WrDatas() const
57 {
58     return wrDatas_;
59 }
RdSpeedDatas() const60 const std::deque<double> &DiskIOData::RdSpeedDatas() const
61 {
62     return rdPerSec_;
63 }
WrSpeedDatas() const64 const std::deque<double> &DiskIOData::WrSpeedDatas() const
65 {
66     return wrPerSec_;
67 }
68 
RdCountPerSecDatas() const69 const std::deque<double> &DiskIOData::RdCountPerSecDatas() const
70 {
71     return rdCountPerSec_;
72 }
WrCountPerSecDatas() const73 const std::deque<double> &DiskIOData::WrCountPerSecDatas() const
74 {
75     return wrCountPerSec_;
76 }
RdCountDatas() const77 const std::deque<uint64_t> &DiskIOData::RdCountDatas() const
78 {
79     return rdCountDatas_;
80 }
WrCountDatas() const81 const std::deque<uint64_t> &DiskIOData::WrCountDatas() const
82 {
83     return wrCountDatas_;
84 }
Clear()85 void DiskIOData::Clear()
86 {
87     CacheBase::Clear();
88     durs_.clear();
89     rdDatas_.clear();
90     wrDatas_.clear();
91     wrPerSec_.clear();
92     rdPerSec_.clear();
93     wrCountPerSec_.clear();
94     rdCountPerSec_.clear();
95     rdCountDatas_.clear();
96     wrCountDatas_.clear();
97 }
AppendNewData(const LiveProcessDetailRow & liveProcessDetailRow)98 size_t LiveProcessDetailData::AppendNewData(const LiveProcessDetailRow &liveProcessDetailRow)
99 {
100     timeStamps_.emplace_back(liveProcessDetailRow.newTimeStamp);
101     durs_.emplace_back(liveProcessDetailRow.dur);
102     processID_.emplace_back(liveProcessDetailRow.processID);
103     processName_.emplace_back(liveProcessDetailRow.processName);
104     parentProcessID_.emplace_back(liveProcessDetailRow.parentProcessID);
105     uid_.emplace_back(liveProcessDetailRow.uid);
106     userName_.emplace_back(liveProcessDetailRow.userName);
107     cpuUsage_.emplace_back(liveProcessDetailRow.cpuUsage);
108     pssInfo_.emplace_back(liveProcessDetailRow.pssInfo);
109     threads_.emplace_back(liveProcessDetailRow.threads);
110     diskWrites_.emplace_back(liveProcessDetailRow.diskWrites);
111     diskReads_.emplace_back(liveProcessDetailRow.diskReads);
112     cpuTimes_.emplace_back(liveProcessDetailRow.cpuTime);
113     return Size() - 1;
114 }
Durs() const115 const std::deque<uint64_t> &LiveProcessDetailData::Durs() const
116 {
117     return durs_;
118 }
ProcessID() const119 const std::deque<int32_t> &LiveProcessDetailData::ProcessID() const
120 {
121     return processID_;
122 }
ProcessName() const123 const std::deque<std::string> &LiveProcessDetailData::ProcessName() const
124 {
125     return processName_;
126 }
ParentProcessID() const127 const std::deque<int32_t> &LiveProcessDetailData::ParentProcessID() const
128 {
129     return parentProcessID_;
130 }
Uid() const131 const std::deque<int32_t> &LiveProcessDetailData::Uid() const
132 {
133     return uid_;
134 }
UserName() const135 const std::deque<std::string> &LiveProcessDetailData::UserName() const
136 {
137     return userName_;
138 }
CpuUsage() const139 const std::deque<double> &LiveProcessDetailData::CpuUsage() const
140 {
141     return cpuUsage_;
142 }
PssInfo() const143 const std::deque<int32_t> &LiveProcessDetailData::PssInfo() const
144 {
145     return pssInfo_;
146 }
Threads() const147 const std::deque<int32_t> &LiveProcessDetailData::Threads() const
148 {
149     return threads_;
150 }
DiskWrites() const151 const std::deque<int64_t> &LiveProcessDetailData::DiskWrites() const
152 {
153     return diskWrites_;
154 }
DiskReads() const155 const std::deque<int64_t> &LiveProcessDetailData::DiskReads() const
156 {
157     return diskReads_;
158 }
159 
CpuTimes() const160 const std::deque<uint64_t> &LiveProcessDetailData::CpuTimes() const
161 {
162     return cpuTimes_;
163 }
Clear()164 void LiveProcessDetailData::Clear()
165 {
166     CacheBase::Clear();
167     durs_.clear();
168     processID_.clear();
169     processName_.clear();
170     parentProcessID_.clear();
171     uid_.clear();
172     userName_.clear();
173     cpuUsage_.clear();
174     pssInfo_.clear();
175     threads_.clear();
176     diskWrites_.clear();
177     diskReads_.clear();
178 }
179 
AppendNewData(const CpuUsageDetailRow & cpuUsageDetailRow)180 size_t CpuUsageDetailData::AppendNewData(const CpuUsageDetailRow &cpuUsageDetailRow)
181 {
182     timeStamps_.emplace_back(cpuUsageDetailRow.newTimeStamp);
183     durs_.emplace_back(cpuUsageDetailRow.dur);
184     totalLoad_.emplace_back(cpuUsageDetailRow.totalLoad);
185     userLoad_.emplace_back(cpuUsageDetailRow.userLoad);
186     systemLoad_.emplace_back(cpuUsageDetailRow.systemLoad);
187     threads_.emplace_back(cpuUsageDetailRow.threads);
188     return Size() - 1;
189 }
Durs() const190 const std::deque<uint64_t> &CpuUsageDetailData::Durs() const
191 {
192     return durs_;
193 }
TotalLoad() const194 const std::deque<double> &CpuUsageDetailData::TotalLoad() const
195 {
196     return totalLoad_;
197 }
UserLoad() const198 const std::deque<double> &CpuUsageDetailData::UserLoad() const
199 {
200     return userLoad_;
201 }
SystemLoad() const202 const std::deque<double> &CpuUsageDetailData::SystemLoad() const
203 {
204     return systemLoad_;
205 }
Threads() const206 const std::deque<int64_t> &CpuUsageDetailData::Threads() const
207 {
208     return threads_;
209 }
Clear()210 void CpuUsageDetailData::Clear()
211 {
212     CacheBase::Clear();
213     durs_.clear();
214     totalLoad_.clear();
215     userLoad_.clear();
216     systemLoad_.clear();
217     threads_.clear();
218 }
219 
AppendNewNetData(const NetDetailRow & netDetailRow)220 size_t NetDetailData::AppendNewNetData(const NetDetailRow &netDetailRow)
221 {
222     timeStamps_.emplace_back(netDetailRow.newTimeStamp);
223     txs_.emplace_back(netDetailRow.tx);
224     rxs_.emplace_back(netDetailRow.rx);
225     durs_.emplace_back(netDetailRow.dur);
226     txSpeeds_.emplace_back(netDetailRow.txSpeed);
227     rxSpeeds_.emplace_back(netDetailRow.rxSpeed);
228     netTypes_.emplace_back(netDetailRow.netType);
229     packetIn_.emplace_back(netDetailRow.packetIn);
230     packetInSec_.emplace_back(netDetailRow.packetInSec);
231     packetOut_.emplace_back(netDetailRow.packetOut);
232     packetOutSec_.emplace_back(netDetailRow.packetOutSec);
233     return Size() - 1;
234 }
Durs() const235 const std::deque<uint64_t> &NetDetailData::Durs() const
236 {
237     return durs_;
238 }
RxSpeed() const239 const std::deque<double> &NetDetailData::RxSpeed() const
240 {
241     return rxSpeeds_;
242 }
TxSpeed() const243 const std::deque<double> &NetDetailData::TxSpeed() const
244 {
245     return txSpeeds_;
246 }
NetTypes() const247 const std::deque<std::string> &NetDetailData::NetTypes() const
248 {
249     return netTypes_;
250 }
RxDatas() const251 const std::deque<uint64_t> &NetDetailData::RxDatas() const
252 {
253     return rxs_;
254 }
TxDatas() const255 const std::deque<uint64_t> &NetDetailData::TxDatas() const
256 {
257     return txs_;
258 }
PacketIn() const259 const std::deque<uint64_t> &NetDetailData::PacketIn() const
260 {
261     return packetIn_;
262 }
PacketInSec() const263 const std::deque<double> &NetDetailData::PacketInSec() const
264 {
265     return packetInSec_;
266 }
PacketOut() const267 const std::deque<uint64_t> &NetDetailData::PacketOut() const
268 {
269     return packetOut_;
270 }
PacketOutSec() const271 const std::deque<double> &NetDetailData::PacketOutSec() const
272 {
273     return packetOutSec_;
274 }
Clear()275 void NetDetailData::Clear()
276 {
277     CacheBase::Clear();
278     durs_.clear();
279     rxSpeeds_.clear();
280     txSpeeds_.clear();
281     netTypes_.clear();
282     packetIn_.clear();
283     packetInSec_.clear();
284     packetOut_.clear();
285     packetOutSec_.clear();
286 }
AppendNewData(const SmapsRow & smapsRow)287 void SmapsData::AppendNewData(const SmapsRow &smapsRow)
288 {
289     timeStamps_.emplace_back(smapsRow.timeStamp);
290     ipids_.emplace_back(smapsRow.ipid);
291     startAddrs_.emplace_back(smapsRow.startAddr);
292     endAddrs_.emplace_back(smapsRow.endAddr);
293     dirtys_.emplace_back(smapsRow.dirty);
294     swappers_.emplace_back(smapsRow.swapper);
295     rss_.emplace_back(smapsRow.rss);
296     pss_.emplace_back(smapsRow.pss);
297     sizes_.emplace_back(smapsRow.size);
298     resides_.emplace_back(smapsRow.reside);
299     protectionIds_.emplace_back(smapsRow.protectionId);
300     pathIds_.emplace_back(smapsRow.pathId);
301     sharedClean_.emplace_back(smapsRow.sharedClean);
302     sharedDirty_.emplace_back(smapsRow.sharedDirty);
303     privateClean_.emplace_back(smapsRow.privateClean);
304     privateDirty_.emplace_back(smapsRow.privateDirty);
305     swap_.emplace_back(smapsRow.swap);
306     swapPss_.emplace_back(smapsRow.swapPss);
307     type_.emplace_back(smapsRow.type);
308     ids_.emplace_back(rowCount_);
309     rowCount_++;
310 }
TimeStamps() const311 const std::deque<uint64_t> &SmapsData::TimeStamps() const
312 {
313     return timeStamps_;
314 }
Ipids() const315 const std::deque<uint64_t> &SmapsData::Ipids() const
316 {
317     return ipids_;
318 }
StartAddrs() const319 const std::deque<std::string> &SmapsData::StartAddrs() const
320 {
321     return startAddrs_;
322 }
EndAddrs() const323 const std::deque<std::string> &SmapsData::EndAddrs() const
324 {
325     return endAddrs_;
326 }
Dirtys() const327 const std::deque<uint64_t> &SmapsData::Dirtys() const
328 {
329     return dirtys_;
330 }
Swappers() const331 const std::deque<uint64_t> &SmapsData::Swappers() const
332 {
333     return swappers_;
334 }
Rss() const335 const std::deque<uint64_t> &SmapsData::Rss() const
336 {
337     return rss_;
338 }
Pss() const339 const std::deque<uint64_t> &SmapsData::Pss() const
340 {
341     return pss_;
342 }
Sizes() const343 const std::deque<uint64_t> &SmapsData::Sizes() const
344 {
345     return sizes_;
346 }
Resides() const347 const std::deque<double> &SmapsData::Resides() const
348 {
349     return resides_;
350 }
ProtectionIds() const351 const std::deque<DataIndex> &SmapsData::ProtectionIds() const
352 {
353     return protectionIds_;
354 }
PathIds() const355 const std::deque<DataIndex> &SmapsData::PathIds() const
356 {
357     return pathIds_;
358 }
SharedClean() const359 const std::deque<uint64_t> &SmapsData::SharedClean() const
360 {
361     return sharedClean_;
362 }
SharedDirty() const363 const std::deque<uint64_t> &SmapsData::SharedDirty() const
364 {
365     return sharedDirty_;
366 }
PrivateClean() const367 const std::deque<uint64_t> &SmapsData::PrivateClean() const
368 {
369     return privateClean_;
370 }
PrivateDirty() const371 const std::deque<uint64_t> &SmapsData::PrivateDirty() const
372 {
373     return privateDirty_;
374 }
Swap() const375 const std::deque<uint64_t> &SmapsData::Swap() const
376 {
377     return swap_;
378 }
SwapPss() const379 const std::deque<uint64_t> &SmapsData::SwapPss() const
380 {
381     return swapPss_;
382 }
Type() const383 const std::deque<uint32_t> &SmapsData::Type() const
384 {
385     return type_;
386 }
Clear()387 void SmapsData::Clear()
388 {
389     CacheBase::Clear();
390     ipids_.clear();
391     startAddrs_.clear();
392     endAddrs_.clear();
393     dirtys_.clear();
394     swappers_.clear();
395     rss_.clear();
396     pss_.clear();
397     sizes_.clear();
398     resides_.clear();
399     protectionIds_.clear();
400     pathIds_.clear();
401     sharedClean_.clear();
402     sharedDirty_.clear();
403     privateClean_.clear();
404     privateDirty_.clear();
405     swap_.clear();
406     swapPss_.clear();
407     type_.clear();
408 }
AppendNewData(const AshMemRow & ashMemRow)409 void AshMemData::AppendNewData(const AshMemRow &ashMemRow)
410 {
411     ipids_.emplace_back(ashMemRow.ipid);
412     timeStamps_.emplace_back(ashMemRow.ts);
413     adjs_.emplace_back(ashMemRow.adj);
414     fds_.emplace_back(ashMemRow.fd);
415     ashmemNameIds_.emplace_back(ashMemRow.ashmemNameId);
416     sizes_.emplace_back(ashMemRow.size);
417     psss_.emplace_back(ashMemRow.pss);
418     ashmemIds_.emplace_back(ashMemRow.ashmemId);
419     times_.emplace_back(ashMemRow.time);
420     refCounts_.emplace_back(ashMemRow.refCount);
421     purgeds_.emplace_back(ashMemRow.purged);
422     flags_.emplace_back(ashMemRow.flag);
423     ids_.emplace_back(rowCount_);
424     rowCount_++;
425 }
SetFlag(uint64_t rowId,uint32_t flag)426 void AshMemData::SetFlag(uint64_t rowId, uint32_t flag)
427 {
428     flags_[rowId] = flag;
429 }
Ipids() const430 const std::deque<InternalPid> &AshMemData::Ipids() const
431 {
432     return ipids_;
433 }
Adjs() const434 const std::deque<uint32_t> &AshMemData::Adjs() const
435 {
436     return adjs_;
437 }
Fds() const438 const std::deque<uint32_t> &AshMemData::Fds() const
439 {
440     return fds_;
441 }
AshmemNameIds() const442 const std::deque<DataIndex> &AshMemData::AshmemNameIds() const
443 {
444     return ashmemNameIds_;
445 }
Sizes() const446 const std::deque<uint64_t> &AshMemData::Sizes() const
447 {
448     return sizes_;
449 }
Psss() const450 const std::deque<uint64_t> &AshMemData::Psss() const
451 {
452     return psss_;
453 }
AshmemIds() const454 const std::deque<uint32_t> &AshMemData::AshmemIds() const
455 {
456     return ashmemIds_;
457 }
Times() const458 const std::deque<uint64_t> &AshMemData::Times() const
459 {
460     return times_;
461 }
RefCounts() const462 const std::deque<uint64_t> &AshMemData::RefCounts() const
463 {
464     return refCounts_;
465 }
Purgeds() const466 const std::deque<uint64_t> &AshMemData::Purgeds() const
467 {
468     return purgeds_;
469 }
Flags() const470 const std::deque<uint32_t> &AshMemData::Flags() const
471 {
472     return flags_;
473 }
Clear()474 void AshMemData::Clear()
475 {
476     CacheBase::Clear();
477     ipids_.clear();
478     adjs_.clear();
479     fds_.clear();
480     ashmemNameIds_.clear();
481     sizes_.clear();
482     psss_.clear();
483     ashmemIds_.clear();
484     times_.clear();
485     refCounts_.clear();
486     purgeds_.clear();
487     flags_.clear();
488 }
AppendNewData(const DmaMemRow & dmaMemRow)489 void DmaMemData::AppendNewData(const DmaMemRow &dmaMemRow)
490 {
491     ipids_.emplace_back(dmaMemRow.ipid);
492     timeStamps_.emplace_back(dmaMemRow.ts);
493     fds_.emplace_back(dmaMemRow.fd);
494     sizes_.emplace_back(dmaMemRow.size);
495     inos_.emplace_back(dmaMemRow.ino);
496     expPids_.emplace_back(dmaMemRow.expPid);
497     expTaskCommIds_.emplace_back(dmaMemRow.expTaskCommId);
498     bufNameIds_.emplace_back(dmaMemRow.bufNameId);
499     expNameIds_.emplace_back(dmaMemRow.expNameId);
500     flags_.emplace_back(dmaMemRow.flag);
501     ids_.emplace_back(rowCount_);
502     rowCount_++;
503 }
SetFlag(uint64_t rowId,uint32_t flag)504 void DmaMemData::SetFlag(uint64_t rowId, uint32_t flag)
505 {
506     flags_[rowId] = flag;
507 }
Ipids() const508 const std::deque<InternalPid> &DmaMemData::Ipids() const
509 {
510     return ipids_;
511 }
Fds() const512 const std::deque<uint32_t> &DmaMemData::Fds() const
513 {
514     return fds_;
515 }
Sizes() const516 const std::deque<uint64_t> &DmaMemData::Sizes() const
517 {
518     return sizes_;
519 }
Inos() const520 const std::deque<uint32_t> &DmaMemData::Inos() const
521 {
522     return inos_;
523 }
ExpPids() const524 const std::deque<uint32_t> &DmaMemData::ExpPids() const
525 {
526     return expPids_;
527 }
ExpTaskCommIds() const528 const std::deque<DataIndex> &DmaMemData::ExpTaskCommIds() const
529 {
530     return expTaskCommIds_;
531 }
BufNameIds() const532 const std::deque<DataIndex> &DmaMemData::BufNameIds() const
533 {
534     return bufNameIds_;
535 }
ExpNameIds() const536 const std::deque<DataIndex> &DmaMemData::ExpNameIds() const
537 {
538     return expNameIds_;
539 }
Flags() const540 const std::deque<uint32_t> &DmaMemData::Flags() const
541 {
542     return flags_;
543 }
Clear()544 void DmaMemData::Clear()
545 {
546     CacheBase::Clear();
547     ipids_.clear();
548     fds_.clear();
549     sizes_.clear();
550     inos_.clear();
551     expPids_.clear();
552     expTaskCommIds_.clear();
553     bufNameIds_.clear();
554     expNameIds_.clear();
555     flags_.clear();
556 }
557 
AppendNewData(const GpuProcessMemRow & gpuProcessMemRow)558 void GpuProcessMemData::AppendNewData(const GpuProcessMemRow &gpuProcessMemRow)
559 {
560     timeStamps_.emplace_back(gpuProcessMemRow.ts);
561     gpuNameIds_.emplace_back(gpuProcessMemRow.gpuNameId);
562     allGpuSizes_.emplace_back(gpuProcessMemRow.allGpuSize);
563     addrs_.emplace_back(gpuProcessMemRow.addr);
564     ipids_.emplace_back(gpuProcessMemRow.ipid);
565     itids_.emplace_back(gpuProcessMemRow.itid);
566     usedGpuSizes_.emplace_back(gpuProcessMemRow.usedGpuSize);
567     ids_.emplace_back(rowCount_);
568     rowCount_++;
569 }
GpuNameIds() const570 const std::deque<DataIndex> &GpuProcessMemData::GpuNameIds() const
571 {
572     return gpuNameIds_;
573 }
AllGpuSizes() const574 const std::deque<uint64_t> &GpuProcessMemData::AllGpuSizes() const
575 {
576     return allGpuSizes_;
577 }
Addrs() const578 const std::deque<std::string> &GpuProcessMemData::Addrs() const
579 {
580     return addrs_;
581 }
Ipids() const582 const std::deque<InternalPid> &GpuProcessMemData::Ipids() const
583 {
584     return ipids_;
585 }
Itids() const586 const std::deque<InternalPid> &GpuProcessMemData::Itids() const
587 {
588     return itids_;
589 }
UsedGpuSizes() const590 const std::deque<uint64_t> &GpuProcessMemData::UsedGpuSizes() const
591 {
592     return usedGpuSizes_;
593 }
Clear()594 void GpuProcessMemData::Clear()
595 {
596     CacheBase::Clear();
597     gpuNameIds_.clear();
598     allGpuSizes_.clear();
599     addrs_.clear();
600     ipids_.clear();
601     itids_.clear();
602     usedGpuSizes_.clear();
603 }
AppendNewData(const GpuWindowMemRow & gpuWindowMemRow)604 void GpuWindowMemData::AppendNewData(const GpuWindowMemRow &gpuWindowMemRow)
605 {
606     timeStamps_.emplace_back(gpuWindowMemRow.ts);
607     windowNameIds_.emplace_back(gpuWindowMemRow.windowNameId);
608     windowIds_.emplace_back(gpuWindowMemRow.windowId);
609     moduleNameIds_.emplace_back(gpuWindowMemRow.moduleNameId);
610     categoryNameIds_.emplace_back(gpuWindowMemRow.categoryNameId);
611     sizes_.emplace_back(gpuWindowMemRow.size);
612     counts_.emplace_back(gpuWindowMemRow.count);
613     purgeableSizes_.emplace_back(gpuWindowMemRow.purgeableSize);
614     ipids_.emplace_back(INVALID_IPID);
615     ids_.emplace_back(rowCount_);
616     rowCount_++;
617 }
WindowNameIds() const618 const std::deque<DataIndex> &GpuWindowMemData::WindowNameIds() const
619 {
620     return windowNameIds_;
621 }
WindowIds() const622 const std::deque<uint64_t> &GpuWindowMemData::WindowIds() const
623 {
624     return windowIds_;
625 }
ModuleNameIds() const626 const std::deque<DataIndex> &GpuWindowMemData::ModuleNameIds() const
627 {
628     return moduleNameIds_;
629 }
CategoryNameIds() const630 const std::deque<DataIndex> &GpuWindowMemData::CategoryNameIds() const
631 {
632     return categoryNameIds_;
633 }
Sizes() const634 const std::deque<uint64_t> &GpuWindowMemData::Sizes() const
635 {
636     return sizes_;
637 }
Counts() const638 const std::deque<uint32_t> &GpuWindowMemData::Counts() const
639 {
640     return counts_;
641 }
PurgeableSizes() const642 const std::deque<uint64_t> &GpuWindowMemData::PurgeableSizes() const
643 {
644     return purgeableSizes_;
645 }
Ipids() const646 const std::deque<InternalPid> &GpuWindowMemData::Ipids() const
647 {
648     return ipids_;
649 }
Clear()650 void GpuWindowMemData::Clear()
651 {
652     CacheBase::Clear();
653     windowNameIds_.clear();
654     windowIds_.clear();
655     moduleNameIds_.clear();
656     categoryNameIds_.clear();
657     sizes_.clear();
658     counts_.clear();
659     purgeableSizes_.clear();
660     ipids_.clear();
661 }
RevicesIpid(const std::map<DataIndex,InternalPid> & windowIdToIpidMap)662 void GpuWindowMemData::RevicesIpid(const std::map<DataIndex, InternalPid> &windowIdToIpidMap)
663 {
664     for (auto i = 0; i < Size(); i++) {
665         if (windowIdToIpidMap.count(windowNameIds_[i])) {
666             ipids_[i] = windowIdToIpidMap.at(windowNameIds_[i]);
667         }
668     }
669 }
670 
AppendNewData(uint64_t timestamp,uint64_t size)671 void CpuDumpInfo::AppendNewData(uint64_t timestamp, uint64_t size)
672 {
673     timeStamps_.emplace_back(timestamp);
674     totalSizes_.emplace_back(size);
675     ids_.emplace_back(Size());
676 }
TotalSizes() const677 const std::deque<uint64_t> &CpuDumpInfo::TotalSizes() const
678 {
679     return totalSizes_;
680 }
Clear()681 void CpuDumpInfo::Clear()
682 {
683     CacheBase::Clear();
684     totalSizes_.clear();
685 }
686 
AppendNewData(uint64_t timestamp,DataIndex channelIndex,uint64_t size)687 void ProfileMemInfo::AppendNewData(uint64_t timestamp, DataIndex channelIndex, uint64_t size)
688 {
689     timeStamps_.emplace_back(timestamp);
690     totalSizes_.emplace_back(size);
691     channelIndexs_.emplace_back(channelIndex);
692     ids_.emplace_back(Size());
693 }
ChannelIndexs() const694 const std::deque<uint64_t> &ProfileMemInfo::ChannelIndexs() const
695 {
696     return channelIndexs_;
697 }
TotalSizes() const698 const std::deque<uint64_t> &ProfileMemInfo::TotalSizes() const
699 {
700     return totalSizes_;
701 }
Clear()702 void ProfileMemInfo::Clear()
703 {
704     CacheBase::Clear();
705     channelIndexs_.clear();
706     totalSizes_.clear();
707 }
708 
AppendNewData(uint64_t timestamp,uint64_t memSize,DataIndex typeIndex,InternalPid ipid,DataIndex name)709 void RSImageDumpInfo::AppendNewData(uint64_t timestamp,
710                                     uint64_t memSize,
711                                     DataIndex typeIndex,
712                                     InternalPid ipid,
713                                     DataIndex name)
714 {
715     timeStamps_.emplace_back(timestamp);
716     memSizes_.emplace_back(memSize);
717     typeIndexs_.emplace_back(typeIndex);
718     ipids_.emplace_back(ipid);
719     surfaceNameIndexs_.emplace_back(name);
720     ids_.emplace_back(Size());
721 }
MemSizes() const722 const std::deque<uint64_t> &RSImageDumpInfo::MemSizes() const
723 {
724     return memSizes_;
725 }
TypeIndexs() const726 const std::deque<DataIndex> &RSImageDumpInfo::TypeIndexs() const
727 {
728     return typeIndexs_;
729 }
Ipids() const730 const std::deque<InternalPid> &RSImageDumpInfo::Ipids() const
731 {
732     return ipids_;
733 }
SurfaceNameIndexs() const734 const std::deque<DataIndex> &RSImageDumpInfo::SurfaceNameIndexs() const
735 {
736     return surfaceNameIndexs_;
737 }
Clear()738 void RSImageDumpInfo::Clear()
739 {
740     CacheBase::Clear();
741     memSizes_.clear();
742     typeIndexs_.clear();
743     ipids_.clear();
744     surfaceNameIndexs_.clear();
745 }
746 } // namespace TraceStdtype
747 } // namespace SysTuning
748