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