No description
Find a file
Jens Johansen bb20bd0528 [CFE] More instrumentation options
This change:
* Fixes now-wrong asserts from when the origin of this was written
  years ago (the new async reality also allowed for simplification
  of the replacement code).
* Allows `*` as a wild-card name when processing candidates,
  so for instance `flow_analysis.dart|*` would mean everything in
  the file `flow_analysis.dart`.
* Allows taking the candidates via the command line without going
  through a file, so instead of having a file with
  `flow_analysis.dart|*` and passing that file with
  `--candidates=file` one say "--candidates-raw=flow_analysis.dart|*"
  - one can also give more either by giving it several times or by
  comma-separating it.
* Adds two new instrumentations: `--single-timer` and `--timer`
  where the first gives a single time for how long all instrumented
  stuff was on the stack, and the second one gives a timer for each
  instrumented procedure/constructor where it is on the stack.

One can for instance now instrument like this:

```
out/ReleaseX64/dart --enable-asserts pkg/front_end/tool/flame/instrumenter.dart -Diterations=10 pkg/front_end/tool/_fasta/compile.dart --single-timer "--candidates-raw=flow_analysis.dart|*"
```

or

```
out/ReleaseX64/dart --enable-asserts pkg/front_end/tool/flame/instrumenter.dart -Diterations=10 pkg/front_end/tool/_fasta/compile.dart --timer "--candidates-raw=flow_analysis.dart|*"
```

And it can be run via

```
out/ReleaseX64/dart pkg/front_end/tool/_fasta/compile.dart.dill.instrumented.dill pkg/front_end/tool/_fasta/compile.dart
```

And produce something like this (note that these examples are with -Diterations=10 so for 10 iterations):

For --single-timer:
```
Runtime: 3834491044
Runtime in seconds: 3.834491044
Visits: 52643690
Active: 0
Stopwatch frequency: 1000000000
```

For --timer:
```
[...]
flow_analysis.dart|_FlowAnalysisImpl.propertyGet: runtime: 818095151 (0.818095151 s), visits: 1328320, active: 0
flow_analysis.dart|FlowModel._updateVariableInfo: runtime: 827669322 (0.827669322 s), visits: 968180, active: 0
flow_analysis.dart|_FlowAnalysisImpl.variableRead: runtime: 1012755488 (1.012755488 s), visits: 1100140, active: 0
flow_analysis.dart|FlowModel.joinVariableInfo: runtime: 1118758076 (1.118758076 s), visits: 320810, active: 0
flow_analysis.dart|FlowModel.merge: runtime: 1185477853 (1.185477853 s), visits: 334100, active: 0
flow_analysis.dart|_FlowAnalysisImpl._merge: runtime: 1238735352 (1.238735352 s), visits: 334100, active: 0
```

Change-Id: Idaae6cdd2202b1a2d540da39db9aedb0c930329e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/302280
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2023-05-09 15:13:58 +00:00
.dart_tool
.github
benchmarks
build
docs
pkg [CFE] More instrumentation options 2023-05-09 15:13:58 +00:00
runtime
samples
sdk
tests
third_party
tools
utils
.clang-format
.gitattributes
.gitconfig
.gitignore
.gn
.mailmap
.style.yapf
.vpython
AUTHORS
BUILD.gn
CHANGELOG.md
codereview.settings
CONTRIBUTING.md
DEPS
LICENSE
OWNERS
PATENT_GRANT
PRESUBMIT.py
README.dart-sdk
README.md
sdk_args.gni
SECURITY.md
WATCHLISTS

Dart

A client-optimized language for fast apps on any platform

Dart is:

  • Optimized for UI: Develop with a programming language specialized around the needs of user interface creation.

  • Productive: Make changes iteratively: use hot reload to see the result instantly in your running app.

  • Fast on all platforms: Compile to ARM & x64 machine code for mobile, desktop, and backend. Or compile to JavaScript for the web.

Dart's flexible compiler technology lets you run Dart code in different ways, depending on your target platform and goals:

  • Dart Native: For programs targeting devices (mobile, desktop, server, and more), Dart Native includes both a Dart VM with JIT (just-in-time) compilation and an AOT (ahead-of-time) compiler for producing machine code.

  • Dart Web: For programs targeting the web, Dart Web includes both a development time compiler (dartdevc) and a production time compiler (dart2js).

Dart platforms illustration

License & patents

Dart is free and open source.

See LICENSE and PATENT_GRANT.

Using Dart

Visit dart.dev to learn more about the language, tools, and to find codelabs.

Browse pub.dev for more packages and libraries contributed by the community and the Dart team.

Our API reference documentation is published at api.dart.dev, based on the stable release. (We also publish docs from our beta and dev channels, as well as from the primary development branch).

Building Dart

If you want to build Dart yourself, here is a guide to getting the source, preparing your machine to build the SDK, and building.

There are more documents on our wiki.

Contributing to Dart

The easiest way to contribute to Dart is to file issues.

You can also contribute patches, as described in Contributing.