• 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 #ifndef TRACE_DATA_CACHE_WRITER_H
17 #define TRACE_DATA_CACHE_WRITER_H
18 
19 #include "trace_data_cache_reader.h"
20 
21 namespace SysTuning {
22 namespace TraceStreamer {
23 using namespace TraceStdtype;
24 class TraceDataCacheWriter : virtual public TraceDataCacheBase {
25 public:
26     TraceDataCacheWriter() = default;
27     TraceDataCacheWriter(const TraceDataCacheWriter&) = delete;
28     TraceDataCacheWriter& operator=(const TraceDataCacheWriter&) = delete;
29     ~TraceDataCacheWriter() override;
30     void Clear();
31 
32 public:
33     InternalPid GetProcessInternalPid(uint32_t pid);
34     Process* GetProcessData(InternalPid internalPid);
35     uint32_t AppendNewProcessData(uint32_t pid, const std::string& name, uint64_t startTs);
36     InternalTid NewInternalThread(uint32_t tid);
37     Thread* GetThreadData(InternalTid internalTid);
38     void UpdateTraceTime(uint64_t timestamp);
39     void MixTraceTime(uint64_t timestampMin, uint64_t timestampMax);
40     CallStack* GetInternalSlicesData();
41     CallStack* GetIrqData();
42     Filter* GetFilterData();
43     Raw* GetRawData();
44     Measure* GetMeasureData();
45     Measure* GetSysMemMeasureData();
46     Measure* GetProcessMeasureData();
47     ThreadState* GetThreadStateData();
48     SchedSlice* GetSchedSliceData();
49     CpuMeasureFilter* GetCpuMeasuresData();
50     ThreadMeasureFilter* GetThreadMeasureFilterData();
51     ThreadMeasureFilter* GetThreadFilterData();
52     Instants* GetInstantsData();
53     ProcessMeasureFilter* GetProcessFilterData();
54     ProcessMeasureFilter* GetProcessMeasureFilterData();
55     ClockEventData* GetClockEventFilterData();
56     ClkEventData* GetClkEventFilterData();
57     StatAndInfo* GetStatAndInfo();
58     MetaData* GetMetaData();
59     SymbolsData* GetSymbolsData();
60     SysCall* GetSysCallData();
61     LogInfo* GetHilogData();
62     NativeHook* GetNativeHookData();
63     NativeHookFrame* GetNativeHookFrameData();
64     Hidump* GetHidumpData();
65     PerfCallChain* GetPerfCallChainData();
66     PerfFiles* GetPerfFilesData();
67     PerfSample* GetPerfSampleData();
68     PerfThread* GetPerfThreadData();
69     PerfReport* GetPerfReportData();
70     ArgSet* GetArgSetData();
71     DataType* GetDataTypeData();
72     SysMeasureFilter* GetSysMeasureFilterData();
73     NetDetailData* GetNetworkData();
74     NetDetailData* GetNetworkDetailData();
75     DiskIOData* GetDiskIOData();
76     CpuUsageDetailData* GetCpuUsageInfoData();
77     LiveProcessDetailData* GetLiveProcessData();
78     FileSystemSample* GetFileSystemSample();
79     EbpfCallStackData* GetEbpfCallStack();
80     PagedMemorySampleData* GetPagedMemorySampleData();
81 #if WITH_EBPF_HELP
82     EbpfProcessMaps* GetEbpfProcessMaps();
83     EbpfElf* GetEbpfElf();
84     EbpfElfSymbol* GetEbpfElfSymbol();
85 #endif
86     AppNames* GetAppNamesData();
87     SysEventMeasureData* GetSyseventMeasureData();
88     DeviceStateData* GetDeviceStateData();
89     SmapsData* GetSmapsData();
90     BioLatencySampleData* GetBioLatencySampleData();
91     ClockSnapshotData* GetClockSnapshotData();
92     DataSourceClockIdData* GetDataSourceClockIdData();
93 };
94 } // namespace TraceStreamer
95 } // namespace SysTuning
96 #endif
97