{"id":25731850,"url":"https://github.com/microsoft/microsoft-performance-tools-linux-android","last_synced_at":"2025-05-14T21:05:09.021Z","repository":{"id":39878813,"uuid":"319761654","full_name":"microsoft/Microsoft-Performance-Tools-Linux-Android","owner":"microsoft","description":"Linux, Android and Chromium Performance Tools built using the Microsoft Performance Toolkit. Cross-platform .NET Core + WPA GUI","archived":false,"fork":false,"pushed_at":"2025-03-21T03:58:19.000Z","size":20621,"stargazers_count":337,"open_issues_count":4,"forks_count":33,"subscribers_count":19,"default_branch":"develop","last_synced_at":"2025-04-08T10:12:02.859Z","etag":null,"topics":["android","chromium","debugging","dotnet","dotnet-core","flamegraph","linux","lttng","optimization","perf","perfetto","performance","performance-analysis","performance-optimization","performance-profiling","performance-visualization"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/microsoft.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":"SUPPORT.md","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-12-08T21:09:23.000Z","updated_at":"2025-04-04T01:58:19.000Z","dependencies_parsed_at":"2023-02-09T17:02:02.081Z","dependency_job_id":"df33a3ab-aeb6-4896-a684-3eaca55d1133","html_url":"https://github.com/microsoft/Microsoft-Performance-Tools-Linux-Android","commit_stats":{"total_commits":92,"total_committers":13,"mean_commits":7.076923076923077,"dds":0.5,"last_synced_commit":"bf5b380f912501da80e703279b888659ba19b56f"},"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2FMicrosoft-Performance-Tools-Linux-Android","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2FMicrosoft-Performance-Tools-Linux-Android/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2FMicrosoft-Performance-Tools-Linux-Android/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2FMicrosoft-Performance-Tools-Linux-Android/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/microsoft","download_url":"https://codeload.github.com/microsoft/Microsoft-Performance-Tools-Linux-Android/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248166925,"owners_count":21058481,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","chromium","debugging","dotnet","dotnet-core","flamegraph","linux","lttng","optimization","perf","perfetto","performance","performance-analysis","performance-optimization","performance-profiling","performance-visualization"],"created_at":"2025-02-26T03:27:37.572Z","updated_at":"2025-04-10T06:13:13.763Z","avatar_url":"https://github.com/microsoft.png","language":"C#","readme":"# Microsoft Performance Tools Linux / Android\n\n\u003e This repo contains various Linux and Android Performance Analysis tools built with the [Microsoft Performance Toolkit SDK](https://github.com/microsoft/microsoft-performance-toolkit-sdk).\n\n\u003e Tools are built with open source .NET Core and can be run on the cmd-line or in the WPA GUI. All the logs that are supported are open source. \n\n\u003eNot only are the raw logs parsed, but a lot of smart post processing / correlation is done to make your life easier as a perf analyst. We hope you can solve \u0026 debug tough issues on you or your customers systems with this toolset!\n\n\u003e Tracing supported: \n- [LTTng](https://lttng.org) (Kernel CPU scheduling, Processes, Threads, Block IO/Disk, Syscalls, File events, etc)\n- [perf](https://perf.wiki.kernel.org/) Generic Events, CPU Sampling (cpu-clock)\n- [Perfetto](https://perfetto.dev/) Android \u0026 Chromium (CPU Scheduling, CPU Sampling, CPU Frequency, FTrace, Android Logs, Generic Events / Default Tracks, GPU Counters, Jank Detection, Processes, Android Packages)\n\n\u003e Logs supported: \n- [Dmesg](https://en.wikipedia.org/wiki/Dmesg)\n- [Cloud-Init](https://cloud-init.io/)\n- [WaLinuxAgent](https://github.com/Azure/WALinuxAgent)\n- [AndroidLogcat](https://developer.android.com/studio/command-line/logcat)\n\n**Optional** WPA GUI:\n![WpaLinux](Images/WpaLinux.JPG)\n\n# Presentations\n\nIf you want to see a demo or get more in-depth info on using these tools (LTTng) check out a talk given at the [Linux Tracing Summit](https://www.tracingsummit.org/ts/2019/):\n\u003eLinux \u0026 Windows Perf Analysis using WPA (LTTng), ([slides](https://www.tracingsummit.org/ts/2019/files/Tracingsummit2019-wpa-berg-gibeau.pdf)) ([video](https://youtu.be/HUbVaIi-aaw))\n\n# Blog Posts\n\nFeaturing some use-cases and some walkthroughs\n\n- [New tools for analyzing Android, Linux, and Chromium browser performance – Microsoft-Performance-Tools for Linux-Android](https://devblogs.microsoft.com/performance-diagnostics/new-tools-for-analyzing-android-linux-and-chromium-browser-performance/)\n- [Perfetto tooling for analyzing Android, Linux, and Chromium browser performance – Microsoft-Performance-Tools-Linux-Android](https://devblogs.microsoft.com/performance-diagnostics/perfetto-tooling-for-analyzing-android-linux-and-chromium-browser-performance-microsoft-performance-tools-linux-android/)\n- [New Android logcat support available in Microsoft Performance Tools for Linux \u0026 Android](https://devblogs.microsoft.com/performance-diagnostics/new-android-logcat-support-available-in-microsoft-performance-tools-for-linux-android/)\n\n# Prerequisites\n\n## Runtime prereqs\n- [.NET Core Runtime 3.1.x](https://dotnet.microsoft.com/download/dotnet-core/3.1)\n\n## Dev prereqs\n- [.NET Core SDK 3.1.x](https://dotnet.microsoft.com/download/dotnet-core/3.1)\n- [Visual Studio](https://visualstudio.microsoft.com/), [VSCode](https://visualstudio.microsoft.com/), or your favorite editor!\n\n# Download\n- **For plugins Download** see [Releases](https://github.com/microsoft/Microsoft-Performance-Tools-Linux/releases)\n\n- **NuGet Pkgs** see [PerformanceToolkitPlugins](https://www.nuget.org/profiles/PerformanceToolkitPlugins)\n\n- **(Windows Only GUI - Install)** Using the WPA GUI to load these tools as plugins\n  - Download the latest Store [Windows Performance Analyzer (Preview)](https://www.microsoft.com/en-us/p/windows-performance-analyzer-preview/9n58qrw40dfw)\n\n# How to run the tools\nThe tools can be run in several modes:\n\n- **Cross-platform with .NET Core** (Any OS that .NET Core supports)\n  - Used as a library to process traces / logs programatically in a .NET Core language like C#\n    - Examples: \n    - [LTTng 1](LTTngDriver/Program.cs), [LTTng 2](LTTngDataExtUnitTest/LTTngUnitTest.cs)\n    - [Perf.data.txt](PerfUnitTest/PerfUnitTest.cs) (CPU Sampling analysis)\n    - [Perf.data](PerfDataUnitTest/PerfDataUnitTest.cs) (Generic events)\n    - [LinuxLogs](LinuxLogParsers/LinuxLogParsersUnitTest/LinuxLogParsersUnitTest.cs)\n    - [Perfetto](PerfettoUnitTest/PerfettoUnitTest.cs)\n  - With a driver program for example dumping to screen or text format\n    - ./LTTngDriver.exe LTTngKernelTraceFolder\n    - ./LTTngDriver.exe LTTng-Kernel-Trace.ctf (trace folder is zipped and renamed to .ctf)\n- **(Windows Only - Run)** Using the WPA GUI to load these tools as plugins\n  - WPA needs to be told where to find these additional plugins. \n  - Using [Windows Launcher](Launcher/Windows/LaunchWpaPerfToolsLinuxAndroid.ps1) script\n    ```powershell\n    .\\LaunchWpaPerfToolsLinuxAndroid.ps1 -i c:\\PATH\\TO\\lttng-kernel-trace.ctf\n    ```\n    - -LinuxPerfToolsPluginFolder path may need to be specified if not auto-found correctly\n  - In Command Prompt with -addsearchdir and -i trace file:\n      ```dos\n        wpa.exe -addsearchdir %HOMEDRIVE%%HOMEPATH%\\Downloads\\Microsoft-Performance-Tools-Linux-Android-1.2\\Microsoft-Performance-Tools-Linux-Android\\MicrosoftPerfToolkitAddins -i c:\\PATH\\TO\\lttng-kernel-trace.ctf\n     ```\n  - OR with Env Variable to pick file from UI\n       ```dos\n        SET WPA_ADDITIONAL_SEARCH_DIRECTORIES=%HOMEDRIVE%%HOMEPATH%\\Downloads\\Microsoft-Performance-Tools-Linux-Android-1.2\\Microsoft-Performance-Tools-Linux-Android\\MicrosoftPerfToolkitAddins\n        wpa.exe\n      ```\n  - Optional Troubleshooting - Verify that this WPA version supports plugins\n    - In Command Prompt - Example:\n        ```dos\n        wpa.exe /?\n        \"C:\\Program Files\\WindowsApps\\Microsoft.WindowsPerformanceAnalyzerPreview_10.0.22504.0_x64__8wekyb3d8bbwe\\10\\Windows Performance Toolkit\\wpa.exe\" /?\n        ```\n    - Verify that these 2 command line WPA options are supported:\n      - OPTIONS: **-addsearchdir PATH**. Adds a directory path to the plugin search path. ....\n      - ENVIRONMENT VARIABLES: **WPA_ADDITIONAL_SEARCH_DIRECTORIES** - A semicolon (;) delimited list of additional directories to search for plugins. Equivalent to the -addsearchdir option.\n- **(Windows) Command-line dumping to a text format** based on the WPA UI (say CSV) (wpaexporter.exe)\n    ```dos\n    \"C:\\Program Files\\WindowsApps\\Microsoft.WindowsPerformanceAnalyzerPreview_10.0.22504.0_x64__8wekyb3d8bbwe\\10\\Windows Performance Toolkit\\wpaexporter.exe\" -addsearchdir PLUGIN_FOLDER -i traceFile\n    ```\n\n# How to capture a trace or logs\n- Linux \n  - Please see [Linux Trace Log Capture](LinuxTraceLogCapture.md)\n- Perfetto\n  - Android - Please see [Record traces on Android](https://perfetto.dev/docs/quickstart/android-tracing)\n  - Linux - Please see [Record traces on Linux](https://perfetto.dev/docs/quickstart/linux-tracing)\n  - Chromium - In chrome://tracing/ Record choose \"Use protobuf\" OR use UI at https://ui.perfetto.dev/\n    - Also see https://www.chromium.org/developers/how-tos/trace-event-profiling-tool/recording-tracing-runs\n\n# How to load the logs in the UI\n\n- LTTng - If you just need to open only a LTTng trace by itself in folder format\n  - WPA -\u003e Open -\u003e Folder -\u003e (Select CTF folder)\n    - Note: Requires \u003e= 1.2 release AND WPA \u003e= 10.6.20.1 (via WPA Help -\u003e About)\n- Perfetto\n  - WPA -\u003e Open -\u003e (Select Perfetto trace file)\n    - Note: The Perfetto plugin explicitly supports the _.perfetto-trace_ and _.pftrace_ file types, but it does support more (e.g. Protobuf, Chrome JSON). You just need to rename to one of the stated supported types\n- Unified (LTTng, Perfetto, or other multiple different logs files together)\n  - Once you gather the data, there is a tiny bit of prep needed to open them in a single unified timeline (like the screenshot above)\n  - If you want to open multiple logs together in single timeline - Copy all trace files and logs you want to open to single folder\n  - Example: You want to open in the same timeline: LTTng, Perf CPU Sampling, Dmesg\n    - Ensure that the Linux CTF folder/trace is zipped and renamed to .ctf in the same folder (hack so open Unified works)\n  - WPA -\u003e File -\u003e Open -\u003e Multi-select all files and choose \"Open Unified\"\n\n# How do I use WPA in general?\nIf you want to learn how to use the GUI UI in general see [WPA MSDN Docs](https://docs.microsoft.com/en-us/windows-hardware/test/wpt/windows-performance-analyzer)\n\n## Contributing\n\nThis project welcomes contributions and suggestions.  Most contributions require you to agree to a\nContributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us\nthe rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.\n\nWhen you submit a pull request, a CLA bot will automatically determine whether you need to provide\na CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions\nprovided by the bot. You will only need to do this once across all repos using our CLA.\n\nThis project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).\nFor more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or\ncontact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.\n\n## Trademarks\n\nThis project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft \ntrademarks or logos is subject to and must follow \n[Microsoft's Trademark \u0026 Brand Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general).\nUse of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship.\nAny use of third-party trademarks or logos are subject to those third-party's policies.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicrosoft%2Fmicrosoft-performance-tools-linux-android","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmicrosoft%2Fmicrosoft-performance-tools-linux-android","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicrosoft%2Fmicrosoft-performance-tools-linux-android/lists"}