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 #ifndef TRACE_DATA_CACHE_READER_H 17 #define TRACE_DATA_CACHE_READER_H 18 19 #include "activity_monitor_stdtype.h" 20 #include "animation_stdtype.h" 21 #include "app_startup_stdtype.h" 22 #include "arkts_stdtype.h" 23 #include "base_stdtype.h" 24 #include "callstack_stdtype.h" 25 #include "common_stdtype.h" 26 #include "ebpf_stdtype.h" 27 #include "hilog_stdtype.h" 28 #include "hiperf_stdtype.h" 29 #include "hisysevent_stdtype.h" 30 #include "measure_stdtype.h" 31 #include "native_memory_stdtype.h" 32 #include "render_service_stdtype.h" 33 #include "sched_stdtype.h" 34 #include "syscall_stdtype.h" 35 #include "task_pool_stdtype.h" 36 #include "trace_data_cache_base.h" 37 38 namespace SysTuning { 39 namespace TraceStreamer { 40 using namespace TraceStdtype; 41 class TraceDataCacheReader : virtual public TraceDataCacheBase { 42 public: 43 TraceDataCacheReader() = default; 44 TraceDataCacheReader(const TraceDataCacheReader&) = delete; 45 TraceDataCacheReader& operator=(const TraceDataCacheReader&) = delete; 46 ~TraceDataCacheReader() override; 47 48 public: 49 const std::string& GetDataFromDict(DataIndex id) const; 50 const Process& GetConstProcessData(InternalPid internalPid) const; 51 const std::deque<Process>& GetConstProcessData() const; 52 const Thread& GetConstThreadData(InternalTid internalTid) const; 53 const std::deque<Thread>& GetConstThreadData() const; 54 const CallStack& GetConstInternalSlicesData() const; 55 const CallStack& GetConstIrqData() const; 56 const Filter& GetConstFilterData() const; 57 const Raw& GetConstRawTableData() const; 58 const Measure& GetConstMeasureData() const; 59 const Measure& GetConstSysMemMeasureData() const; 60 const Measure& GetConstProcessMeasureData() const; 61 const ThreadStateData& GetConstThreadStateData() const; 62 const SchedSlice& GetConstSchedSliceData() const; 63 const CpuMeasureFilter& GetConstCpuMeasureData() const; 64 const Instants& GetConstInstantsData() const; 65 const ProcessMeasureFilter& GetConstProcessMeasureFilterData() const; 66 const ClockEventData& GetConstClockEventFilterData() const; 67 const ClkEventData& GetConstClkEventFilterData() const; 68 const std::string& GetConstSchedStateData(uint64_t rowId) const; 69 uint64_t TraceStartTime() const; 70 uint64_t TraceEndTime() const; 71 const StatAndInfo& GetConstStatAndInfo() const; 72 const MetaData& GetConstMetaData() const; 73 const SymbolsData& GetConstSymbolsData() const; 74 const SysCall& GetConstSysCallData() const; 75 const LogInfo& GetConstHilogData() const; 76 const NativeHook& GetConstNativeHookData() const; 77 const NativeHookFrame& GetConstNativeHookFrameData() const; 78 const NativeHookStatistic& GetConstNativeHookStatisticData() const; 79 const Hidump& GetConstHidumpData() const; 80 const PerfCallChain& GetConstPerfCallChainData() const; 81 const PerfFiles& GetConstPerfFilesData() const; 82 const PerfSample& GetConstPerfSampleData() const; 83 const PerfThread& GetConstPerfThreadData() const; 84 const PerfReport& GetConstPerfReportData() const; 85 const ArgSet& GetConstArgSetData() const; 86 const DataType& GetConstDataTypeData() const; 87 const SysMeasureFilter& GetConstSysMeasureFilterData() const; 88 const NetDetailData& GetConstNetworkData() const; 89 const CpuUsageDetailData& GetConstCpuUsageInfoData() const; 90 const DiskIOData& GetConstDiskIOData() const; 91 const LiveProcessDetailData& GetConstLiveProcessData() const; 92 const FileSystemSample& GetConstFileSystemSample() const; 93 const HiSysEventDeviceStateData& GetConstHiSysEventDeviceStateData() const; 94 const EbpfCallStackData& GetConstEbpfCallStackData() const; 95 const PagedMemorySampleData& GetConstPagedMemorySampleData() const; 96 const HiSysEventSubkeys& GetConstHiSysEventSubkeysData() const; 97 const HiSysEventMeasureData& GetConstHiSyseventMeasureData() const; 98 const TraceConfig& GetConstTraceConfigData() const; 99 const HiSysEventAllEventData& GetConstHiSysEventAllEventData() const; 100 const SmapsData& GetConstSmapsData() const; 101 const BioLatencySampleData& GetConstBioLatencySampleData() const; 102 const ClockSnapshotData& GetConstClockSnapshotData() const; 103 const DataSourceClockIdData& GetConstDataSourceClockIdData() const; 104 const FrameSlice& GetConstFrameSliceData() const; 105 const FrameMaps& GetConstFrameMapsData() const; 106 const GPUSlice& GetConstGPUSliceData() const; 107 const TaskPoolInfo& GetConstTaskPoolData() const; 108 const JsHeapFiles& GetConstJsHeapFilesData() const; 109 const JsHeapEdges& GetConstJsHeapEdgesData() const; 110 const JsHeapInfo& GetConstJsHeapInfoData() const; 111 const JsHeapLocation& GetConstJsHeapLocationData() const; 112 const JsHeapNodes& GetConstJsHeapNodesData() const; 113 const JsHeapSample& GetConstJsHeapSampleData() const; 114 const JsHeapString& GetConstJsHeapStringData() const; 115 const JsHeapTraceFuncInfo& GetConstJsHeapTraceFuncInfoData() const; 116 const JsHeapTraceNode& GetConstJsHeapTraceNodeData() const; 117 const JsCpuProfilerNode& GetConstJsCpuProfilerNodeData() const; 118 const JsCpuProfilerSample& GetConstJsCpuProfilerSampleData() const; 119 const JsConfig& GetConstJsConfigData() const; 120 const AppStartup& GetConstAppStartupData() const; 121 const SoStaticInitalization& GetConstSoStaticInitalizationData() const; 122 const Animation& GetConstAnimation() const; 123 const DeviceInfo& GetConstDeviceInfo() const; 124 const DynamicFrame& GetConstDynamicFrame() const; 125 const AshMemData& GetConstAshMemData() const; 126 const DmaMemData& GetConstDmaMemData() const; 127 const GpuProcessMemData& GetConstGpuProcessMemData() const; 128 const GpuWindowMemData& GetConstGpuWindowMemData() const; 129 const CpuDumpInfo& GetConstCpuDumpInfo() const; 130 const ProfileMemInfo& GetConstProfileMemInfo() const; 131 const RSImageDumpInfo& GetConstRSImageDumpInfo() const; 132 }; 133 } // namespace TraceStreamer 134 } // namespace SysTuning 135 #endif 136