aboutsummaryrefslogtreecommitdiff
path: root/test/trace_processor/diff_tests/include_index.py
blob: 36872ed6f67391b41f634df7a48521d291c8a438 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
#!/usr/bin/env python3
# Copyright (C) 2023 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License a
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import os
import sys
from typing import List

from python.generators.diff_tests import testing

# A hack to import using `diff_tests.` which prevents the risk name conflicts,
# i.e importing a module when user has a different package of the same name
# installed.
TRACE_PROCESSOR_TEST_DIR = os.path.dirname(
    os.path.dirname(os.path.abspath(__file__)))
sys.path.append(TRACE_PROCESSOR_TEST_DIR)

from diff_tests.metrics.android.tests import AndroidMetrics
from diff_tests.metrics.camera.tests import Camera
from diff_tests.metrics.chrome.tests import ChromeMetrics
from diff_tests.metrics.chrome.tests_args import ChromeArgs
from diff_tests.metrics.chrome.tests_processes import ChromeProcesses
from diff_tests.metrics.chrome.tests_rail_modes import ChromeRailModes
from diff_tests.metrics.chrome.tests_scroll_jank import ChromeScrollJankMetrics
from diff_tests.metrics.chrome.tests_touch_gesture import ChromeTouchGesture
from diff_tests.metrics.codecs.tests import Codecs
from diff_tests.metrics.frame_timeline.tests import FrameTimeline
from diff_tests.metrics.graphics.tests import GraphicsMetrics
from diff_tests.metrics.irq.tests import IRQ
from diff_tests.metrics.memory.tests import MemoryMetrics
from diff_tests.metrics.network.tests import NetworkMetrics
from diff_tests.metrics.power.tests import Power
from diff_tests.metrics.profiling.tests import ProfilingMetrics
from diff_tests.metrics.startup.tests import Startup
from diff_tests.metrics.startup.tests_broadcasts import StartupBroadcasts
from diff_tests.metrics.startup.tests_lock_contention import StartupLockContention
from diff_tests.metrics.startup.tests_metrics import StartupMetrics
from diff_tests.metrics.webview.tests import WebView
from diff_tests.parser.android_fs.tests import AndroidFs
from diff_tests.parser.android.tests import AndroidParser
from diff_tests.parser.android.tests_bugreport import AndroidBugreport
from diff_tests.parser.android.tests_games import AndroidGames
from diff_tests.parser.android.tests_protolog import ProtoLog
from diff_tests.parser.android.tests_shell_transitions import ShellTransitions
from diff_tests.parser.android.tests_surfaceflinger_layers import SurfaceFlingerLayers
from diff_tests.parser.android.tests_surfaceflinger_transactions import SurfaceFlingerTransactions
from diff_tests.parser.atrace.tests import Atrace
from diff_tests.parser.atrace.tests_error_handling import AtraceErrorHandling
from diff_tests.parser.chrome.tests import ChromeParser
from diff_tests.parser.chrome.tests_memory_snapshots import ChromeMemorySnapshots
from diff_tests.parser.chrome.tests_v8 import ChromeV8Parser
from diff_tests.parser.cros.tests import Cros
from diff_tests.parser.fs.tests import Fs
from diff_tests.parser.ftrace.ftrace_crop_tests import FtraceCrop
from diff_tests.parser.fuchsia.tests import Fuchsia
from diff_tests.parser.graphics.tests import GraphicsParser
from diff_tests.parser.graphics.tests_drm_related_ftrace_events import GraphicsDrmRelatedFtraceEvents
from diff_tests.parser.graphics.tests_gpu_trace import GraphicsGpuTrace
from diff_tests.parser.json.tests import JsonTests
from diff_tests.parser.memory.tests import MemoryParser
from diff_tests.parser.network.tests import NetworkParser
from diff_tests.parser.parsing.tests import Parsing
from diff_tests.parser.parsing.tests_debug_annotation import ParsingDebugAnnotation
from diff_tests.parser.parsing.tests_memory_counters import ParsingMemoryCounters
from diff_tests.parser.parsing.tests_rss_stats import ParsingRssStats
from diff_tests.parser.power.tests_energy_breakdown import PowerEnergyBreakdown
from diff_tests.parser.power.tests_entity_state_residency import EntityStateResidency
from diff_tests.parser.power.tests_linux_sysfs_power import LinuxSysfsPower
from diff_tests.parser.power.tests_power_rails import PowerPowerRails
from diff_tests.parser.power.tests_voltage_and_scaling import PowerVoltageAndScaling
from diff_tests.parser.process_tracking.tests import ProcessTracking
from diff_tests.parser.profiling.tests import Profiling
from diff_tests.parser.profiling.tests_heap_graph import ProfilingHeapGraph
from diff_tests.parser.profiling.tests_heap_profiling import ProfilingHeapProfiling
from diff_tests.parser.profiling.tests_llvm_symbolizer import ProfilingLlvmSymbolizer
from diff_tests.parser.sched.tests import SchedParser
from diff_tests.parser.smoke.tests import Smoke
from diff_tests.parser.smoke.tests_compute_metrics import SmokeComputeMetrics
from diff_tests.parser.smoke.tests_json import SmokeJson
from diff_tests.parser.smoke.tests_sched_events import SmokeSchedEvents
from diff_tests.parser.track_event.tests import TrackEvent
from diff_tests.parser.translated_args.tests import TranslatedArgs
from diff_tests.parser.ufs.tests import Ufs
from diff_tests.stdlib.android.tests import AndroidStdlib
from diff_tests.stdlib.android.frames_tests import Frames
from diff_tests.stdlib.chrome.chrome_stdlib_testsuites import CHROME_STDLIB_TESTSUITES
from diff_tests.stdlib.common.tests import StdlibCommon
from diff_tests.stdlib.common.tests import StdlibCommon
from diff_tests.stdlib.counters.tests import StdlibCounterIntervals
from diff_tests.stdlib.dynamic_tables.tests import DynamicTables
from diff_tests.stdlib.graphs.dominator_tree_tests import DominatorTree
from diff_tests.stdlib.graphs.search_tests import GraphSearchTests
from diff_tests.stdlib.intervals.intersect_tests import IntervalsIntersect
from diff_tests.stdlib.intervals.tests import StdlibIntervals
from diff_tests.stdlib.linux.tests import LinuxStdlib
from diff_tests.stdlib.memory.heap_graph_dominator_tree_tests import HeapGraphDominatorTree
from diff_tests.stdlib.pkvm.tests import Pkvm
from diff_tests.stdlib.prelude.math_functions_tests import PreludeMathFunctions
from diff_tests.stdlib.prelude.pprof_functions_tests import PreludePprofFunctions
from diff_tests.stdlib.prelude.slices_tests import PreludeSlices
from diff_tests.stdlib.prelude.window_functions_tests import PreludeWindowFunctions
from diff_tests.stdlib.sched.tests import StdlibSched
from diff_tests.stdlib.slices.tests import Slices
from diff_tests.stdlib.span_join.tests_left_join import SpanJoinLeftJoin
from diff_tests.stdlib.span_join.tests_outer_join import SpanJoinOuterJoin
from diff_tests.stdlib.span_join.tests_regression import SpanJoinRegression
from diff_tests.stdlib.span_join.tests_smoke import SpanJoinSmoke
from diff_tests.stdlib.tests import StdlibSmoke
from diff_tests.stdlib.timestamps.tests import Timestamps
from diff_tests.syntax.filtering_tests import PerfettoFiltering
from diff_tests.syntax.function_tests import PerfettoFunction
from diff_tests.syntax.include_tests import PerfettoInclude
from diff_tests.syntax.macro_tests import PerfettoMacro
from diff_tests.syntax.table_function_tests import PerfettoTableFunction
from diff_tests.syntax.table_tests import PerfettoTable
from diff_tests.syntax.view_tests import PerfettoView
from diff_tests.tables.tests import Tables
from diff_tests.tables.tests_counters import TablesCounters
from diff_tests.tables.tests_sched import TablesSched

sys.path.pop()

def fetch_all_diff_tests(index_path: str) -> List['testing.TestCase']:
  parser_tests = [
      *AndroidBugreport(index_path, 'parser/android',
                        'AndroidBugreport').fetch(),
      *AndroidFs(index_path, 'parser/android_fs', 'AndroidFs').fetch(),
      *AndroidGames(index_path, 'parser/android', 'AndroidGames').fetch(),
      *AndroidParser(index_path, 'parser/android', 'AndroidParser').fetch(),
      *Atrace(index_path, 'parser/atrace', 'Atrace').fetch(),
      *AtraceErrorHandling(index_path, 'parser/atrace',
                           'AtraceErrorHandling').fetch(),
      *ChromeMemorySnapshots(index_path, 'parser/chrome',
                             'ChromeMemorySnapshots').fetch(),
      *ChromeParser(index_path, 'parser/chrome', 'ChromeParser').fetch(),
      *ChromeV8Parser(index_path, 'parser/chrome', 'ChromeV8Parser').fetch(),
      *Cros(index_path, 'parser/cros', 'Cros').fetch(),
      *Fs(index_path, 'parser/fs', 'Fs').fetch(),
      *Fuchsia(index_path, 'parser/fuchsia', 'Fuchsia').fetch(),
      *GraphicsDrmRelatedFtraceEvents(index_path, 'parser/graphics',
                                      'GraphicsDrmRelatedFtraceEvents').fetch(),
      *GraphicsGpuTrace(index_path, 'parser/graphics',
                        'GraphicsGpuTrace').fetch(),
      *GraphicsParser(index_path, 'parser/graphics', 'GraphicsParser').fetch(),
      *JsonTests(index_path, 'parser/json', 'JsonParser').fetch(),
      *MemoryParser(index_path, 'parser/memory', 'MemoryParser').fetch(),
      *NetworkParser(index_path, 'parser/network', 'NetworkParser').fetch(),
      *PowerEnergyBreakdown(index_path, 'parser/power',
                            'PowerEnergyBreakdown').fetch(),
      *PowerPowerRails(index_path, 'parser/power', 'PowerPowerRails').fetch(),
      *PowerVoltageAndScaling(index_path, 'parser/power',
                              'PowerVoltageAndScaling').fetch(),
      *EntityStateResidency(index_path, 'parser/power',
                            'EntityStateResidency').fetch(),
      *LinuxSysfsPower(index_path, 'parser/power', 'LinuxSysfsPower').fetch(),
      *ProcessTracking(index_path, 'parser/process_tracking',
                       'ProcessTracking').fetch(),
      *Profiling(index_path, 'parser/profiling', 'Profiling').fetch(),
      *ProfilingHeapGraph(index_path, 'parser/profiling',
                          'ProfilingHeapGraph').fetch(),
      *ProfilingHeapProfiling(index_path, 'parser/profiling',
                              'ProfilingHeapProfiling').fetch(),
      *ProfilingLlvmSymbolizer(index_path, 'parser/profiling',
                               'ProfilingLlvmSymbolizer').fetch(),
      *SchedParser(index_path, 'parser/sched', 'SchedParser').fetch(),
      *StdlibSched(index_path, 'stdlib/sched', 'StdlibSched').fetch(),
      *Smoke(index_path, 'parser/smoke', 'Smoke').fetch(),
      *SmokeComputeMetrics(index_path, 'parser/smoke',
                           'SmokeComputeMetrics').fetch(),
      *SmokeJson(index_path, 'parser/smoke', 'SmokeJson').fetch(),
      *SmokeSchedEvents(index_path, 'parser/smoke', 'SmokeSchedEvents').fetch(),
      *SurfaceFlingerLayers(index_path, 'parser/android',
                            'SurfaceFlingerLayers').fetch(),
      *SurfaceFlingerTransactions(index_path, 'parser/android',
                                  'SurfaceFlingerTransactions').fetch(),
      *ShellTransitions(index_path, 'parser/android',
                        'ShellTransitions').fetch(),
      *ProtoLog(index_path, 'parser/android', 'ProtoLog').fetch(),
      *TrackEvent(index_path, 'parser/track_event', 'TrackEvent').fetch(),
      *TranslatedArgs(index_path, 'parser/translated_args',
                      'TranslatedArgs').fetch(),
      *Ufs(index_path, 'parser/ufs', 'Ufs').fetch(),
      # TODO(altimin, lalitm): "parsing" should be split into more specific
      # directories.
      *Parsing(index_path, 'parser/parsing', 'Parsing').fetch(),
      *ParsingDebugAnnotation(index_path, 'parser/parsing',
                              'ParsingDebugAnnotation').fetch(),
      *ParsingRssStats(index_path, 'parser/parsing', 'ParsingRssStats').fetch(),
      *ParsingMemoryCounters(index_path, 'parser/parsing',
                             'ParsingMemoryCounters').fetch(),
      *FtraceCrop(index_path, 'parser/ftrace', 'FtraceCrop').fetch(),
  ]

  metrics_tests = [
      *AndroidMetrics(index_path, 'metrics/android', 'AndroidMetrics').fetch(),
      *Camera(index_path, 'metrics/camera', 'Camera').fetch(),
      *ChromeArgs(index_path, 'metrics/chrome', 'ChromeArgs').fetch(),
      *ChromeMetrics(index_path, 'metrics/chrome', 'ChromeMetrics').fetch(),
      *ChromeProcesses(index_path, 'metrics/chrome', 'ChromeProcesses').fetch(),
      *ChromeRailModes(index_path, 'metrics/chrome', 'ChromeRailModes').fetch(),
      *ChromeScrollJankMetrics(index_path, 'metrics/chrome',
                               'ChromeScrollJankMetrics').fetch(),
      *ChromeTouchGesture(index_path, 'metrics/chrome',
                          'ChromeTouchGesture').fetch(),
      *Codecs(index_path, 'metrics/codecs', 'Codecs').fetch(),
      *FrameTimeline(index_path, 'metrics/frame_timeline',
                     'FrameTimeline').fetch(),
      *GraphicsMetrics(index_path, 'metrics/graphics',
                       'GraphicsMetrics').fetch(),
      *IRQ(index_path, 'metrics/irq', 'IRQ').fetch(),
      *MemoryMetrics(index_path, 'metrics/memory', 'MemoryMetrics').fetch(),
      *NetworkMetrics(index_path, 'metrics/network', 'orkMetrics').fetch(),
      *Power(index_path, 'metrics/power', 'Power').fetch(),
      *ProfilingMetrics(index_path, 'metrics/profiling',
                        'ProfilingMetrics').fetch(),
      *Startup(index_path, 'metrics/startup', 'Startup').fetch(),
      *StartupBroadcasts(index_path, 'metrics/startup',
                         'StartupBroadcasts').fetch(),
      *StartupLockContention(index_path, 'metrics/startup',
                             'StartupLockContention').fetch(),
      *StartupMetrics(index_path, 'metrics/startup', 'StartupMetrics').fetch(),
      *WebView(index_path, 'metrics/webview', 'WebView').fetch(),
  ]

  chrome_test_dir = os.path.abspath(
      os.path.join(__file__, '../../../data/chrome'))
  chrome_stdlib_tests = []
  for test_suite_cls in CHROME_STDLIB_TESTSUITES:
    test_suite = test_suite_cls(index_path, 'stdlib/chrome',
                                test_suite_cls.__name__, chrome_test_dir)
    chrome_stdlib_tests += test_suite.fetch()

  stdlib_tests = [
      *AndroidStdlib(index_path, 'stdlib/android', 'AndroidStdlib').fetch(),
      *DominatorTree(index_path, 'stdlib/graphs', 'DominatorTree').fetch(),
      *Frames(index_path, 'stdlib/android', 'Frames').fetch(),
      *GraphSearchTests(index_path, 'stdlib/graphs',
                        'GraphSearchTests').fetch(),
      *StdlibCounterIntervals(index_path, 'stdlib/counters',
                              'StdlibCounterIntervals').fetch(),
      *DynamicTables(index_path, 'stdlib/dynamic_tables',
                     'DynamicTables').fetch(),
      *LinuxStdlib(index_path, 'stdlib/linux', 'LinuxStdlib').fetch(),
      *PreludeMathFunctions(index_path, 'stdlib/prelude',
                            'PreludeMathFunctions').fetch(),
      *HeapGraphDominatorTree(index_path, 'stdlib/memory',
                              'HeapGraphDominatorTree').fetch(),
      *PreludePprofFunctions(index_path, 'stdlib/prelude',
                             'PreludePprofFunctions').fetch(),
      *PreludeWindowFunctions(index_path, 'stdlib/prelude',
                              'PreludeWindowFunctions').fetch(),
      *Pkvm(index_path, 'stdlib/pkvm', 'Pkvm').fetch(),
      *PreludeSlices(index_path, 'stdlib/prelude', 'PreludeSlices').fetch(),
      *StdlibSmoke(index_path, 'stdlib', 'StdlibSmoke').fetch(),
      *StdlibCommon(index_path, 'stdlib/common', 'StdlibCommon').fetch(),
      *Slices(index_path, 'stdlib/slices', 'Slices').fetch(),
      *SpanJoinLeftJoin(index_path, 'stdlib/span_join',
                        'SpanJoinLeftJoin').fetch(),
      *SpanJoinOuterJoin(index_path, 'stdlib/span_join',
                         'SpanJoinOuterJoin').fetch(),
      *SpanJoinRegression(index_path, 'stdlib/span_join',
                          'SpanJoinRegression').fetch(),
      *SpanJoinSmoke(index_path, 'stdlib/span_join', 'SpanJoinSmoke').fetch(),
      *StdlibCommon(index_path, 'stdlib/common', 'StdlibCommon').fetch(),
      *StdlibIntervals(index_path, 'stdlib/intervals',
                       'StdlibIntervalsIntersect').fetch(),
      *IntervalsIntersect(index_path, 'stdlib/intervals',
                          'StdlibIntervals').fetch(),
      *Timestamps(index_path, 'stdlib/timestamps', 'Timestamps').fetch(),
  ] + chrome_stdlib_tests

  syntax_tests = [
      *PerfettoFiltering(index_path, 'syntax', 'PerfettoFiltering').fetch(),
      *PerfettoFunction(index_path, 'syntax', 'PerfettoFunction').fetch(),
      *PerfettoInclude(index_path, 'syntax', 'PerfettoInclude').fetch(),
      *PerfettoMacro(index_path, 'syntax', 'PerfettoMacro').fetch(),
      *PerfettoTable(index_path, 'syntax', 'PerfettoTable').fetch(),
      *PerfettoTableFunction(index_path, 'syntax',
                             'PerfettoTableFunction').fetch(),
      *PerfettoView(index_path, 'syntax', 'PerfettoView').fetch(),
  ]

  return parser_tests + metrics_tests + stdlib_tests + syntax_tests + [
      *Tables(index_path, 'tables', 'Tables').fetch(),
      *TablesCounters(index_path, 'tables', 'TablesCounters').fetch(),
      *TablesSched(index_path, 'tables', 'TablesSched').fetch(),
  ]