• 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 
75 
GetConstThreadMeasureFilterData() const76 const ThreadMeasureFilter& TraceDataCacheReader::GetConstThreadMeasureFilterData() const
77 {
78     return threadMeasureFilterData_;
79 }
GetConstThreadStateData() const80 const ThreadState& TraceDataCacheReader::GetConstThreadStateData() const
81 {
82     return threadStateData_;
83 }
GetConstSchedSliceData() const84 const SchedSlice& TraceDataCacheReader::GetConstSchedSliceData() const
85 {
86     return schedSliceData_;
87 }
GetConstCpuMeasureData() const88 const CpuMeasureFilter& TraceDataCacheReader::GetConstCpuMeasureData() const
89 {
90     return cpuMeasureData_;
91 }
GetConstThreadFilterData() const92 const ThreadMeasureFilter& TraceDataCacheReader::GetConstThreadFilterData() const
93 {
94     return threadFilterData_;
95 }
GetConstInstantsData() const96 const Instants& TraceDataCacheReader::GetConstInstantsData() const
97 {
98     return instantsData_;
99 }
GetConstProcessFilterData() const100 const ProcessMeasureFilter& TraceDataCacheReader::GetConstProcessFilterData() const
101 {
102     return processFilterData_;
103 }
GetConstProcessMeasureFilterData() const104 const ProcessMeasureFilter& TraceDataCacheReader::GetConstProcessMeasureFilterData() const
105 {
106     return processMeasureFilterData_;
107 }
108 
GetConstClockEventFilterData() const109 const ClockEventData& TraceDataCacheReader::GetConstClockEventFilterData() const
110 {
111     return clockEventFilterData_;
112 }
GetConstClkEventFilterData() const113 const ClkEventData& TraceDataCacheReader::GetConstClkEventFilterData() const
114 {
115     return clkEventFilterData_;
116 }
GetConstSchedStateData(uint64_t rowId) const117 const std::string& TraceDataCacheReader::GetConstSchedStateData(uint64_t rowId) const
118 {
119     TS_ASSERT(statusString_.find(rowId) != statusString_.end());
120     return statusString_.at(rowId);
121 }
TraceStartTime() const122 uint64_t TraceDataCacheReader::TraceStartTime() const
123 {
124     return traceStartTime_;
125 }
TraceEndTime() const126 uint64_t TraceDataCacheReader::TraceEndTime() const
127 {
128     return traceEndTime_;
129 }
130 
GetConstStatAndInfo() const131 const StatAndInfo& TraceDataCacheReader::GetConstStatAndInfo() const
132 {
133     return stat_;
134 }
GetConstMetaData() const135 const MetaData& TraceDataCacheReader::GetConstMetaData() const
136 {
137     return metaData_;
138 }
139 
GetConstSymbolsData() const140 const SymbolsData& TraceDataCacheReader::GetConstSymbolsData() const
141 {
142     return symbolsData_;
143 }
144 
GetConstHilogData() const145 const LogInfo& TraceDataCacheReader::GetConstHilogData() const
146 {
147     return hilogData_;
148 }
149 
GetConstNativeHookData() const150 const NativeHook& TraceDataCacheReader::GetConstNativeHookData() const
151 {
152     return nativeHookData_;
153 }
154 
GetConstNativeHookFrameData() const155 const NativeHookFrame& TraceDataCacheReader::GetConstNativeHookFrameData() const
156 {
157     return nativeHookFrameData_;
158 }
159 
GetConstHidumpData() const160 const Hidump& TraceDataCacheReader::GetConstHidumpData() const
161 {
162     return hidumpData_;
163 }
164 
GetConstPerfCallChainData() const165 const PerfCallChain& TraceDataCacheReader::GetConstPerfCallChainData() const
166 {
167     return perfCallChain_;
168 }
GetConstPerfFilesData() const169 const PerfFiles& TraceDataCacheReader::GetConstPerfFilesData() const
170 {
171     return perfFiles_;
172 }
GetConstPerfSampleData() const173 const PerfSample& TraceDataCacheReader::GetConstPerfSampleData() const
174 {
175     return perfSample_;
176 }
GetConstPerfThreadData() const177 const PerfThread& TraceDataCacheReader::GetConstPerfThreadData() const
178 {
179     return perfThread_;
180 }
GetConstPerfReportData() const181 const PerfReport& TraceDataCacheReader::GetConstPerfReportData() const
182 {
183     return perfReport_;
184 }
GetConstSysCallData() const185 const SysCall& TraceDataCacheReader::GetConstSysCallData() const
186 {
187     return sysCallData_;
188 }
GetConstArgSetData() const189 const ArgSet& TraceDataCacheReader::GetConstArgSetData() const
190 {
191     return argSet_;
192 }
193 
GetConstDataTypeData() const194 const DataType& TraceDataCacheReader::GetConstDataTypeData() const
195 {
196     return dataType_;
197 }
198 
GetConstSysMeasureFilterData() const199 const SysMeasureFilter& TraceDataCacheReader::GetConstSysMeasureFilterData() const
200 {
201     return sysEvent_;
202 }
GetConstNetworkData() const203 const NetDetailData& TraceDataCacheReader::GetConstNetworkData() const
204 {
205     return networkData_;
206 }
GetConstCpuUsageInfoData() const207 const CpuUsageDetailData& TraceDataCacheReader::GetConstCpuUsageInfoData() const
208 {
209     return cpuUsageData_;
210 }
GetConstDiskIOData() const211 const DiskIOData& TraceDataCacheReader::GetConstDiskIOData() const
212 {
213     return diskIOData_;
214 }
GetConstLiveProcessData() const215 const LiveProcessDetailData& TraceDataCacheReader::GetConstLiveProcessData() const
216 {
217     return liveProcessDetailData_;
218 }
GetConstFileSystemSample() const219 const FileSystemSample& TraceDataCacheReader::GetConstFileSystemSample() const
220 {
221     return fileSamplingTableData_;
222 }
GetConstEbpfCallStackData() const223 const EbpfCallStackData& TraceDataCacheReader::GetConstEbpfCallStackData() const
224 {
225     return ebpfCallStackData_;
226 }
GetConstPagedMemorySampleData() const227 const PagedMemorySampleData& TraceDataCacheReader::GetConstPagedMemorySampleData() const
228 {
229     return PagedMemorySampleData_;
230 }
231 #if WITH_EBPF_HELP
GetConstEbpfProcessMaps() const232 const EbpfProcessMaps& TraceDataCacheReader::GetConstEbpfProcessMaps() const
233 {
234     return ebpfProcessMaps_;
235 }
GetConstEbpfElf() const236 const EbpfElf& TraceDataCacheReader::GetConstEbpfElf() const
237 {
238     return ebpfElf_;
239 }
GetConstEbpfElfSymbol() const240 const EbpfElfSymbol& TraceDataCacheReader::GetConstEbpfElfSymbol() const
241 {
242     return ebpfElfSymbol_;
243 }
244 #endif
GetConstAppNamesData() const245 const AppNames& TraceDataCacheReader::GetConstAppNamesData() const
246 {
247     return appNames_;
248 }
GetConstSyseventMeasureData() const249 const SysEventMeasureData& TraceDataCacheReader::GetConstSyseventMeasureData() const
250 {
251     return sysEventMeasureData_;
252 }
GetConstDeviceStateData() const253 const DeviceStateData& TraceDataCacheReader::GetConstDeviceStateData() const
254 {
255     return deviceStateData_;
256 }
GetConstSmapsData() const257 const SmapsData& TraceDataCacheReader::GetConstSmapsData() const
258 {
259     return smapsData_;
260 }
GetConstBioLatencySampleData() const261 const BioLatencySampleData& TraceDataCacheReader::GetConstBioLatencySampleData() const
262 {
263     return bioLatencySampleData_;
264 }
265 
GetConstClockSnapshotData() const266 const ClockSnapshotData& TraceDataCacheReader::GetConstClockSnapshotData() const
267 {
268     return clockSnapshotData_;
269 }
270 
GetConstDataSourceClockIdData() const271 const DataSourceClockIdData& TraceDataCacheReader::GetConstDataSourceClockIdData() const
272 {
273     return dataSourceClockIdData_;
274 }
275 } // namespace TraceStreamer
276 } // namespace SysTuning
277