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 SYSCALL_STDTYPE_H 17 #define SYSCALL_STDTYPE_H 18 #include "base_stdtype.h" 19 20 namespace SysTuning { 21 namespace TraceStdtype { 22 class SysCall : public CacheBase, public BatchCacheBase { 23 public: 24 size_t AppendSysCallData(int64_t sysCallNum, DataIndex type, uint32_t ipid, uint64_t timeStamp, int64_t ret); SysCallsData()25 const std::deque<int64_t> &SysCallsData() const 26 { 27 return sysCallNums_; 28 } TypesData()29 const std::deque<DataIndex> &TypesData() const 30 { 31 return types_; 32 } IpidsData()33 const std::deque<uint32_t> &IpidsData() const 34 { 35 return ipids_; 36 } RetsData()37 const std::deque<uint64_t> &RetsData() const 38 { 39 return rets_; 40 } Clear()41 void Clear() override 42 { 43 CacheBase::Clear(); 44 sysCallNums_.clear(); 45 types_.clear(); 46 ipids_.clear(); 47 rets_.clear(); 48 } ClearExportedData()49 void ClearExportedData() override 50 { 51 EraseElements(timeStamps_, sysCallNums_, types_, ipids_, rets_); 52 } 53 54 private: 55 std::deque<int64_t> sysCallNums_ = {}; 56 std::deque<DataIndex> types_ = {}; 57 std::deque<uint32_t> ipids_ = {}; 58 std::deque<uint64_t> rets_ = {}; 59 }; 60 } // namespace TraceStdtype 61 } // namespace SysTuning 62 #endif // SYSCALL_STDTYPE_H 63