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 #ifndef APP_STARTUP_STDTYPE_H 17 #define APP_STARTUP_STDTYPE_H 18 #include "base_stdtype.h" 19 20 namespace SysTuning { 21 namespace TraceStdtype { 22 struct AppStartupRow { 23 uint32_t ipid = INVALID_UINT32; 24 uint32_t tid = INVALID_UINT32; 25 uint32_t callId = INVALID_UINT32; 26 uint64_t startTime = INVALID_UINT64; 27 uint64_t endTime = INVALID_UINT64; 28 uint32_t startName = INVALID_UINT32; 29 DataIndex packedName = INVALID_UINT64; 30 }; 31 class AppStartup : public CacheBase { 32 public: 33 size_t AppendNewData(const AppStartupRow &appStartupRow); 34 const std::deque<uint32_t> &Pids() const; 35 const std::deque<uint32_t> &Tids() const; 36 const std::deque<uint32_t> &CallIds() const; 37 const std::deque<uint64_t> &StartTimes() const; 38 const std::deque<uint64_t> &EndTimes() const; 39 const std::deque<uint32_t> &StartNames() const; 40 const std::deque<DataIndex> &PackedNames() const; 41 Clear()42 void Clear() override 43 { 44 CacheBase::Clear(); 45 ipids_.clear(); 46 tids_.clear(); 47 callIds_.clear(); 48 startTimes_.clear(); 49 endTimes_.clear(); 50 startNames_.clear(); 51 packedNames_.clear(); 52 } 53 54 private: 55 std::deque<uint32_t> ipids_ = {}; 56 std::deque<uint32_t> tids_ = {}; 57 std::deque<uint32_t> callIds_ = {}; 58 std::deque<uint64_t> startTimes_ = {}; 59 std::deque<uint64_t> endTimes_ = {}; 60 std::deque<uint32_t> startNames_ = {}; 61 std::deque<DataIndex> packedNames_ = {}; 62 }; 63 struct SoStaticInitalizationRow { 64 uint32_t ipid = INVALID_UINT32; 65 uint32_t tid = INVALID_UINT32; 66 uint32_t callId = INVALID_UINT32; 67 uint64_t startTime = INVALID_UINT64; 68 uint64_t endTime = INVALID_UINT64; 69 DataIndex soName = INVALID_UINT64; 70 uint32_t depth = INVALID_UINT32; 71 }; 72 class SoStaticInitalization : public CacheBase { 73 public: 74 size_t AppendNewData(const SoStaticInitalizationRow &soStaticInitalizationRow); 75 const std::deque<uint32_t> &Pids() const; 76 const std::deque<uint32_t> &Tids() const; 77 const std::deque<uint32_t> &CallIds() const; 78 const std::deque<uint64_t> &StartTimes() const; 79 const std::deque<uint64_t> &EndTimes() const; 80 const std::deque<DataIndex> &SoNames() const; 81 const std::deque<uint32_t> Depths() const; 82 Clear()83 void Clear() override 84 { 85 CacheBase::Clear(); 86 ipids_.clear(); 87 tids_.clear(); 88 callIds_.clear(); 89 startTimes_.clear(); 90 endTimes_.clear(); 91 soNames_.clear(); 92 depths_.clear(); 93 } 94 95 private: 96 std::deque<uint32_t> ipids_ = {}; 97 std::deque<uint32_t> tids_ = {}; 98 std::deque<uint32_t> callIds_ = {}; 99 std::deque<uint64_t> startTimes_ = {}; 100 std::deque<uint64_t> endTimes_ = {}; 101 std::deque<DataIndex> soNames_ = {}; 102 std::deque<uint32_t> depths_ = {}; 103 }; 104 } // namespace TraceStdtype 105 } // namespace SysTuning 106 #endif // APP_STARTUP_STDTYPE_H 107