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 #ifndef HTRACE_CPU_DETAIL_PARSER_H 16 #define HTRACE_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 "log.h" 25 #include "parser_base.h" 26 #include "proto_reader_help.h" 27 #include "trace_data/trace_data_cache.h" 28 #include "trace_plugin_result.pbreader.h" 29 #include "trace_streamer_filters.h" 30 31 namespace SysTuning { 32 namespace TraceStreamer { 33 class HtraceCpuDetailParser { 34 public: 35 HtraceCpuDetailParser(TraceDataCache* dataCache, const TraceStreamerFilters* ctx); 36 ~HtraceCpuDetailParser(); 37 void Parse(HtraceDataSegment& tracePacket, 38 ProtoReader::TracePluginResult_Reader& tracePluginResult, 39 bool& haveSplitSeg); 40 void FilterAllEventsReader(); 41 void FilterAllEvents(); 42 43 private: 44 std::unique_ptr<HtraceEventParser> eventParser_; 45 }; 46 } // namespace TraceStreamer 47 } // namespace SysTuning 48 49 #endif // HTRACE_CPU_DETAIL_PARSER_H_ 50