blob: 48f41ef542e267301449751501d53f266d34d822 [file] [log] [blame]
Mikhail Khokhlov785af542019-12-06 13:45:10 +00001/*
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
20namespace perfetto {
21namespace trace_processor {
22
23NewProtoImporterModule::NewProtoImporterModule() {}
24
25NewProtoImporterModule::~NewProtoImporterModule() {}
26
27ModuleResult 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
36void NewProtoImporterModule::ParsePacket(
37 const protos::pbzero::TracePacket_Decoder&,
38 const TimestampedTracePiece&,
39 uint32_t /*field_id*/) {}
40
41void NewProtoImporterModule::ParseTraceConfig(
42 const protos::pbzero::TraceConfig_Decoder&) {}
43
44void 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