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()20TraceDataCacheReader::~TraceDataCacheReader() {} GetDataFromDict(DataIndex id) const21const std::string &TraceDataCacheReader::GetDataFromDict(DataIndex id) const 22 { 23 return dataDict_.GetDataFromDict(id); 24 } 25 GetConstProcessData() const26const std::deque<Process> &TraceDataCacheReader::GetConstProcessData() const 27 { 28 return internalProcessesData_; 29 } GetConstProcessData(InternalPid internalPid) const30const Process &TraceDataCacheReader::GetConstProcessData(InternalPid internalPid) const 31 { 32 TS_ASSERT(internalPid < internalProcessesData_.size()); 33 return internalProcessesData_[internalPid]; 34 } GetConstThreadData(InternalTid internalTid) const35const Thread &TraceDataCacheReader::GetConstThreadData(InternalTid internalTid) const 36 { 37 TS_ASSERT(internalTid < internalThreadsData_.size()); 38 return internalThreadsData_[internalTid]; 39 } 40 GetConstThreadData() const41const std::deque<Thread> &TraceDataCacheReader::GetConstThreadData() const 42 { 43 return internalThreadsData_; 44 } GetConstInternalSlicesData() const45const CallStack &TraceDataCacheReader::GetConstInternalSlicesData() const 46 { 47 return callstackData_; 48 } GetConstIrqData() const49const CallStack &TraceDataCacheReader::GetConstIrqData() const 50 { 51 return irqData_; 52 } GetConstFilterData() const53const Filter &TraceDataCacheReader::GetConstFilterData() const 54 { 55 return filterData_; 56 } GetConstRawTableData() const57const Raw &TraceDataCacheReader::GetConstRawTableData() const 58 { 59 return rawData_; 60 } GetConstMeasureData() const61const Measure &TraceDataCacheReader::GetConstMeasureData() const 62 { 63 return measureData_; 64 } GetConstSysMemMeasureData() const65const Measure &TraceDataCacheReader::GetConstSysMemMeasureData() const 66 { 67 return sysMemMeasureData_; 68 } GetConstProcessMeasureData() const69const Measure &TraceDataCacheReader::GetConstProcessMeasureData() const 70 { 71 return processMeasureData_; 72 } 73 GetConstThreadStateData() const74const ThreadStateData &TraceDataCacheReader::GetConstThreadStateData() const 75 { 76 return threadStateData_; 77 } GetConstSchedSliceData() const78const SchedSlice &TraceDataCacheReader::GetConstSchedSliceData() const 79 { 80 return schedSliceData_; 81 } GetConstCpuMeasuresData() const82const CpuMeasureFilter &TraceDataCacheReader::GetConstCpuMeasuresData() const 83 { 84 return cpuMeasureData_; 85 } GetConstInstantsData() const86const Instants &TraceDataCacheReader::GetConstInstantsData() const 87 { 88 return instantsData_; 89 } GetConstProcessMeasureFilterData() const90const ProcessMeasureFilter &TraceDataCacheReader::GetConstProcessMeasureFilterData() const 91 { 92 return processMeasureFilterData_; 93 } 94 GetConstClockEventFilterData() const95const ClockEventData &TraceDataCacheReader::GetConstClockEventFilterData() const 96 { 97 return clockEventFilterData_; 98 } GetConstClkEventFilterData() const99const ClkEventData &TraceDataCacheReader::GetConstClkEventFilterData() const 100 { 101 return clkEventFilterData_; 102 } GetConstSchedStateData(uint64_t rowId) const103const std::string &TraceDataCacheReader::GetConstSchedStateData(uint64_t rowId) const 104 { 105 TS_ASSERT(statusString_.find(rowId) != statusString_.end()); 106 return statusString_.at(rowId); 107 } TraceStartTime() const108uint64_t TraceDataCacheReader::TraceStartTime() const 109 { 110 return traceStartTime_; 111 } TraceEndTime() const112uint64_t TraceDataCacheReader::TraceEndTime() const 113 { 114 return traceEndTime_; 115 } 116 GetConstStatAndInfo() const117const StatAndInfo &TraceDataCacheReader::GetConstStatAndInfo() const 118 { 119 return stat_; 120 } GetConstMetaData() const121const MetaData &TraceDataCacheReader::GetConstMetaData() const 122 { 123 return metaData_; 124 } 125 GetConstSymbolsData() const126const SymbolsData &TraceDataCacheReader::GetConstSymbolsData() const 127 { 128 return symbolsData_; 129 } 130 GetConstHilogData() const131const LogInfo &TraceDataCacheReader::GetConstHilogData() const 132 { 133 return hilogData_; 134 } 135 GetConstNativeHookData() const136const NativeHook &TraceDataCacheReader::GetConstNativeHookData() const 137 { 138 return nativeHookData_; 139 } 140 GetConstNativeHookFrameData() const141const NativeHookFrame &TraceDataCacheReader::GetConstNativeHookFrameData() const 142 { 143 return nativeHookFrameData_; 144 } GetConstNativeHookStatisticData() const145const NativeHookStatistic &TraceDataCacheReader::GetConstNativeHookStatisticData() const 146 { 147 return nativeHookStatisticData_; 148 } GetConstHidumpData() const149const Hidump &TraceDataCacheReader::GetConstHidumpData() const 150 { 151 return hidumpData_; 152 } 153 GetConstPerfCallChainData() const154const PerfCallChain &TraceDataCacheReader::GetConstPerfCallChainData() const 155 { 156 return perfCallChain_; 157 } GetConstPerfFilesData() const158const PerfFiles &TraceDataCacheReader::GetConstPerfFilesData() const 159 { 160 return perfFiles_; 161 } GetConstPerfSampleData() const162const PerfSample &TraceDataCacheReader::GetConstPerfSampleData() const 163 { 164 return perfSample_; 165 } GetConstPerfThreadData() const166const PerfThread &TraceDataCacheReader::GetConstPerfThreadData() const 167 { 168 return perfThread_; 169 } GetConstPerfReportData() const170const PerfReport &TraceDataCacheReader::GetConstPerfReportData() const 171 { 172 return perfReport_; 173 } GetConstSysCallData() const174const SysCall &TraceDataCacheReader::GetConstSysCallData() const 175 { 176 return sysCallData_; 177 } GetConstArgSetData() const178const ArgSet &TraceDataCacheReader::GetConstArgSetData() const 179 { 180 return argSet_; 181 } GetConstTaskPoolData() const182const TaskPoolInfo &TraceDataCacheReader::GetConstTaskPoolData() const 183 { 184 return taskPoolInfo_; 185 } GetConstJsHeapFilesData() const186const JsHeapFiles &TraceDataCacheReader::GetConstJsHeapFilesData() const 187 { 188 return jsHeapFilesData_; 189 } GetConstJsHeapEdgesData() const190const JsHeapEdges &TraceDataCacheReader::GetConstJsHeapEdgesData() const 191 { 192 return jsHeapEdgesData_; 193 } GetConstJsHeapInfoData() const194const JsHeapInfo &TraceDataCacheReader::GetConstJsHeapInfoData() const 195 { 196 return jsHeapInfoData_; 197 } GetConstJsHeapLocationData() const198const JsHeapLocation &TraceDataCacheReader::GetConstJsHeapLocationData() const 199 { 200 return jsHeapLocationData_; 201 } GetConstJsHeapNodesData() const202const JsHeapNodes &TraceDataCacheReader::GetConstJsHeapNodesData() const 203 { 204 return jsHeapNodesData_; 205 } GetConstJsHeapSampleData() const206const JsHeapSample &TraceDataCacheReader::GetConstJsHeapSampleData() const 207 { 208 return jsHeapSampleData_; 209 } GetConstJsHeapStringData() const210const JsHeapString &TraceDataCacheReader::GetConstJsHeapStringData() const 211 { 212 return jsHeapStringData_; 213 } GetConstJsHeapTraceFuncInfoData() const214const JsHeapTraceFuncInfo &TraceDataCacheReader::GetConstJsHeapTraceFuncInfoData() const 215 { 216 return jsHeapTraceFuncInfoData_; 217 } GetConstJsHeapTraceNodeData() const218const JsHeapTraceNode &TraceDataCacheReader::GetConstJsHeapTraceNodeData() const 219 { 220 return jsHeapTraceNodeData_; 221 } GetConstJsCpuProfilerNodeData() const222const JsCpuProfilerNode &TraceDataCacheReader::GetConstJsCpuProfilerNodeData() const 223 { 224 return jsCpuProfilerNodeData_; 225 } GetConstJsCpuProfilerSampleData() const226const JsCpuProfilerSample &TraceDataCacheReader::GetConstJsCpuProfilerSampleData() const 227 { 228 return jsCpuProfilerSampleData_; 229 } 230 GetConstJsConfigData() const231const JsConfig &TraceDataCacheReader::GetConstJsConfigData() const 232 { 233 return jsConfigData_; 234 } 235 GetConstDataTypeData() const236const DataType &TraceDataCacheReader::GetConstDataTypeData() const 237 { 238 return dataType_; 239 } 240 GetConstSysMeasureFilterData() const241const SysMeasureFilter &TraceDataCacheReader::GetConstSysMeasureFilterData() const 242 { 243 return sysEvent_; 244 } GetConstNetworkData() const245const NetDetailData &TraceDataCacheReader::GetConstNetworkData() const 246 { 247 return networkData_; 248 } GetConstCpuUsageInfoData() const249const CpuUsageDetailData &TraceDataCacheReader::GetConstCpuUsageInfoData() const 250 { 251 return cpuUsageData_; 252 } GetConstDiskIOData() const253const DiskIOData &TraceDataCacheReader::GetConstDiskIOData() const 254 { 255 return diskIOData_; 256 } GetConstLiveProcessData() const257const LiveProcessDetailData &TraceDataCacheReader::GetConstLiveProcessData() const 258 { 259 return liveProcessDetailData_; 260 } GetConstFileSystemSample() const261const FileSystemSample &TraceDataCacheReader::GetConstFileSystemSample() const 262 { 263 return fileSamplingTableData_; 264 } GetConstEbpfCallStackData() const265const EbpfCallStackData &TraceDataCacheReader::GetConstEbpfCallStackData() const 266 { 267 return ebpfCallStackData_; 268 } GetConstPagedMemorySampleData() const269const PagedMemorySampleData &TraceDataCacheReader::GetConstPagedMemorySampleData() const 270 { 271 return pagedMemorySampleData_; 272 } GetConstHiSysEventSubkeysData() const273const HiSysEventSubkeys &TraceDataCacheReader::GetConstHiSysEventSubkeysData() const 274 { 275 return sysEventNameIds_; 276 } GetConstHiSyseventMeasureData() const277const HiSysEventMeasureData &TraceDataCacheReader::GetConstHiSyseventMeasureData() const 278 { 279 return sysEventMeasureData_; 280 } GetConstTraceConfigData() const281const TraceConfig &TraceDataCacheReader::GetConstTraceConfigData() const 282 { 283 return traceConfigData_; 284 } GetConstHiSysEventDeviceStateData() const285const HiSysEventDeviceStateData &TraceDataCacheReader::GetConstHiSysEventDeviceStateData() const 286 { 287 return deviceStateData_; 288 } GetConstHiSysEventAllEventData() const289const HiSysEventAllEventData &TraceDataCacheReader::GetConstHiSysEventAllEventData() const 290 { 291 return hiSysEventAllEventData_; 292 } GetConstSmapsData() const293const SmapsData &TraceDataCacheReader::GetConstSmapsData() const 294 { 295 return smapsData_; 296 } GetConstBioLatencySampleData() const297const BioLatencySampleData &TraceDataCacheReader::GetConstBioLatencySampleData() const 298 { 299 return bioLatencySampleData_; 300 } 301 GetConstClockSnapshotData() const302const ClockSnapshotData &TraceDataCacheReader::GetConstClockSnapshotData() const 303 { 304 return clockSnapshotData_; 305 } 306 GetConstDataSourceClockIdData() const307const DataSourceClockIdData &TraceDataCacheReader::GetConstDataSourceClockIdData() const 308 { 309 return dataSourceClockIdData_; 310 } GetConstFrameSliceData() const311const FrameSlice &TraceDataCacheReader::GetConstFrameSliceData() const 312 { 313 return frameSliceData_; 314 } GetConstFrameMapsData() const315const FrameMaps &TraceDataCacheReader::GetConstFrameMapsData() const 316 { 317 return frameMapsData_; 318 } GetConstGPUSliceData() const319const GPUSlice &TraceDataCacheReader::GetConstGPUSliceData() const 320 { 321 return gpuSliceData_; 322 } GetConstAppStartupData() const323const AppStartup &TraceDataCacheReader::GetConstAppStartupData() const 324 { 325 return appStartupData_; 326 } GetConstSoStaticInitalizationData() const327const SoStaticInitalization &TraceDataCacheReader::GetConstSoStaticInitalizationData() const 328 { 329 return soStaticInitalizationData_; 330 } GetConstAnimation() const331const Animation &TraceDataCacheReader::GetConstAnimation() const 332 { 333 return animation_; 334 } GetConstDeviceInfo() const335const DeviceInfo &TraceDataCacheReader::GetConstDeviceInfo() const 336 { 337 return deviceInfo_; 338 } GetConstDynamicFrame() const339const DynamicFrame &TraceDataCacheReader::GetConstDynamicFrame() const 340 { 341 return dynamicFrame_; 342 } GetConstAshMemData() const343const AshMemData &TraceDataCacheReader::GetConstAshMemData() const 344 { 345 return ashMemData_; 346 } GetConstDmaMemData() const347const DmaMemData &TraceDataCacheReader::GetConstDmaMemData() const 348 { 349 return dmaMemData_; 350 } GetConstGpuProcessMemData() const351const GpuProcessMemData &TraceDataCacheReader::GetConstGpuProcessMemData() const 352 { 353 return gpuProcessMemData_; 354 } GetConstGpuWindowMemData() const355const GpuWindowMemData &TraceDataCacheReader::GetConstGpuWindowMemData() const 356 { 357 return gpuWindowMemData_; 358 } GetConstCpuDumpInfo() const359const CpuDumpInfo &TraceDataCacheReader::GetConstCpuDumpInfo() const 360 { 361 return cpuDumpInfo_; 362 } GetConstProfileMemInfo() const363const ProfileMemInfo &TraceDataCacheReader::GetConstProfileMemInfo() const 364 { 365 return profileMemInfo_; 366 } GetConstRSImageDumpInfo() const367const RSImageDumpInfo &TraceDataCacheReader::GetConstRSImageDumpInfo() const 368 { 369 return rsImageDumpInfo_; 370 } 371 } // namespace TraceStreamer 372 } // namespace SysTuning 373