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 #include "hilog_stdtype.h"
16
17 namespace SysTuning {
18 namespace TraceStdtype {
AppendNewLogInfo(uint64_t seq,uint64_t timeStamp,uint32_t pid,uint32_t tid,DataIndex level,DataIndex tag,DataIndex context,uint64_t originTs)19 size_t LogInfo::AppendNewLogInfo(uint64_t seq,
20 uint64_t timeStamp,
21 uint32_t pid,
22 uint32_t tid,
23 DataIndex level,
24 DataIndex tag,
25 DataIndex context,
26 uint64_t originTs)
27 {
28 hilogLineSeqs_.emplace_back(seq);
29 timeStamps_.emplace_back(timeStamp);
30 pids_.emplace_back(pid);
31 tids_.emplace_back(tid);
32 levels_.emplace_back(level);
33 tags_.emplace_back(tag);
34 contexts_.emplace_back(context);
35 originTs_.emplace_back(originTs);
36 return Size() - 1;
37 }
HilogLineSeqs() const38 const std::deque<uint64_t>& LogInfo::HilogLineSeqs() const
39 {
40 return hilogLineSeqs_;
41 }
Pids() const42 const std::deque<uint32_t>& LogInfo::Pids() const
43 {
44 return pids_;
45 }
Tids() const46 const std::deque<uint32_t>& LogInfo::Tids() const
47 {
48 return tids_;
49 }
Levels() const50 const std::deque<DataIndex>& LogInfo::Levels() const
51 {
52 return levels_;
53 }
Tags() const54 const std::deque<DataIndex>& LogInfo::Tags() const
55 {
56 return tags_;
57 }
Contexts() const58 const std::deque<DataIndex>& LogInfo::Contexts() const
59 {
60 return contexts_;
61 }
OriginTimeStamData() const62 const std::deque<uint64_t>& LogInfo::OriginTimeStamData() const
63 {
64 return originTs_;
65 }
66 } // namespace TraceStdtype
67 } // namespace SysTuning
68