Mikhail Khokhlov | 785af54 | 2019-12-06 13:45:10 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2019 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 | #include "src/trace_processor/importers/proto/proto_importer_module.h" |
| 18 | #include "src/trace_processor/trace_processor_context.h" |
| 19 | |
| 20 | namespace perfetto { |
| 21 | namespace trace_processor { |
| 22 | |
| 23 | NewProtoImporterModule::NewProtoImporterModule() {} |
| 24 | |
| 25 | NewProtoImporterModule::~NewProtoImporterModule() {} |
| 26 | |
| 27 | ModuleResult NewProtoImporterModule::TokenizePacket( |
| 28 | const protos::pbzero::TracePacket_Decoder&, |
| 29 | TraceBlobView* /*packet*/, |
| 30 | int64_t /*packet_timestamp*/, |
| 31 | PacketSequenceState*, |
| 32 | uint32_t /*field_id*/) { |
| 33 | return ModuleResult::Ignored(); |
| 34 | } |
| 35 | |
| 36 | void NewProtoImporterModule::ParsePacket( |
| 37 | const protos::pbzero::TracePacket_Decoder&, |
| 38 | const TimestampedTracePiece&, |
| 39 | uint32_t /*field_id*/) {} |
| 40 | |
| 41 | void NewProtoImporterModule::ParseTraceConfig( |
| 42 | const protos::pbzero::TraceConfig_Decoder&) {} |
| 43 | |
| 44 | void NewProtoImporterModule::RegisterForField(uint32_t field_id, |
| 45 | TraceProcessorContext* context) { |
| 46 | if (context->modules_by_field.size() <= field_id) { |
| 47 | context->modules_by_field.resize(field_id + 1, nullptr); |
| 48 | } |
| 49 | PERFETTO_DCHECK(!context->modules_by_field[field_id]); |
| 50 | context->modules_by_field[field_id] = this; |
| 51 | } |
| 52 | |
| 53 | } // namespace trace_processor |
| 54 | } // namespace perfetto |