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 HILOG_STDTYPE_H 17 #define HILOG_STDTYPE_H 18 #include "base_stdtype.h" 19 20 namespace SysTuning { 21 namespace TraceStdtype { 22 class LogInfo : public CacheBase { 23 public: 24 size_t AppendNewLogInfo(uint64_t seq, 25 uint64_t timeStamp, 26 uint32_t pid, 27 uint32_t tid, 28 DataIndex level, 29 DataIndex tag, 30 DataIndex context, 31 uint64_t originTs); 32 const std::deque<uint64_t>& HilogLineSeqs() const; 33 const std::deque<uint32_t>& Pids() const; 34 const std::deque<uint32_t>& Tids() const; 35 const std::deque<DataIndex>& Levels() const; 36 const std::deque<DataIndex>& Tags() const; 37 const std::deque<DataIndex>& Contexts() const; 38 const std::deque<uint64_t>& OriginTimeStamData() const; Clear()39 void Clear() override 40 { 41 CacheBase::Clear(); 42 hilogLineSeqs_.clear(); 43 pids_.clear(); 44 levels_.clear(); 45 tags_.clear(); 46 contexts_.clear(); 47 originTs_.clear(); 48 } 49 50 private: 51 std::deque<uint64_t> hilogLineSeqs_ = {}; 52 std::deque<uint32_t> pids_ = {}; 53 std::deque<uint32_t> tids_ = {}; 54 std::deque<DataIndex> levels_ = {}; 55 std::deque<DataIndex> tags_ = {}; 56 std::deque<DataIndex> contexts_ = {}; 57 std::deque<uint64_t> originTs_ = {}; 58 }; 59 } // namespace TraceStdtype 60 } // namespace SysTuning 61 #endif // HILOG_STDTYPE_H 62