1 /* 2 * Copyright (c) Huawei Technologies Co., Ltd. 2025. 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_FILTER_H 17 #define SYSCALL_FILTER_H 18 19 #include <unordered_map> 20 #include <unordered_set> 21 22 #include "clock_filter_ex.h" 23 #include "common_types.h" 24 #include "filter_base.h" 25 #include "trace_streamer_filters.h" 26 27 namespace SysTuning { 28 namespace TraceStreamer { 29 using namespace SysTuning::base; 30 class SyscallFilter : private FilterBase { 31 public: 32 SyscallFilter(TraceDataCache *dataCache, const TraceStreamerFilters *filter); 33 ~SyscallFilter() override; 34 void UpdataSyscallEnterExitMap(const SyscallInfoRow &syscallInfoRow); 35 void AppendSysCallInfo(uint32_t pid, uint32_t syscallNr, uint64_t ts, int64_t ret); 36 void Clear(); 37 38 private: 39 std::map<uint32_t /*itid*/, SyscallInfoRow> syscallEnterExitMap_; 40 }; 41 } // namespace TraceStreamer 42 } // namespace SysTuning 43 #endif // SYSCALL_FILTER_H 44