Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable toggling of timeline streams using a Dart C API method (to be used in release builds) #47601

Closed
a-siva opened this issue Nov 2, 2021 · 3 comments
Assignees
Labels
area-vm Use area-vm for VM related issues, including code coverage, FFI, and the AOT and JIT backends. customer-flutter P2 A bug or feature request we're likely to work on

Comments

@a-siva
Copy link
Contributor

a-siva commented Nov 2, 2021

Add a new Dart C API method that allows toggling of the following timeline streams in the VM

V(API, "dart:api") 
V(Compiler, "dart:compiler")
V(CompilerVerbose, "dart:compiler.verbose")
V(Dart, "dart:dart")
V(Debugger, "dart:debugger")
V(Embedder, "dart:embedder")
V(GC, "dart:gc")  
V(Isolate, "dart:isolate")
V(VM, "dart:vm")

This API method would provide functionality similar to the 'setVMTimelineFlags' rpc method supported in the service protocol.

In this model the embedder would always have 'systrace_timeline' enabled by default in the release build but all the streams would be disabled and it could then toggle the individual streams at runtime to collect timeline traces.

@a-siva a-siva added area-vm Use area-vm for VM related issues, including code coverage, FFI, and the AOT and JIT backends. customer-flutter P2 A bug or feature request we're likely to work on labels Nov 2, 2021
@a-siva
Copy link
Contributor Author

a-siva commented Nov 2, 2021

@xster
Copy link
Contributor

xster commented Nov 2, 2021

Also cc @ChristianEdwardPadilla.

In this model the embedder would always have 'systrace_timeline' enabled by default in the release build

This might be an implementation detail, but the desired capabilities are:

  • Be able to take a release build locally or on CI, and run it with a VM flag before the VM starts to globally enable timeline traces for the process
  • Be able to take a release build (in production). There is no awareness of whether the traces will be toggled on during the process but depending on user actions, the traces will be turned on and off through the above APIs.

The 2 scenarios currently have no overlap. So there's some flexibility in terms of the API design.

@a-siva a-siva self-assigned this Nov 4, 2021
@a-siva
Copy link
Contributor Author

a-siva commented Nov 10, 2021

copybara-service bot pushed a commit that referenced this issue Nov 10, 2021
Add Dart C API Function Dart_EnableTimelineCategory that enables
toggling of timeline categories at runtime.

#47601

TEST=Dart C API tests added

Change-Id: I679e755d69d1375552e3a02e887ac00f828553d0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219860
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
copybara-service bot pushed a commit that referenced this issue Nov 10, 2021
…egories."

This reverts commit 8e90a9e.

Reason for revert: Breaks PRODUCT builds

Original change's description:
> [VM/Runtime] - Add Dart C API function to toggle timeline categories.
>
> Add Dart C API Function Dart_EnableTimelineCategory that enables
> toggling of timeline categories at runtime.
>
> #47601
>
> TEST=Dart C API tests added
>
> Change-Id: I679e755d69d1375552e3a02e887ac00f828553d0
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219860
> Commit-Queue: Siva Annamalai <asiva@google.com>
> Reviewed-by: Ryan Macnak <rmacnak@google.com>

TBR=bkonyi@google.com,rmacnak@google.com,asiva@google.com

Change-Id: Ib8198d1466d23fefac415088b5566a4e22ba2e91
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219941
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
copybara-service bot pushed a commit that referenced this issue Nov 11, 2021
Add Dart C API Function Dart_EnableTimelineCategory that enables
toggling of timeline categories at runtime.

#47601

TEST=Dart C API tests added

Change-Id: Ib38c8ab0a8d43c9180e9cb9ade107f8bad5f5e63
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219943
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
@a-siva a-siva closed this as completed Nov 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-vm Use area-vm for VM related issues, including code coverage, FFI, and the AOT and JIT backends. customer-flutter P2 A bug or feature request we're likely to work on
Projects
None yet
Development

No branches or pull requests

2 participants