dart-sdk/pkg/front_end/test
Jens Johansen 1574e860c8 [CFE] Add instrumenter that can produce flame graph output
Could for instance be run like this:

out/ReleaseX64/dart pkg/front_end/tool/flame/instrumenter.dart pkg/front_end/tool/_fasta/compile.dart
out/ReleaseX64/dart pkg/front_end/tool/_fasta/compile.dart.dill.instrumented.dill --omit-platform pkg/front_end/tool/_fasta/compile.dart
out/ReleaseX64/dart pkg/front_end/tool/flame/instrumenter.dart pkg/front_end/tool/_fasta/compile.dart --candidates=cfe_compile_trace_candidates.txt
out/ReleaseX64/dart pkg/front_end/tool/_fasta/compile.dart.dill.instrumented.dill --omit-platform pkg/front_end/tool/_fasta/compile.dart
out/ReleaseX64/dart pkg/front_end/tool/flame/instrumenter.dart pkg/front_end/tool/_fasta/compile.dart --candidates=cfe_compile_trace_candidates_subsequent.txt
out/ReleaseX64/dart pkg/front_end/tool/_fasta/compile.dart.dill.instrumented.dill --omit-platform pkg/front_end/tool/_fasta/compile.dart

 * The first command compiles and instruments "compile.dart" to record
   all procedure calls.
 * The second command runs the instrumented compiler on "compile.dart"
   (but it could have compiled anything). Because every procedure is
   instrumented this will take a lot longer than a usual run.
   This produces a trace "cfe_compile_trace.txt" with every call taking
   at least 1000 microseconds. This can be displayed via Chromes
   about://tracing tool.
   It also produces a file "cfe_compile_trace_candidates.txt" with a map
   of the procedures that on average took at least 500 microseconds.
 * The third command compiles and instruments "compile.dart", this time
   only instrumenting the procedures mentioned in the map
   "cfe_compile_trace_candidates.txt".
 * The forth command runs the instrumented compiler on "compile.dart".
   This run shouldn't take significantly longer than a non-instrumented
   run. It produces a new "cfe_compile_trace.txt" which this time is
   not filtered. It also produces a file
   "cfe_compile_trace_candidates_subsequent.txt" of recorded procedures
   that on average took at least 50 microseconds.
 * The fifth and sixth commands repeats the third and forth but
   instrumenting only the procedures mention in
   "cfe_compile_trace_candidates_subsequent.txt".

The third iteration might not be needed, but if the first run was on a
smaller input (which it isn't in this example) there might be some calls
that on average took long enough to be included in the candidate list
because the first call was slow and there were only very few of them,
making the second trace very big because there are now a lot of - as it
turns out - very quick calls recorded. Adding the third iteration will
filter (at least some of) those out.

Change-Id: I702c5c9142e525502b02f37744fcdc9d2b0f9b20
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/296902
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2023-04-25 08:34:01 +00:00
..
analyser_ignored [cfe] Remove language version from test data 2022-07-08 09:25:29 +00:00
class_hierarchy [cfe] Compute noSuchMethod forwarders in members builder 2022-12-14 09:25:57 +00:00
covariance_check [cfe] Remove language version from test data 2022-07-08 09:25:29 +00:00
enable_non_nullable Replace Uri.scheme == with Uri.isScheme 2022-02-08 21:38:57 +00:00
extensions [cfe] Don't include dart: extensions in test data 2023-04-05 12:36:29 +00:00
fasta [cfe] Add expectation test for file offsets 2023-03-30 13:19:58 +00:00
id_testing [cfe] Remove language version from test data 2022-07-08 09:25:29 +00:00
id_tests [_fe_analyzer_shared] Rename fields to properties 2023-04-03 12:16:43 +00:00
language_versioning [CFE] Remove support for .packages file 2022-06-24 08:20:39 +00:00
macros Add support for mixin declarations in the macro APIs 2023-04-18 16:04:00 +00:00
parts Read package_config.json in more tests 2022-05-11 18:58:44 +00:00
patching [cfe,vm,wasm] Handle private injected members like augmentations 2022-10-04 14:43:43 +00:00
predicates [cfe] Improve switch encoding 2023-03-20 15:21:52 +00:00
src/base [CFE] Remove support for .packages file 2022-06-24 08:20:39 +00:00
static_types [_fe_analyzer_shared] Support switch expressions and errors in exhautiveness id testing 2023-02-16 11:53:16 +00:00
text_representation [cfe] Report mismatching joint variables on the first use 2023-04-04 11:56:48 +00:00
tool [cfe] Make hot-reload VM client a bit more re-usable 2023-01-16 09:19:43 +00:00
utils [cfe] Add expectation test for file offsets 2023-03-30 13:19:58 +00:00
ast_nodes_has_to_string_test.dart Replace Uri.scheme == with Uri.isScheme 2022-02-08 21:38:57 +00:00
async_but_no_await_git_test.dart [CFE] Remove many uses of .packages files in tests 2022-06-22 07:34:49 +00:00
binary_md_dill_reader.dart [kernel] Shift up specialized kernel tags 2023-02-21 15:21:38 +00:00
binary_md_vm_tags_and_version_git_test.dart [kernel] Shift up specialized kernel tags 2023-02-21 15:21:38 +00:00
comments_on_certain_arguments_tool.dart [parser] Add comments to calls 2022-10-14 09:48:38 +00:00
compile_benchmark.dart Change : to = for default values in pkg. 2022-08-24 15:57:16 +00:00
compile_benchmark_helper.dart [CFE] Enable avoid_void_async lint 2021-09-23 11:58:18 +00:00
compile_dart2js_with_no_sdk_test.dart [CFE] Enable avoid_void_async lint 2021-09-23 11:58:18 +00:00
compile_with_no_sdk_test.dart [CFE] Enable avoid_void_async lint 2021-09-23 11:58:18 +00:00
constant_evaluator_benchmark.dart [cfe] Integrate exhaustiveness checking into constant evaluator 2023-03-13 21:23:21 +00:00
crashing_test_case_minimizer.dart [cfe] Use common target names in incremental suite 2022-08-05 12:32:57 +00:00
crashing_test_case_minimizer_impl.dart [CFE] Some fixes to crash minimizer 2023-04-12 08:24:27 +00:00
dartdoc_test_test.dart [cfe] Migrate (more) CFE tests 2021-11-16 10:00:14 +00:00
dartdoctest_suite.dart [cfe] Migrate (more) CFE tests 2021-11-16 10:00:14 +00:00
dartdoctest_suite.status [CFE] First pass at internal test utility 2021-06-22 08:12:58 +00:00
deps_git_test.dart move the third_party/pkg_tested packages into third_party/pkg 2022-06-13 17:04:36 +00:00
desugar_test.dart [dart2js] Cleanup some TODOs in dart2js' frontend api. 2022-02-15 17:41:39 +00:00
dijkstras_sssp_algorithm.dart [cfe] Migrate (more) CFE tests 2021-11-16 10:00:14 +00:00
dill_round_trip_test.dart [cfe] Migrate (more) CFE tests 2021-11-16 10:00:14 +00:00
explicit_creation_git_test.dart [cfe] Support inline class constructor bodies 2022-12-29 15:10:43 +00:00
expression_compilation_tools_test.dart [VM] [CFE]: Make VM send over type information for expression compilation 2022-01-28 07:49:21 +00:00
ffi_test.dart [misc] Cleanup stale todos 2022-06-28 16:02:53 +00:00
flutter_gallery_leak_tester.dart Retire experiment flags introduced in 2.18. 2022-12-15 13:18:50 +00:00
generated_files_up_to_date_git_test.dart [cfe,analyzer] Share experimental flags for the parser 2022-11-17 11:32:01 +00:00
hot_reload_e2e_test.dart [CFE] Remove support for .packages file 2022-06-24 08:20:39 +00:00
incremental_bulk_compiler_full.dart [vm, cfe] Add an option to include extra source files into kernel compilation 2022-02-04 15:23:39 +00:00
incremental_bulk_compiler_smoke_suite.dart [cfe] Migrate (more) CFE tests (part 2) 2021-11-16 10:15:11 +00:00
incremental_compiler_leak_test.dart [CFE] Restrict incremental_compiler_leak_test further 2022-06-27 14:10:31 +00:00
incremental_dart2js_load_from_dill_test.dart [cfe] Handle field/getter/setter in ReferenceName equality 2021-11-30 12:37:55 +00:00
incremental_dart2js_test.dart [cfe] Migrate (more) CFE tests (part 2) 2021-11-16 10:15:11 +00:00
incremental_dart2js_tester.dart [CFE] Don't omit platform in incremental dart2js tester to avoid false positives on leak test 2022-11-18 10:21:58 +00:00
incremental_flutter_tester.dart Change : to = for default values in pkg. 2022-08-24 15:57:16 +00:00
incremental_load_from_invalid_dill_test.dart [cfe] Extract _ComponentProblems and InitializationStrategy from IncrementalCompiler 2021-12-02 15:58:47 +00:00
incremental_suite.dart [cfe] tests to handle Windows EOL 2023-01-18 22:12:27 +00:00
incremental_utils.dart Remove superfluous words. 2023-01-30 15:58:38 +00:00
issue_34856_test.dart [cfe] Migrate (more) CFE tests (part 3) 2021-11-16 10:37:22 +00:00
kernel_generator_test.dart [cfe] Migrate (more) CFE tests (part 3) 2021-11-16 10:37:22 +00:00
lint_suite.dart [CFE] Remove many uses of .packages files in tests 2022-06-22 07:34:49 +00:00
lint_test.status [dart2js] Static weak references to method tearoffs 2023-03-02 20:04:19 +00:00
member_covariance_test.dart [kernel] Add VariableDeclaration.isSynthesized 2023-03-10 11:13:36 +00:00
memory_file_system_test.dart [cfe] Migrate (more) CFE tests (part 3) 2021-11-16 10:37:22 +00:00
messages_json_test.dart [cfe] Migrate (more) CFE tests (part 3) 2021-11-16 10:37:22 +00:00
mixin_export_test.dart [flip-modifiers] Make tests and outline extraction tests mixins. 2023-03-08 16:11:30 +00:00
mock_file_system.dart Replace Uri.scheme == with Uri.isScheme 2022-02-08 21:38:57 +00:00
multiple_simultaneous_compiles_test.dart [cfe] Change computeDelta to return a result object 2021-11-25 10:15:07 +00:00
outline_extractor_suite.dart [cfe] tests to handle Windows EOL 2023-01-18 22:12:27 +00:00
outline_extractor_tester.dart [kernel] Enable sound null safety in TargetFlags by default 2023-02-02 14:54:18 +00:00
packages_format_error_test.dart Read package_config.json in more tests 2022-05-11 18:58:44 +00:00
parser_all_suite.dart [cfe] Migrate (more) CFE tests (part 3) 2021-11-16 10:37:22 +00:00
parser_equivalence_suite.dart [parser] Parse record literals 2022-08-16 06:36:36 +00:00
parser_suite.dart [cfe] tests to handle Windows EOL 2023-01-18 22:12:27 +00:00
parser_test_listener.dart [cfe] Put patterns in the scopes of their declared variables 2023-04-24 07:30:00 +00:00
parser_test_listener_creator.dart [analyzer/cfe] Reland: Parse final class modifier. 2023-01-19 16:08:28 +00:00
parser_test_parser.dart Patterns parsing: recover when switch statement syntax used for switch expressions. 2023-04-04 18:52:59 +00:00
parser_test_parser_creator.dart [parser] Report error on invalid const patterns 2023-02-09 12:43:31 +00:00
precedence_info_test.dart Rework computation of precedence for patterns. 2022-11-30 05:12:47 +00:00
read_dill_from_binary_md_git_test.dart [cfe] Migrate (more) CFE tests (part 4) 2021-11-16 12:13:14 +00:00
relativize_test.dart [cfe] Migrate (more) CFE tests (part 4) 2021-11-16 12:13:14 +00:00
scanner_fasta_test.dart [parser] Fix setting endGroup with triple shift 2023-03-30 13:57:21 +00:00
scanner_replacement_test.dart Change : to = for default values in pkg. 2022-08-24 15:57:16 +00:00
scanner_test.dart Change : to = for default values in pkg. 2022-08-24 15:57:16 +00:00
scheme_based_file_system_test.dart [cfe] Migrate (more) CFE tests (part 5) 2021-11-16 14:38:42 +00:00
severity_index_test.dart [cfe] Migrate (more) CFE tests (part 4) 2021-11-16 12:13:14 +00:00
simple_stats.dart [cfe] Add measurement for patterns 2022-01-06 15:15:58 +00:00
spell_checking_cleanup_lists.dart [cfe] Migrate (more) CFE tests (part 4) 2021-11-16 12:13:14 +00:00
spell_checking_list_code.txt [CFE] Add more benchmarking points; change how subdivides are handled 2023-04-24 09:49:12 +00:00
spell_checking_list_common.txt [cfe] Put patterns in the scopes of their declared variables 2023-04-24 07:30:00 +00:00
spell_checking_list_denylist.txt Avoid divisive terms 2020-06-10 14:23:57 +00:00
spell_checking_list_messages.txt [cfe/ffi] Error on compound constructors 2023-04-17 11:03:57 +00:00
spell_checking_list_tests.txt [CFE] Add instrumenter that can produce flame graph output 2023-04-25 08:34:01 +00:00
spell_checking_utils.dart [cfe] better console messages 2023-02-01 08:57:47 +00:00
spell_checking_utils_test.dart [CFE] Split words on numbers as requested for spell checker 2022-01-27 15:19:40 +00:00
spelling_test.status [CFE] Spell check messages and dart code 2019-08-09 08:47:00 +00:00
spelling_test_base.dart [cfe] Migrate (more) CFE tests (part 4) 2021-11-16 12:13:14 +00:00
spelling_test_external_targets.dart [cfe] Migrate (more) CFE tests (part 4) 2021-11-16 12:13:14 +00:00
spelling_test_not_src_suite.dart [cfe] Migrate (more) CFE tests (part 4) 2021-11-16 12:13:14 +00:00
spelling_test_src_suite.dart [cfe] Migrate (more) CFE tests (part 4) 2021-11-16 12:13:14 +00:00
split_dill_test.dart [kernel] Enable sound null safety in TargetFlags by default 2023-02-02 14:54:18 +00:00
standard_file_system_test.dart [cfe] Migrate (more) CFE tests (part 4) 2021-11-16 12:13:14 +00:00
summary_generator_test.dart [cfe] Migrate (more) CFE tests (part 4) 2021-11-16 12:13:14 +00:00
test_generator_test.dart [cfe] Change computeDelta to return a result object 2021-11-25 10:15:07 +00:00
test_utils.dart [cfe] Omit line/column from sdk constant coverage 2022-07-13 06:52:14 +00:00
testing_utils.dart [cfe] Migrate tests (part 1 of ?) 2021-09-01 11:42:06 +00:00
textual_outline_test.dart [cfe] Migrate (more) CFE tests (part 4) 2021-11-16 12:13:14 +00:00
token_test.dart [analysis_server] Add code completion for class modifiers at the beginning of a declaration. 2023-02-21 19:31:55 +00:00
type_labeler_test.dart [cfe] Migrate (more) CFE tests (part 4) 2021-11-16 12:13:14 +00:00
unit_test_suites.dart [pkg/testing] use package:lints/recommended.yaml 2023-02-17 01:34:34 +00:00
vm_service_coverage.dart Change : to = for default values in pkg. 2022-08-24 15:57:16 +00:00
vm_service_coverage_constant_evaluator.dart Replace Uri.scheme == with Uri.isScheme 2022-02-08 21:38:57 +00:00
vm_service_for_leak_detection.dart [ddc/testing/cfe/kernel] Wire up leak testing in ddc batch testing; fix 'semi-leaks' 2023-02-10 08:29:37 +00:00
vm_service_heap_finder.dart [cfe] Migrate (more) CFE tests (part 4) 2021-11-16 12:13:14 +00:00
vm_service_heap_helper.dart [VM/Service] Make _getInstancesAsArray public 2023-02-21 17:26:52 +00:00
vm_service_heap_helper_test.dart [cfe] Migrate (more) CFE tests (part 4) 2021-11-16 12:13:14 +00:00
vm_service_helper.dart Revert "Resolve package pubspec of target for relevant dartdev commands" 2023-04-05 00:43:54 +00:00
web_parser_git_test.dart [parser] Fix shifting that fails on web 2022-09-27 10:33:53 +00:00
web_parser_git_test_helper.dart [parser] Fix shifting that fails on web 2022-09-27 10:33:53 +00:00
weekly_tester.dart Retire experiment flags introduced in 2.18. 2022-12-15 13:18:50 +00:00