blob: de31d47b232d0516031b00d2fe4fa73759b8af64 [file] [log] [blame]
Eric Secklerde589952019-10-17 12:46:07 +01001/*
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#ifndef SRC_TRACE_PROCESSOR_IMPORTERS_PROTO_TRACK_EVENT_MODULE_H_
18#define SRC_TRACE_PROCESSOR_IMPORTERS_PROTO_TRACK_EVENT_MODULE_H_
19
Eric Secklerde589952019-10-17 12:46:07 +010020#include "src/trace_processor/importers/proto/proto_importer_module.h"
Eric Seckler771960c2019-10-22 15:37:12 +010021#include "src/trace_processor/importers/proto/track_event_parser.h"
22#include "src/trace_processor/importers/proto/track_event_tokenizer.h"
Eric Secklerde589952019-10-17 12:46:07 +010023
Eric Secklerd2af9892019-11-01 10:10:53 +000024#include "protos/perfetto/trace/trace_packet.pbzero.h"
25
Eric Secklerde589952019-10-17 12:46:07 +010026namespace perfetto {
27namespace trace_processor {
28
Mikhail Khokhlov43e5dce2019-12-10 10:10:39 +000029class TrackEventModule : public ProtoImporterModule {
Eric Secklerde589952019-10-17 12:46:07 +010030 public:
Mikhail Khokhlov4b5de1a2019-12-06 16:33:56 +000031 explicit TrackEventModule(TraceProcessorContext* context);
32
33 ~TrackEventModule() override;
Eric Secklerde589952019-10-17 12:46:07 +010034
Eric Seckler771960c2019-10-22 15:37:12 +010035 ModuleResult TokenizePacket(
36 const protos::pbzero::TracePacket::Decoder& decoder,
37 TraceBlobView* packet,
38 int64_t packet_timestamp,
Mikhail Khokhlov4b5de1a2019-12-06 16:33:56 +000039 PacketSequenceState* state,
40 uint32_t field_id) override;
Eric Seckler771960c2019-10-22 15:37:12 +010041
Mikhail Khokhlov4b5de1a2019-12-06 16:33:56 +000042 void ParsePacket(const protos::pbzero::TracePacket::Decoder& decoder,
43 const TimestampedTracePiece& ttp,
44 uint32_t field_id) override;
Eric Seckler771960c2019-10-22 15:37:12 +010045
46 private:
47 TrackEventTokenizer tokenizer_;
48 TrackEventParser parser_;
Eric Secklerde589952019-10-17 12:46:07 +010049};
50
51} // namespace trace_processor
52} // namespace perfetto
53
54#endif // SRC_TRACE_PROCESSOR_IMPORTERS_PROTO_TRACK_EVENT_MODULE_H_