• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021 Huawei Device Co., Ltd.
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 #include "log.h"
18 namespace SysTuning {
19 namespace TraceStreamer {
20 using namespace TraceStdtype;
~TraceDataCacheReader()21 TraceDataCacheReader::~TraceDataCacheReader() {}
GetDataFromDict(DataIndex id) const22 const std::string& TraceDataCacheReader::GetDataFromDict(DataIndex id) const
23 {
24     return dataDict_.GetDataFromDict(id);
25 }
26 
GetConstProcessData() const27 const std::deque<Process>& TraceDataCacheReader::GetConstProcessData() const
28 {
29     return internalProcessesData_;
30 }
GetConstProcessData(InternalPid internalPid) const31 const Process& TraceDataCacheReader::GetConstProcessData(InternalPid internalPid) const
32 {
33     TS_ASSERT(internalPid < internalProcessesData_.size());
34     return internalProcessesData_[internalPid];
35 }
GetConstThreadData(InternalTid internalTid) const36 const Thread& TraceDataCacheReader::GetConstThreadData(InternalTid internalTid) const
37 {
38     TS_ASSERT(internalTid < internalThreadsData_.size());
39     return internalThreadsData_[internalTid];
40 }
41 
GetConstThreadData() const42 const std::deque<Thread>& TraceDataCacheReader::GetConstThreadData() const
43 {
44     return internalThreadsData_;
45 }
GetConstInternalSlicesData() const46 const CallStack& TraceDataCacheReader::GetConstInternalSlicesData() const
47 {
48     return callstackData_;
49 }
GetConstIrqData() const50 const CallStack& TraceDataCacheReader::GetConstIrqData() const
51 {
52     return irqData_;
53 }
GetConstFilterData() const54 const Filter& TraceDataCacheReader::GetConstFilterData() const
55 {
56     return filterData_;
57 }
GetConstRawTableData() const58 const Raw& TraceDataCacheReader::GetConstRawTableData() const
59 {
60     return rawData_;
61 }
GetConstMeasureData() const62 const Measure& TraceDataCacheReader::GetConstMeasureData() const
63 {
64     return measureData_;
65 }
GetConstSysMemMeasureData() const66 const Measure& TraceDataCacheReader::GetConstSysMemMeasureData() const
67 {
68     return sysMemMeasureData_;
69 }
GetConstProcessMeasureData() const70 const Measure& TraceDataCacheReader::GetConstProcessMeasureData() const
71 {
72     return processMeasureData_;
73 }
74 
GetConstThreadStateData() const75 const ThreadStateData& TraceDataCacheReader::GetConstThreadStateData() const
76 {
77     return threadStateData_;
78 }
GetConstSchedSliceData() const79 const SchedSlice& TraceDataCacheReader::GetConstSchedSliceData() const
80 {
81     return schedSliceData_;
82 }
GetConstCpuMeasureData() const83 const CpuMeasureFilter& TraceDataCacheReader::GetConstCpuMeasureData() const
84 {
85     return cpuMeasureData_;
86 }
GetConstInstantsData() const87 const Instants& TraceDataCacheReader::GetConstInstantsData() const
88 {
89     return instantsData_;
90 }
GetConstProcessMeasureFilterData() const91 const ProcessMeasureFilter& TraceDataCacheReader::GetConstProcessMeasureFilterData() const
92 {
93     return processMeasureFilterData_;
94 }
95 
GetConstClockEventFilterData() const96 const ClockEventData& TraceDataCacheReader::GetConstClockEventFilterData() const
97 {
98     return clockEventFilterData_;
99 }
GetConstClkEventFilterData() const100 const ClkEventData& TraceDataCacheReader::GetConstClkEventFilterData() const
101 {
102     return clkEventFilterData_;
103 }
GetConstSchedStateData(uint64_t rowId) const104 const std::string& TraceDataCacheReader::GetConstSchedStateData(uint64_t rowId) const
105 {
106     TS_ASSERT(statusString_.find(rowId) != statusString_.end());
107     return statusString_.at(rowId);
108 }
TraceStartTime() const109 uint64_t TraceDataCacheReader::TraceStartTime() const
110 {
111     return traceStartTime_;
112 }
TraceEndTime() const113 uint64_t TraceDataCacheReader::TraceEndTime() const
114 {
115     return traceEndTime_;
116 }
117 
GetConstStatAndInfo() const118 const StatAndInfo& TraceDataCacheReader::GetConstStatAndInfo() const
119 {
120     return stat_;
121 }
GetConstMetaData() const122 const MetaData& TraceDataCacheReader::GetConstMetaData() const
123 {
124     return metaData_;
125 }
126 
GetConstSymbolsData() const127 const SymbolsData& TraceDataCacheReader::GetConstSymbolsData() const
128 {
129     return symbolsData_;
130 }
131 
GetConstHilogData() const132 const LogInfo& TraceDataCacheReader::GetConstHilogData() const
133 {
134     return hilogData_;
135 }
136 
GetConstNativeHookData() const137 const NativeHook& TraceDataCacheReader::GetConstNativeHookData() const
138 {
139     return nativeHookData_;
140 }
141 
GetConstNativeHookFrameData() const142 const NativeHookFrame& TraceDataCacheReader::GetConstNativeHookFrameData() const
143 {
144     return nativeHookFrameData_;
145 }
GetConstNativeHookStatisticData() const146 const NativeHookStatistic& TraceDataCacheReader::GetConstNativeHookStatisticData() const
147 {
148     return nativeHookStatisticData_;
149 }
GetConstHidumpData() const150 const Hidump& TraceDataCacheReader::GetConstHidumpData() const
151 {
152     return hidumpData_;
153 }
154 
GetConstPerfCallChainData() const155 const PerfCallChain& TraceDataCacheReader::GetConstPerfCallChainData() const
156 {
157     return perfCallChain_;
158 }
GetConstPerfFilesData() const159 const PerfFiles& TraceDataCacheReader::GetConstPerfFilesData() const
160 {
161     return perfFiles_;
162 }
GetConstPerfSampleData() const163 const PerfSample& TraceDataCacheReader::GetConstPerfSampleData() const
164 {
165     return perfSample_;
166 }
GetConstPerfThreadData() const167 const PerfThread& TraceDataCacheReader::GetConstPerfThreadData() const
168 {
169     return perfThread_;
170 }
GetConstPerfReportData() const171 const PerfReport& TraceDataCacheReader::GetConstPerfReportData() const
172 {
173     return perfReport_;
174 }
GetConstSysCallData() const175 const SysCall& TraceDataCacheReader::GetConstSysCallData() const
176 {
177     return sysCallData_;
178 }
GetConstArgSetData() const179 const ArgSet& TraceDataCacheReader::GetConstArgSetData() const
180 {
181     return argSet_;
182 }
GetConstTaskPoolData() const183 const TaskPoolInfo& TraceDataCacheReader::GetConstTaskPoolData() const
184 {
185     return taskPoolInfo_;
186 }
GetConstJsHeapFilesData() const187 const JsHeapFiles& TraceDataCacheReader::GetConstJsHeapFilesData() const
188 {
189     return jsHeapFilesData_;
190 }
GetConstJsHeapEdgesData() const191 const JsHeapEdges& TraceDataCacheReader::GetConstJsHeapEdgesData() const
192 {
193     return jsHeapEdgesData_;
194 }
GetConstJsHeapInfoData() const195 const JsHeapInfo& TraceDataCacheReader::GetConstJsHeapInfoData() const
196 {
197     return jsHeapInfoData_;
198 }
GetConstJsHeapLocationData() const199 const JsHeapLocation& TraceDataCacheReader::GetConstJsHeapLocationData() const
200 {
201     return jsHeapLocationData_;
202 }
GetConstJsHeapNodesData() const203 const JsHeapNodes& TraceDataCacheReader::GetConstJsHeapNodesData() const
204 {
205     return jsHeapNodesData_;
206 }
GetConstJsHeapSampleData() const207 const JsHeapSample& TraceDataCacheReader::GetConstJsHeapSampleData() const
208 {
209     return jsHeapSampleData_;
210 }
GetConstJsHeapStringData() const211 const JsHeapString& TraceDataCacheReader::GetConstJsHeapStringData() const
212 {
213     return jsHeapStringData_;
214 }
GetConstJsHeapTraceFuncInfoData() const215 const JsHeapTraceFuncInfo& TraceDataCacheReader::GetConstJsHeapTraceFuncInfoData() const
216 {
217     return jsHeapTraceFuncInfoData_;
218 }
GetConstJsHeapTraceNodeData() const219 const JsHeapTraceNode& TraceDataCacheReader::GetConstJsHeapTraceNodeData() const
220 {
221     return jsHeapTraceNodeData_;
222 }
GetConstJsCpuProfilerNodeData() const223 const JsCpuProfilerNode& TraceDataCacheReader::GetConstJsCpuProfilerNodeData() const
224 {
225     return jsCpuProfilerNodeData_;
226 }
GetConstJsCpuProfilerSampleData() const227 const JsCpuProfilerSample& TraceDataCacheReader::GetConstJsCpuProfilerSampleData() const
228 {
229     return jsCpuProfilerSampleData_;
230 }
231 
GetConstJsConfigData() const232 const JsConfig& TraceDataCacheReader::GetConstJsConfigData() const
233 {
234     return jsConfigData_;
235 }
236 
GetConstDataTypeData() const237 const DataType& TraceDataCacheReader::GetConstDataTypeData() const
238 {
239     return dataType_;
240 }
241 
GetConstSysMeasureFilterData() const242 const SysMeasureFilter& TraceDataCacheReader::GetConstSysMeasureFilterData() const
243 {
244     return sysEvent_;
245 }
GetConstNetworkData() const246 const NetDetailData& TraceDataCacheReader::GetConstNetworkData() const
247 {
248     return networkData_;
249 }
GetConstCpuUsageInfoData() const250 const CpuUsageDetailData& TraceDataCacheReader::GetConstCpuUsageInfoData() const
251 {
252     return cpuUsageData_;
253 }
GetConstDiskIOData() const254 const DiskIOData& TraceDataCacheReader::GetConstDiskIOData() const
255 {
256     return diskIOData_;
257 }
GetConstLiveProcessData() const258 const LiveProcessDetailData& TraceDataCacheReader::GetConstLiveProcessData() const
259 {
260     return liveProcessDetailData_;
261 }
GetConstFileSystemSample() const262 const FileSystemSample& TraceDataCacheReader::GetConstFileSystemSample() const
263 {
264     return fileSamplingTableData_;
265 }
GetConstEbpfCallStackData() const266 const EbpfCallStackData& TraceDataCacheReader::GetConstEbpfCallStackData() const
267 {
268     return ebpfCallStackData_;
269 }
GetConstPagedMemorySampleData() const270 const PagedMemorySampleData& TraceDataCacheReader::GetConstPagedMemorySampleData() const
271 {
272     return pagedMemorySampleData_;
273 }
GetConstHiSysEventSubkeysData() const274 const HiSysEventSubkeys& TraceDataCacheReader::GetConstHiSysEventSubkeysData() const
275 {
276     return sysEventNameIds_;
277 }
GetConstHiSyseventMeasureData() const278 const HiSysEventMeasureData& TraceDataCacheReader::GetConstHiSyseventMeasureData() const
279 {
280     return sysEventMeasureData_;
281 }
GetConstTraceConfigData() const282 const TraceConfig& TraceDataCacheReader::GetConstTraceConfigData() const
283 {
284     return traceConfigData_;
285 }
GetConstHiSysEventDeviceStateData() const286 const HiSysEventDeviceStateData& TraceDataCacheReader::GetConstHiSysEventDeviceStateData() const
287 {
288     return deviceStateData_;
289 }
GetConstHiSysEventAllEventData() const290 const HiSysEventAllEventData& TraceDataCacheReader::GetConstHiSysEventAllEventData() const
291 {
292     return hiSysEventAllEventData_;
293 }
GetConstSmapsData() const294 const SmapsData& TraceDataCacheReader::GetConstSmapsData() const
295 {
296     return smapsData_;
297 }
GetConstBioLatencySampleData() const298 const BioLatencySampleData& TraceDataCacheReader::GetConstBioLatencySampleData() const
299 {
300     return bioLatencySampleData_;
301 }
302 
GetConstClockSnapshotData() const303 const ClockSnapshotData& TraceDataCacheReader::GetConstClockSnapshotData() const
304 {
305     return clockSnapshotData_;
306 }
307 
GetConstDataSourceClockIdData() const308 const DataSourceClockIdData& TraceDataCacheReader::GetConstDataSourceClockIdData() const
309 {
310     return dataSourceClockIdData_;
311 }
GetConstFrameSliceData() const312 const FrameSlice& TraceDataCacheReader::GetConstFrameSliceData() const
313 {
314     return frameSliceData_;
315 }
GetConstFrameMapsData() const316 const FrameMaps& TraceDataCacheReader::GetConstFrameMapsData() const
317 {
318     return frameMapsData_;
319 }
GetConstGPUSliceData() const320 const GPUSlice& TraceDataCacheReader::GetConstGPUSliceData() const
321 {
322     return gpuSliceData_;
323 }
GetConstAppStartupData() const324 const AppStartup& TraceDataCacheReader::GetConstAppStartupData() const
325 {
326     return appStartupData_;
327 }
GetConstSoStaticInitalizationData() const328 const SoStaticInitalization& TraceDataCacheReader::GetConstSoStaticInitalizationData() const
329 {
330     return soStaticInitalizationData_;
331 }
GetConstAnimation() const332 const Animation& TraceDataCacheReader::GetConstAnimation() const
333 {
334     return animation_;
335 }
GetConstDeviceInfo() const336 const DeviceInfo& TraceDataCacheReader::GetConstDeviceInfo() const
337 {
338     return deviceInfo_;
339 }
GetConstDynamicFrame() const340 const DynamicFrame& TraceDataCacheReader::GetConstDynamicFrame() const
341 {
342     return dynamicFrame_;
343 }
GetConstAshMemData() const344 const AshMemData& TraceDataCacheReader::GetConstAshMemData() const
345 {
346     return ashMemData_;
347 }
GetConstDmaMemData() const348 const DmaMemData& TraceDataCacheReader::GetConstDmaMemData() const
349 {
350     return dmaMemData_;
351 }
GetConstGpuProcessMemData() const352 const GpuProcessMemData& TraceDataCacheReader::GetConstGpuProcessMemData() const
353 {
354     return gpuProcessMemData_;
355 }
GetConstGpuWindowMemData() const356 const GpuWindowMemData& TraceDataCacheReader::GetConstGpuWindowMemData() const
357 {
358     return gpuWindowMemData_;
359 }
GetConstCpuDumpInfo() const360 const CpuDumpInfo& TraceDataCacheReader::GetConstCpuDumpInfo() const
361 {
362     return cpuDumpInfo_;
363 }
GetConstProfileMemInfo() const364 const ProfileMemInfo& TraceDataCacheReader::GetConstProfileMemInfo() const
365 {
366     return profileMemInfo_;
367 }
GetConstRSImageDumpInfo() const368 const RSImageDumpInfo& TraceDataCacheReader::GetConstRSImageDumpInfo() const
369 {
370     return rsImageDumpInfo_;
371 }
372 } // namespace TraceStreamer
373 } // namespace SysTuning
374