1 /* 2 * Copyright (C) 2024 The Android Open Source Project 3 * 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 SRC_TRACE_PROCESSOR_IMPORTERS_PERF_SPE_TOKENIZER_H_ 18 #define SRC_TRACE_PROCESSOR_IMPORTERS_PERF_SPE_TOKENIZER_H_ 19 20 #include <memory> 21 22 #include "perfetto/ext/base/status_or.h" 23 #include "src/trace_processor/importers/perf/aux_data_tokenizer.h" 24 #include "src/trace_processor/importers/perf/aux_stream_manager.h" 25 #include "src/trace_processor/importers/perf/auxtrace_info_record.h" 26 27 namespace perfetto ::trace_processor { 28 class TraceProcessorContext; 29 namespace perf_importer { 30 31 class SpeTokenizer : public AuxDataTokenizer { 32 public: Create(TraceProcessorContext * context,AuxtraceInfoRecord)33 static base::StatusOr<std::unique_ptr<AuxDataTokenizer>> Create( 34 TraceProcessorContext* context, 35 AuxtraceInfoRecord) { 36 return std::unique_ptr<AuxDataTokenizer>(new SpeTokenizer(context)); 37 } 38 ~SpeTokenizer() override; 39 base::StatusOr<AuxDataStream*> InitializeAuxDataStream( 40 AuxStream* stream) override; 41 42 private: SpeTokenizer(TraceProcessorContext * context)43 explicit SpeTokenizer(TraceProcessorContext* context) : context_(context) {} 44 TraceProcessorContext* const context_; 45 std::vector<std::unique_ptr<AuxDataStream>> streams_; 46 }; 47 48 } // namespace perf_importer 49 } // namespace perfetto::trace_processor 50 51 #endif // SRC_TRACE_PROCESSOR_IMPORTERS_PERF_SPE_TOKENIZER_H_ 52