• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 #ifndef SRC_TRACE_PROCESSOR_IMPORTERS_PROTO_ANDROID_PROBES_PARSER_H_
18 #define SRC_TRACE_PROCESSOR_IMPORTERS_PROTO_ANDROID_PROBES_PARSER_H_
19 
20 #include <cstdint>
21 
22 #include "perfetto/protozero/field.h"
23 #include "src/trace_processor/storage/trace_storage.h"
24 
25 namespace perfetto::trace_processor {
26 
27 class TraceProcessorContext;
28 
29 class AndroidProbesParser {
30  public:
31   using ConstBytes = protozero::ConstBytes;
32 
33   explicit AndroidProbesParser(TraceProcessorContext*);
34 
35   void ParseBatteryCounters(int64_t ts, ConstBytes);
36   void ParsePowerRails(int64_t ts, uint64_t trace_packet_ts, ConstBytes);
37   void ParseEnergyBreakdown(int64_t ts, ConstBytes);
38   void ParseEntityStateResidency(int64_t ts, ConstBytes);
39   void ParseAndroidLogPacket(ConstBytes);
40   void ParseAndroidLogEvent(ConstBytes);
41   void ParseAndroidLogStats(ConstBytes);
42   void ParseStatsdMetadata(ConstBytes);
43   void ParseInitialDisplayState(int64_t ts, ConstBytes);
44   void ParseAndroidSystemProperty(int64_t ts, ConstBytes);
45   void ParseAndroidGameIntervention(ConstBytes);
46   void ParseBtTraceEvent(int64_t ts, ConstBytes);
47 
48  private:
49   TraceProcessorContext* const context_;
50 
51   const StringId battery_status_id_;
52   const StringId plug_type_id_;
53   const StringId rail_packet_timestamp_id_;
54   const StringId energy_consumer_id_;
55   const StringId consumer_type_id_;
56   const StringId ordinal_id_;
57   const StringId bt_trace_event_id_;
58   const StringId bt_packet_type_id_;
59   const StringId bt_count_id_;
60   const StringId bt_length_id_;
61   const StringId bt_op_code_id_;
62   const StringId bt_event_code_id_;
63   const StringId bt_subevent_code_id_;
64   const StringId bt_handle_id_;
65 };
66 }  // namespace perfetto::trace_processor
67 
68 #endif  // SRC_TRACE_PROCESSOR_IMPORTERS_PROTO_ANDROID_PROBES_PARSER_H_
69