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 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 "pbreader_file_header.h" 26 #include "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 PbreaderClockDetailParser : public EventParserBase { 33 public: 34 PbreaderClockDetailParser(TraceDataCache *dataCache, const TraceStreamerFilters *filters); 35 ~PbreaderClockDetailParser(); 36 #ifdef ENABLE_HTRACE 37 void Parse(const ProtoReader::BytesView &tracePacket) const; 38 #endif 39 void Parse(const ProfilerTraceFileHeader *profilerTraceFileHeader) const; 40 41 private: 42 std::map<MemInfoType, DataIndex> memNameDictMap_ = {}; 43 TraceStreamerConfig config_{}; 44 }; 45 } // namespace TraceStreamer 46 } // namespace SysTuning 47 48 #endif // HTRACE_CLOCKDETAIL_PARSER_H 49