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_CLOCKDETAIL_PARSER_H 16 #define HTRACE_CLOCKDETAIL_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 "file.h" 24 #include "proto_reader_help.h" 25 #include "htrace_file_header.h" 26 #include "trace_data/trace_data_cache.h" 27 #include "trace_streamer_config.h" 28 #include "trace_streamer_filters.h" 29 30 namespace SysTuning { 31 namespace TraceStreamer { 32 class HtraceClockDetailParser : public EventParserBase { 33 public: 34 HtraceClockDetailParser(TraceDataCache* dataCache, const TraceStreamerFilters* filters); 35 ~HtraceClockDetailParser(); 36 void Parse(const ProtoReader::BytesView& tracePacket) const; 37 void Parse(const ProfilerTraceFileHeader* profilerTraceFileHeader) const; 38 39 private: 40 std::map<MemInfoType, DataIndex> memNameDictMap_ = {}; 41 TraceStreamerConfig config_{}; 42 }; 43 } // namespace TraceStreamer 44 } // namespace SysTuning 45 46 #endif // HTRACE_CLOCKDETAIL_PARSER_H 47