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