flutter / devtools

Performance tools for Flutter
https://flutter.dev/docs/development/tools/devtools/
BSD 3-Clause "New" or "Revised" License
1.59k stars 326 forks source link

Allow enabling the VM cpu profiler from DevTools #1250

Closed LinXiaoTao closed 4 years ago

LinXiaoTao commented 5 years ago

CPU Flame Chart in the Timeline.

flutter doctor -v

[✓] Flutter (Channel unknown, v1.5.4-hotfix.2, on Mac OS X 10.14.2 18C54, locale zh-Hans-CN)
    • Flutter version 1.5.4-hotfix.2 at /Users/leo/Documents/flutter
    • Framework revision 7a4c33425d (6 个月前), 2019-04-29 11:05:24 -0700
    • Engine revision 52c7a1e849
    • Dart version 2.3.0 (build 2.3.0-dev.0.5 a1668566e5)

[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.0)
    • Android SDK at /Users/leo/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-29, build-tools 29.0.0
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
    • All Android licenses accepted.

[✓] iOS toolchain - develop for iOS devices (Xcode 10.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 10.1, Build version 10B61
    • ios-deploy 1.9.4
    • CocoaPods version 1.6.1

[✓] Android Studio (version 3.5)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 40.0.2
    • Dart plugin version 191.8423
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)

[!] IntelliJ IDEA Ultimate Edition (version 2019.1)
    • IntelliJ at /Applications/IntelliJ IDEA.app
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    • Dart plugin version 191.6183.88
    • For information about installing plugins, see
      https://flutter.dev/intellij-setup/#installing-the-plugins

[✓] VS Code (version 1.39.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.5.1

[!] Connected device
    ! No devices available
LinXiaoTao commented 5 years ago

Need to enable cpu profile first. Why do I have to enable the cpu profile in observatory first, can I enable it directly in the dev tool?

kenzieschmoll commented 5 years ago

What exactly do you mean by "enable the CPU profile in observatory"? What version of DevTools are you on? You can find the version in the DevTools info page or by opening up the chrome dev console.

LinXiaoTao commented 5 years ago

@kenzieschmoll

Dart SDK:
2.5.0
DevTools:
0.1.10
QQ20191024-225423@2x
kenzieschmoll commented 5 years ago

@bkonyi can we make the _enableProfiler rpc a public method on the vm_service?

kenzieschmoll commented 5 years ago

This functionality is now available via https://github.com/dart-lang/sdk/commit/60c34ac4203ff0bf9f026ba4568f7b4d9a2ad9bf. Need to add a hook in devtools to modify this flag.

jacob314 commented 4 years ago

Added to M14 as this seems like easy polish to bring DevTools on par with the observatory. I'm fine with the button only being exposed in the flutter version of DevTools.