• 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 
16 #include "trace_data_cache_reader.h"
17 namespace SysTuning {
18 namespace TraceStreamer {
19 using namespace TraceStdtype;
~TraceDataCacheReader()20 TraceDataCacheReader::~TraceDataCacheReader() {}
GetDataFromDict(DataIndex id) const21 const std::string &TraceDataCacheReader::GetDataFromDict(DataIndex id) const
22 {
23     return dataDict_.GetDataFromDict(id);
24 }
25 
GetConstProcessData() const26 const std::deque<Process> &TraceDataCacheReader::GetConstProcessData() const
27 {
28     return internalProcessesData_;
29 }
GetConstProcessData(InternalPid internalPid) const30 const Process &TraceDataCacheReader::GetConstProcessData(InternalPid internalPid) const
31 {
32     TS_ASSERT(internalPid < internalProcessesData_.size());
33     return internalProcessesData_[internalPid];
34 }
GetConstThreadData(InternalTid internalTid) const35 const Thread &TraceDataCacheReader::GetConstThreadData(InternalTid internalTid) const
36 {
37     TS_ASSERT(internalTid < internalThreadsData_.size());
38     return internalThreadsData_[internalTid];
39 }
40 
GetConstThreadData() const41 const std::deque<Thread> &TraceDataCacheReader::GetConstThreadData() const
42 {
43     return internalThreadsData_;
44 }
GetConstInternalSlicesData() const45 const CallStack &TraceDataCacheReader::GetConstInternalSlicesData() const
46 {
47     return callstackData_;
48 }
GetConstIrqData() const49 const CallStack &TraceDataCacheReader::GetConstIrqData() const
50 {
51     return irqData_;
52 }
GetConstFilterData() const53 const Filter &TraceDataCacheReader::GetConstFilterData() const
54 {
55     return filterData_;
56 }
GetConstRawTableData() const57 const Raw &TraceDataCacheReader::GetConstRawTableData() const
58 {
59     return rawData_;
60 }
GetConstMeasureData() const61 const Measure &TraceDataCacheReader::GetConstMeasureData() const
62 {
63     return measureData_;
64 }
GetConstSysMemMeasureData() const65 const Measure &TraceDataCacheReader::GetConstSysMemMeasureData() const
66 {
67     return sysMemMeasureData_;
68 }
GetConstProcessMeasureData() const69 const Measure &TraceDataCacheReader::GetConstProcessMeasureData() const
70 {
71     return processMeasureData_;
72 }
73 
GetConstThreadStateData() const74 const ThreadStateData &TraceDataCacheReader::GetConstThreadStateData() const
75 {
76     return threadStateData_;
77 }
GetConstSchedSliceData() const78 const SchedSlice &TraceDataCacheReader::GetConstSchedSliceData() const
79 {
80     return schedSliceData_;
81 }
GetConstCpuMeasuresData() const82 const CpuMeasureFilter &TraceDataCacheReader::GetConstCpuMeasuresData() const
83 {
84     return cpuMeasureData_;
85 }
GetConstInstantsData() const86 const Instants &TraceDataCacheReader::GetConstInstantsData() const
87 {
88     return instantsData_;
89 }
GetConstProcessMeasureFilterData() const90 const ProcessMeasureFilter &TraceDataCacheReader::GetConstProcessMeasureFilterData() const
91 {
92     return processMeasureFilterData_;
93 }
94 
GetConstClockEventFilterData() const95 const ClockEventData &TraceDataCacheReader::GetConstClockEventFilterData() const
96 {
97     return clockEventFilterData_;
98 }
GetConstClkEventFilterData() const99 const ClkEventData &TraceDataCacheReader::GetConstClkEventFilterData() const
100 {
101     return clkEventFilterData_;
102 }
GetConstSchedStateData(uint64_t rowId) const103 const std::string &TraceDataCacheReader::GetConstSchedStateData(uint64_t rowId) const
104 {
105     TS_ASSERT(statusString_.find(rowId) != statusString_.end());
106     return statusString_.at(rowId);
107 }
TraceStartTime() const108 uint64_t TraceDataCacheReader::TraceStartTime() const
109 {
110     return traceStartTime_;
111 }
TraceEndTime() const112 uint64_t TraceDataCacheReader::TraceEndTime() const
113 {
114     return traceEndTime_;
115 }
116 
GetConstStatAndInfo() const117 const StatAndInfo &TraceDataCacheReader::GetConstStatAndInfo() const
118 {
119     return stat_;
120 }
GetConstMetaData() const121 const MetaData &TraceDataCacheReader::GetConstMetaData() const
122 {
123     return metaData_;
124 }
125 
GetConstSymbolsData() const126 const SymbolsData &TraceDataCacheReader::GetConstSymbolsData() const
127 {
128     return symbolsData_;
129 }
130 
GetConstHilogData() const131 const LogInfo &TraceDataCacheReader::GetConstHilogData() const
132 {
133     return hilogData_;
134 }
135 
GetConstNativeHookData() const136 const NativeHook &TraceDataCacheReader::GetConstNativeHookData() const
137 {
138     return nativeHookData_;
139 }
140 
GetConstNativeHookFrameData() const141 const NativeHookFrame &TraceDataCacheReader::GetConstNativeHookFrameData() const
142 {
143     return nativeHookFrameData_;
144 }
GetConstNativeHookStatisticData() const145 const NativeHookStatistic &TraceDataCacheReader::GetConstNativeHookStatisticData() const
146 {
147     return nativeHookStatisticData_;
148 }
GetConstHidumpData() const149 const Hidump &TraceDataCacheReader::GetConstHidumpData() const
150 {
151     return hidumpData_;
152 }
153 
GetConstPerfCallChainData() const154 const PerfCallChain &TraceDataCacheReader::GetConstPerfCallChainData() const
155 {
156     return perfCallChain_;
157 }
GetConstPerfFilesData() const158 const PerfFiles &TraceDataCacheReader::GetConstPerfFilesData() const
159 {
160     return perfFiles_;
161 }
GetConstPerfSampleData() const162 const PerfSample &TraceDataCacheReader::GetConstPerfSampleData() const
163 {
164     return perfSample_;
165 }
GetConstPerfThreadData() const166 const PerfThread &TraceDataCacheReader::GetConstPerfThreadData() const
167 {
168     return perfThread_;
169 }
GetConstPerfReportData() const170 const PerfReport &TraceDataCacheReader::GetConstPerfReportData() const
171 {
172     return perfReport_;
173 }
GetConstSysCallData() const174 const SysCall &TraceDataCacheReader::GetConstSysCallData() const
175 {
176     return sysCallData_;
177 }
GetConstArgSetData() const178 const ArgSet &TraceDataCacheReader::GetConstArgSetData() const
179 {
180     return argSet_;
181 }
GetConstTaskPoolData() const182 const TaskPoolInfo &TraceDataCacheReader::GetConstTaskPoolData() const
183 {
184     return taskPoolInfo_;
185 }
GetConstJsHeapFilesData() const186 const JsHeapFiles &TraceDataCacheReader::GetConstJsHeapFilesData() const
187 {
188     return jsHeapFilesData_;
189 }
GetConstJsHeapEdgesData() const190 const JsHeapEdges &TraceDataCacheReader::GetConstJsHeapEdgesData() const
191 {
192     return jsHeapEdgesData_;
193 }
GetConstJsHeapInfoData() const194 const JsHeapInfo &TraceDataCacheReader::GetConstJsHeapInfoData() const
195 {
196     return jsHeapInfoData_;
197 }
GetConstJsHeapLocationData() const198 const JsHeapLocation &TraceDataCacheReader::GetConstJsHeapLocationData() const
199 {
200     return jsHeapLocationData_;
201 }
GetConstJsHeapNodesData() const202 const JsHeapNodes &TraceDataCacheReader::GetConstJsHeapNodesData() const
203 {
204     return jsHeapNodesData_;
205 }
GetConstJsHeapSampleData() const206 const JsHeapSample &TraceDataCacheReader::GetConstJsHeapSampleData() const
207 {
208     return jsHeapSampleData_;
209 }
GetConstJsHeapStringData() const210 const JsHeapString &TraceDataCacheReader::GetConstJsHeapStringData() const
211 {
212     return jsHeapStringData_;
213 }
GetConstJsHeapTraceFuncInfoData() const214 const JsHeapTraceFuncInfo &TraceDataCacheReader::GetConstJsHeapTraceFuncInfoData() const
215 {
216     return jsHeapTraceFuncInfoData_;
217 }
GetConstJsHeapTraceNodeData() const218 const JsHeapTraceNode &TraceDataCacheReader::GetConstJsHeapTraceNodeData() const
219 {
220     return jsHeapTraceNodeData_;
221 }
GetConstJsCpuProfilerNodeData() const222 const JsCpuProfilerNode &TraceDataCacheReader::GetConstJsCpuProfilerNodeData() const
223 {
224     return jsCpuProfilerNodeData_;
225 }
GetConstJsCpuProfilerSampleData() const226 const JsCpuProfilerSample &TraceDataCacheReader::GetConstJsCpuProfilerSampleData() const
227 {
228     return jsCpuProfilerSampleData_;
229 }
230 
GetConstJsConfigData() const231 const JsConfig &TraceDataCacheReader::GetConstJsConfigData() const
232 {
233     return jsConfigData_;
234 }
235 
GetConstDataTypeData() const236 const DataType &TraceDataCacheReader::GetConstDataTypeData() const
237 {
238     return dataType_;
239 }
240 
GetConstSysMeasureFilterData() const241 const SysMeasureFilter &TraceDataCacheReader::GetConstSysMeasureFilterData() const
242 {
243     return sysEvent_;
244 }
GetConstNetworkData() const245 const NetDetailData &TraceDataCacheReader::GetConstNetworkData() const
246 {
247     return networkData_;
248 }
GetConstCpuUsageInfoData() const249 const CpuUsageDetailData &TraceDataCacheReader::GetConstCpuUsageInfoData() const
250 {
251     return cpuUsageData_;
252 }
GetConstDiskIOData() const253 const DiskIOData &TraceDataCacheReader::GetConstDiskIOData() const
254 {
255     return diskIOData_;
256 }
GetConstLiveProcessData() const257 const LiveProcessDetailData &TraceDataCacheReader::GetConstLiveProcessData() const
258 {
259     return liveProcessDetailData_;
260 }
GetConstFileSystemSample() const261 const FileSystemSample &TraceDataCacheReader::GetConstFileSystemSample() const
262 {
263     return fileSamplingTableData_;
264 }
GetConstEbpfCallStackData() const265 const EbpfCallStackData &TraceDataCacheReader::GetConstEbpfCallStackData() const
266 {
267     return ebpfCallStackData_;
268 }
GetConstPagedMemorySampleData() const269 const PagedMemorySampleData &TraceDataCacheReader::GetConstPagedMemorySampleData() const
270 {
271     return pagedMemorySampleData_;
272 }
GetConstHiSysEventSubkeysData() const273 const HiSysEventSubkeys &TraceDataCacheReader::GetConstHiSysEventSubkeysData() const
274 {
275     return sysEventNameIds_;
276 }
GetConstHiSyseventMeasureData() const277 const HiSysEventMeasureData &TraceDataCacheReader::GetConstHiSyseventMeasureData() const
278 {
279     return sysEventMeasureData_;
280 }
GetConstTraceConfigData() const281 const TraceConfig &TraceDataCacheReader::GetConstTraceConfigData() const
282 {
283     return traceConfigData_;
284 }
GetConstHiSysEventDeviceStateData() const285 const HiSysEventDeviceStateData &TraceDataCacheReader::GetConstHiSysEventDeviceStateData() const
286 {
287     return deviceStateData_;
288 }
GetConstHiSysEventAllEventData() const289 const HiSysEventAllEventData &TraceDataCacheReader::GetConstHiSysEventAllEventData() const
290 {
291     return hiSysEventAllEventData_;
292 }
GetConstSmapsData() const293 const SmapsData &TraceDataCacheReader::GetConstSmapsData() const
294 {
295     return smapsData_;
296 }
GetConstBioLatencySampleData() const297 const BioLatencySampleData &TraceDataCacheReader::GetConstBioLatencySampleData() const
298 {
299     return bioLatencySampleData_;
300 }
301 
GetConstClockSnapshotData() const302 const ClockSnapshotData &TraceDataCacheReader::GetConstClockSnapshotData() const
303 {
304     return clockSnapshotData_;
305 }
306 
GetConstDataSourceClockIdData() const307 const DataSourceClockIdData &TraceDataCacheReader::GetConstDataSourceClockIdData() const
308 {
309     return dataSourceClockIdData_;
310 }
GetConstFrameSliceData() const311 const FrameSlice &TraceDataCacheReader::GetConstFrameSliceData() const
312 {
313     return frameSliceData_;
314 }
GetConstFrameMapsData() const315 const FrameMaps &TraceDataCacheReader::GetConstFrameMapsData() const
316 {
317     return frameMapsData_;
318 }
GetConstGPUSliceData() const319 const GPUSlice &TraceDataCacheReader::GetConstGPUSliceData() const
320 {
321     return gpuSliceData_;
322 }
GetConstAppStartupData() const323 const AppStartup &TraceDataCacheReader::GetConstAppStartupData() const
324 {
325     return appStartupData_;
326 }
GetConstSoStaticInitalizationData() const327 const SoStaticInitalization &TraceDataCacheReader::GetConstSoStaticInitalizationData() const
328 {
329     return soStaticInitalizationData_;
330 }
GetConstAnimation() const331 const Animation &TraceDataCacheReader::GetConstAnimation() const
332 {
333     return animation_;
334 }
GetConstDeviceInfo() const335 const DeviceInfo &TraceDataCacheReader::GetConstDeviceInfo() const
336 {
337     return deviceInfo_;
338 }
GetConstDynamicFrame() const339 const DynamicFrame &TraceDataCacheReader::GetConstDynamicFrame() const
340 {
341     return dynamicFrame_;
342 }
GetConstAshMemData() const343 const AshMemData &TraceDataCacheReader::GetConstAshMemData() const
344 {
345     return ashMemData_;
346 }
GetConstDmaMemData() const347 const DmaMemData &TraceDataCacheReader::GetConstDmaMemData() const
348 {
349     return dmaMemData_;
350 }
GetConstGpuProcessMemData() const351 const GpuProcessMemData &TraceDataCacheReader::GetConstGpuProcessMemData() const
352 {
353     return gpuProcessMemData_;
354 }
GetConstGpuWindowMemData() const355 const GpuWindowMemData &TraceDataCacheReader::GetConstGpuWindowMemData() const
356 {
357     return gpuWindowMemData_;
358 }
GetConstCpuDumpInfo() const359 const CpuDumpInfo &TraceDataCacheReader::GetConstCpuDumpInfo() const
360 {
361     return cpuDumpInfo_;
362 }
GetConstProfileMemInfo() const363 const ProfileMemInfo &TraceDataCacheReader::GetConstProfileMemInfo() const
364 {
365     return profileMemInfo_;
366 }
GetConstRSImageDumpInfo() const367 const RSImageDumpInfo &TraceDataCacheReader::GetConstRSImageDumpInfo() const
368 {
369     return rsImageDumpInfo_;
370 }
371 } // namespace TraceStreamer
372 } // namespace SysTuning
373