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()21TraceDataCacheReader::~TraceDataCacheReader() {} GetDataFromDict(DataIndex id) const22const std::string& TraceDataCacheReader::GetDataFromDict(DataIndex id) const 23 { 24 return dataDict_.GetDataFromDict(id); 25 } 26 GetConstProcessData() const27const std::deque<Process>& TraceDataCacheReader::GetConstProcessData() const 28 { 29 return internalProcessesData_; 30 } GetConstProcessData(InternalPid internalPid) const31const Process& TraceDataCacheReader::GetConstProcessData(InternalPid internalPid) const 32 { 33 TS_ASSERT(internalPid < internalProcessesData_.size()); 34 return internalProcessesData_[internalPid]; 35 } GetConstThreadData(InternalTid internalTid) const36const Thread& TraceDataCacheReader::GetConstThreadData(InternalTid internalTid) const 37 { 38 TS_ASSERT(internalTid < internalThreadsData_.size()); 39 return internalThreadsData_[internalTid]; 40 } 41 GetConstThreadData() const42const std::deque<Thread>& TraceDataCacheReader::GetConstThreadData() const 43 { 44 return internalThreadsData_; 45 } GetConstInternalSlicesData() const46const CallStack& TraceDataCacheReader::GetConstInternalSlicesData() const 47 { 48 return callstackData_; 49 } GetConstIrqData() const50const CallStack& TraceDataCacheReader::GetConstIrqData() const 51 { 52 return irqData_; 53 } GetConstFilterData() const54const Filter& TraceDataCacheReader::GetConstFilterData() const 55 { 56 return filterData_; 57 } GetConstRawTableData() const58const Raw& TraceDataCacheReader::GetConstRawTableData() const 59 { 60 return rawData_; 61 } GetConstMeasureData() const62const Measure& TraceDataCacheReader::GetConstMeasureData() const 63 { 64 return measureData_; 65 } GetConstSysMemMeasureData() const66const Measure& TraceDataCacheReader::GetConstSysMemMeasureData() const 67 { 68 return sysMemMeasureData_; 69 } GetConstProcessMeasureData() const70const Measure& TraceDataCacheReader::GetConstProcessMeasureData() const 71 { 72 return processMeasureData_; 73 } 74 GetConstThreadStateData() const75const ThreadStateData& TraceDataCacheReader::GetConstThreadStateData() const 76 { 77 return threadStateData_; 78 } GetConstSchedSliceData() const79const SchedSlice& TraceDataCacheReader::GetConstSchedSliceData() const 80 { 81 return schedSliceData_; 82 } GetConstCpuMeasureData() const83const CpuMeasureFilter& TraceDataCacheReader::GetConstCpuMeasureData() const 84 { 85 return cpuMeasureData_; 86 } GetConstInstantsData() const87const Instants& TraceDataCacheReader::GetConstInstantsData() const 88 { 89 return instantsData_; 90 } GetConstProcessMeasureFilterData() const91const ProcessMeasureFilter& TraceDataCacheReader::GetConstProcessMeasureFilterData() const 92 { 93 return processMeasureFilterData_; 94 } 95 GetConstClockEventFilterData() const96const ClockEventData& TraceDataCacheReader::GetConstClockEventFilterData() const 97 { 98 return clockEventFilterData_; 99 } GetConstClkEventFilterData() const100const ClkEventData& TraceDataCacheReader::GetConstClkEventFilterData() const 101 { 102 return clkEventFilterData_; 103 } GetConstSchedStateData(uint64_t rowId) const104const std::string& TraceDataCacheReader::GetConstSchedStateData(uint64_t rowId) const 105 { 106 TS_ASSERT(statusString_.find(rowId) != statusString_.end()); 107 return statusString_.at(rowId); 108 } TraceStartTime() const109uint64_t TraceDataCacheReader::TraceStartTime() const 110 { 111 return traceStartTime_; 112 } TraceEndTime() const113uint64_t TraceDataCacheReader::TraceEndTime() const 114 { 115 return traceEndTime_; 116 } 117 GetConstStatAndInfo() const118const StatAndInfo& TraceDataCacheReader::GetConstStatAndInfo() const 119 { 120 return stat_; 121 } GetConstMetaData() const122const MetaData& TraceDataCacheReader::GetConstMetaData() const 123 { 124 return metaData_; 125 } 126 GetConstSymbolsData() const127const SymbolsData& TraceDataCacheReader::GetConstSymbolsData() const 128 { 129 return symbolsData_; 130 } 131 GetConstHilogData() const132const LogInfo& TraceDataCacheReader::GetConstHilogData() const 133 { 134 return hilogData_; 135 } 136 GetConstNativeHookData() const137const NativeHook& TraceDataCacheReader::GetConstNativeHookData() const 138 { 139 return nativeHookData_; 140 } 141 GetConstNativeHookFrameData() const142const NativeHookFrame& TraceDataCacheReader::GetConstNativeHookFrameData() const 143 { 144 return nativeHookFrameData_; 145 } GetConstNativeHookStatisticData() const146const NativeHookStatistic& TraceDataCacheReader::GetConstNativeHookStatisticData() const 147 { 148 return nativeHookStatisticData_; 149 } GetConstHidumpData() const150const Hidump& TraceDataCacheReader::GetConstHidumpData() const 151 { 152 return hidumpData_; 153 } 154 GetConstPerfCallChainData() const155const PerfCallChain& TraceDataCacheReader::GetConstPerfCallChainData() const 156 { 157 return perfCallChain_; 158 } GetConstPerfFilesData() const159const PerfFiles& TraceDataCacheReader::GetConstPerfFilesData() const 160 { 161 return perfFiles_; 162 } GetConstPerfSampleData() const163const PerfSample& TraceDataCacheReader::GetConstPerfSampleData() const 164 { 165 return perfSample_; 166 } GetConstPerfThreadData() const167const PerfThread& TraceDataCacheReader::GetConstPerfThreadData() const 168 { 169 return perfThread_; 170 } GetConstPerfReportData() const171const PerfReport& TraceDataCacheReader::GetConstPerfReportData() const 172 { 173 return perfReport_; 174 } GetConstSysCallData() const175const SysCall& TraceDataCacheReader::GetConstSysCallData() const 176 { 177 return sysCallData_; 178 } GetConstArgSetData() const179const ArgSet& TraceDataCacheReader::GetConstArgSetData() const 180 { 181 return argSet_; 182 } GetConstTaskPoolData() const183const TaskPoolInfo& TraceDataCacheReader::GetConstTaskPoolData() const 184 { 185 return taskPoolInfo_; 186 } GetConstJsHeapFilesData() const187const JsHeapFiles& TraceDataCacheReader::GetConstJsHeapFilesData() const 188 { 189 return jsHeapFilesData_; 190 } GetConstJsHeapEdgesData() const191const JsHeapEdges& TraceDataCacheReader::GetConstJsHeapEdgesData() const 192 { 193 return jsHeapEdgesData_; 194 } GetConstJsHeapInfoData() const195const JsHeapInfo& TraceDataCacheReader::GetConstJsHeapInfoData() const 196 { 197 return jsHeapInfoData_; 198 } GetConstJsHeapLocationData() const199const JsHeapLocation& TraceDataCacheReader::GetConstJsHeapLocationData() const 200 { 201 return jsHeapLocationData_; 202 } GetConstJsHeapNodesData() const203const JsHeapNodes& TraceDataCacheReader::GetConstJsHeapNodesData() const 204 { 205 return jsHeapNodesData_; 206 } GetConstJsHeapSampleData() const207const JsHeapSample& TraceDataCacheReader::GetConstJsHeapSampleData() const 208 { 209 return jsHeapSampleData_; 210 } GetConstJsHeapStringData() const211const JsHeapString& TraceDataCacheReader::GetConstJsHeapStringData() const 212 { 213 return jsHeapStringData_; 214 } GetConstJsHeapTraceFuncInfoData() const215const JsHeapTraceFuncInfo& TraceDataCacheReader::GetConstJsHeapTraceFuncInfoData() const 216 { 217 return jsHeapTraceFuncInfoData_; 218 } GetConstJsHeapTraceNodeData() const219const JsHeapTraceNode& TraceDataCacheReader::GetConstJsHeapTraceNodeData() const 220 { 221 return jsHeapTraceNodeData_; 222 } GetConstJsCpuProfilerNodeData() const223const JsCpuProfilerNode& TraceDataCacheReader::GetConstJsCpuProfilerNodeData() const 224 { 225 return jsCpuProfilerNodeData_; 226 } GetConstJsCpuProfilerSampleData() const227const JsCpuProfilerSample& TraceDataCacheReader::GetConstJsCpuProfilerSampleData() const 228 { 229 return jsCpuProfilerSampleData_; 230 } 231 GetConstJsConfigData() const232const JsConfig& TraceDataCacheReader::GetConstJsConfigData() const 233 { 234 return jsConfigData_; 235 } 236 GetConstDataTypeData() const237const DataType& TraceDataCacheReader::GetConstDataTypeData() const 238 { 239 return dataType_; 240 } 241 GetConstSysMeasureFilterData() const242const SysMeasureFilter& TraceDataCacheReader::GetConstSysMeasureFilterData() const 243 { 244 return sysEvent_; 245 } GetConstNetworkData() const246const NetDetailData& TraceDataCacheReader::GetConstNetworkData() const 247 { 248 return networkData_; 249 } GetConstCpuUsageInfoData() const250const CpuUsageDetailData& TraceDataCacheReader::GetConstCpuUsageInfoData() const 251 { 252 return cpuUsageData_; 253 } GetConstDiskIOData() const254const DiskIOData& TraceDataCacheReader::GetConstDiskIOData() const 255 { 256 return diskIOData_; 257 } GetConstLiveProcessData() const258const LiveProcessDetailData& TraceDataCacheReader::GetConstLiveProcessData() const 259 { 260 return liveProcessDetailData_; 261 } GetConstFileSystemSample() const262const FileSystemSample& TraceDataCacheReader::GetConstFileSystemSample() const 263 { 264 return fileSamplingTableData_; 265 } GetConstEbpfCallStackData() const266const EbpfCallStackData& TraceDataCacheReader::GetConstEbpfCallStackData() const 267 { 268 return ebpfCallStackData_; 269 } GetConstPagedMemorySampleData() const270const PagedMemorySampleData& TraceDataCacheReader::GetConstPagedMemorySampleData() const 271 { 272 return pagedMemorySampleData_; 273 } GetConstHiSysEventSubkeysData() const274const HiSysEventSubkeys& TraceDataCacheReader::GetConstHiSysEventSubkeysData() const 275 { 276 return sysEventNameIds_; 277 } GetConstHiSyseventMeasureData() const278const HiSysEventMeasureData& TraceDataCacheReader::GetConstHiSyseventMeasureData() const 279 { 280 return sysEventMeasureData_; 281 } GetConstTraceConfigData() const282const TraceConfig& TraceDataCacheReader::GetConstTraceConfigData() const 283 { 284 return traceConfigData_; 285 } GetConstHiSysEventDeviceStateData() const286const HiSysEventDeviceStateData& TraceDataCacheReader::GetConstHiSysEventDeviceStateData() const 287 { 288 return deviceStateData_; 289 } GetConstHiSysEventAllEventData() const290const HiSysEventAllEventData& TraceDataCacheReader::GetConstHiSysEventAllEventData() const 291 { 292 return hiSysEventAllEventData_; 293 } GetConstSmapsData() const294const SmapsData& TraceDataCacheReader::GetConstSmapsData() const 295 { 296 return smapsData_; 297 } GetConstBioLatencySampleData() const298const BioLatencySampleData& TraceDataCacheReader::GetConstBioLatencySampleData() const 299 { 300 return bioLatencySampleData_; 301 } 302 GetConstClockSnapshotData() const303const ClockSnapshotData& TraceDataCacheReader::GetConstClockSnapshotData() const 304 { 305 return clockSnapshotData_; 306 } 307 GetConstDataSourceClockIdData() const308const DataSourceClockIdData& TraceDataCacheReader::GetConstDataSourceClockIdData() const 309 { 310 return dataSourceClockIdData_; 311 } GetConstFrameSliceData() const312const FrameSlice& TraceDataCacheReader::GetConstFrameSliceData() const 313 { 314 return frameSliceData_; 315 } GetConstFrameMapsData() const316const FrameMaps& TraceDataCacheReader::GetConstFrameMapsData() const 317 { 318 return frameMapsData_; 319 } GetConstGPUSliceData() const320const GPUSlice& TraceDataCacheReader::GetConstGPUSliceData() const 321 { 322 return gpuSliceData_; 323 } GetConstAppStartupData() const324const AppStartup& TraceDataCacheReader::GetConstAppStartupData() const 325 { 326 return appStartupData_; 327 } GetConstSoStaticInitalizationData() const328const SoStaticInitalization& TraceDataCacheReader::GetConstSoStaticInitalizationData() const 329 { 330 return soStaticInitalizationData_; 331 } GetConstAnimation() const332const Animation& TraceDataCacheReader::GetConstAnimation() const 333 { 334 return animation_; 335 } GetConstDeviceInfo() const336const DeviceInfo& TraceDataCacheReader::GetConstDeviceInfo() const 337 { 338 return deviceInfo_; 339 } GetConstDynamicFrame() const340const DynamicFrame& TraceDataCacheReader::GetConstDynamicFrame() const 341 { 342 return dynamicFrame_; 343 } GetConstAshMemData() const344const AshMemData& TraceDataCacheReader::GetConstAshMemData() const 345 { 346 return ashMemData_; 347 } GetConstDmaMemData() const348const DmaMemData& TraceDataCacheReader::GetConstDmaMemData() const 349 { 350 return dmaMemData_; 351 } GetConstGpuProcessMemData() const352const GpuProcessMemData& TraceDataCacheReader::GetConstGpuProcessMemData() const 353 { 354 return gpuProcessMemData_; 355 } GetConstGpuWindowMemData() const356const GpuWindowMemData& TraceDataCacheReader::GetConstGpuWindowMemData() const 357 { 358 return gpuWindowMemData_; 359 } GetConstCpuDumpInfo() const360const CpuDumpInfo& TraceDataCacheReader::GetConstCpuDumpInfo() const 361 { 362 return cpuDumpInfo_; 363 } GetConstProfileMemInfo() const364const ProfileMemInfo& TraceDataCacheReader::GetConstProfileMemInfo() const 365 { 366 return profileMemInfo_; 367 } GetConstRSImageDumpInfo() const368const RSImageDumpInfo& TraceDataCacheReader::GetConstRSImageDumpInfo() const 369 { 370 return rsImageDumpInfo_; 371 } 372 } // namespace TraceStreamer 373 } // namespace SysTuning 374