• 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 #include "src/trace_processor/importers/proto/additional_modules.h"
18 #include "src/trace_processor/importers/ftrace/ftrace_module_impl.h"
19 #include "src/trace_processor/importers/proto/android_camera_event_module.h"
20 #include "src/trace_processor/importers/proto/android_probes_module.h"
21 #include "src/trace_processor/importers/proto/graphics_event_module.h"
22 #include "src/trace_processor/importers/proto/heap_graph_module.h"
23 #include "src/trace_processor/importers/proto/metadata_module.h"
24 #include "src/trace_processor/importers/proto/network_trace_module.h"
25 #include "src/trace_processor/importers/proto/statsd_module.h"
26 #include "src/trace_processor/importers/proto/system_probes_module.h"
27 #include "src/trace_processor/importers/proto/translation_table_module.h"
28 
29 namespace perfetto {
30 namespace trace_processor {
31 
RegisterAdditionalModules(TraceProcessorContext * context)32 void RegisterAdditionalModules(TraceProcessorContext* context) {
33   context->modules.emplace_back(new AndroidProbesModule(context));
34   context->modules.emplace_back(new NetworkTraceModule(context));
35   context->modules.emplace_back(new GraphicsEventModule(context));
36   context->modules.emplace_back(new HeapGraphModule(context));
37   context->modules.emplace_back(new SystemProbesModule(context));
38   context->modules.emplace_back(new TranslationTableModule(context));
39   context->modules.emplace_back(new StatsdModule(context));
40   context->modules.emplace_back(new AndroidCameraEventModule(context));
41   context->modules.emplace_back(new MetadataModule(context));
42 
43   // Ftrace module is special, because it has one extra method for parsing
44   // ftrace packets. So we need to store a pointer to it separately.
45   context->modules.emplace_back(new FtraceModuleImpl(context));
46   context->ftrace_module =
47       static_cast<FtraceModule*>(context->modules.back().get());
48 }
49 
50 }  // namespace trace_processor
51 }  // namespace perfetto
52