1 2 /* 3 * Copyright (c) 2021 Huawei Device Co., Ltd. 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 #ifndef HTRACE_HISYSEVENT_PARSER_H 18 #define HTRACE_HISYSEVENT_PARSER_H 19 20 #include "clock_filter_ex.h" 21 #include "event_parser_base.h" 22 #include "hi_sysevent_measure_filter.h" 23 #include "hisysevent_plugin_config.pbreader.h" 24 #include "hisysevent_plugin_result.pbreader.h" 25 #include "htrace_plugin_time_parser.h" 26 #include "trace_data/trace_data_cache.h" 27 #include "trace_streamer_filters.h" 28 #include "ts_common.h" 29 30 namespace SysTuning { 31 namespace TraceStreamer { 32 class HtraceHisyseventParser : public EventParserBase { 33 public: 34 HtraceHisyseventParser(TraceDataCache* dataCache, const TraceStreamerFilters* ctx); 35 ~HtraceHisyseventParser(); 36 void Finish(); 37 void Parse(ProtoReader::HisyseventInfo_Reader* tracePacket, uint64_t ts, bool& haveSplitSeg); 38 void Parse(ProtoReader::HisyseventConfig_Reader* tracePacket, uint64_t ts); 39 40 private: 41 const uint64_t MSEC_TO_NS = 1000 * 1000; 42 }; 43 } // namespace TraceStreamer 44 } // namespace SysTuning 45 #endif // HTRACE_HISYSEVENT_PARSER_H 46