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 #ifndef FTRACE_CPU_DETAIL_PARSER_H 16 #define FTRACE_CPU_DETAIL_PARSER_H 17 #include <cstdint> 18 #include <limits> 19 #include <map> 20 #include <stdexcept> 21 #include <string> 22 #include "event_parser_base.h" 23 #include "htrace_event_parser.h" 24 #include "parser_base.h" 25 #include "proto_reader_help.h" 26 #include "trace_data_cache.h" 27 #include "trace_plugin_result.pbreader.h" 28 #include "trace_streamer_filters.h" 29 30 namespace SysTuning { 31 namespace TraceStreamer { 32 class HtraceCpuDetailParser { 33 public: 34 HtraceCpuDetailParser(TraceDataCache *dataCache, const TraceStreamerFilters *ctx); 35 ~HtraceCpuDetailParser(); 36 void Parse(PbreaderDataSegment &tracePacket, 37 ProtoReader::TracePluginResult_Reader &tracePluginResult, 38 bool &haveSplitSeg); 39 void FilterAllEventsReader(); 40 void FilterAllEvents(); 41 42 public: 43 std::unique_ptr<HtraceEventParser> eventParser_; 44 }; 45 } // namespace TraceStreamer 46 } // namespace SysTuning 47 48 #endif // FTRACE_CPU_DETAIL_PARSER_H 49