Orbit, the Open Runtime Binary Instrumentation Tool, is a standalone C/C++ profiler for Windows and Linux

Overview

Alt text

Alt text

Orbit, the Open Runtime Binary Instrumentation Tool, is a standalone C/C++ profiler for Windows and Linux. Its main purpose is to help developers visualize the execution flow of a complex application.

The key differentiator with many existing tools is that no alteration to the target process is necessary. Orbit does not require you to change a single line of code. It doesn't require you to recompile or even relaunch the application you want to profile. Everything is done seamlessly, right when you need it. It requires zero integration time and zero iteration time.

Orbit combines sampling and dynamic instrumentation to optimize the profiling workflow. Sampling can quickly identify interesting functions to instrument. Dynamic instrumentation results in exact function entry and exit information which is presented in the form of per-thread hierarchical call graphs. Scheduling events are also shown to visualize when a thread was running and on what core.

Features

  • Dynamic Instrumentation (No Code Change Required)
  • Robust Sampling
  • Fast Debug Symbol Parsing
  • Context Switch Tracking
  • Disassembly View
  • Remote Profiling
  • User Sessions
  • Full Serialization of Captured Data
  • Tested on Unreal, Unity, Lumberyard, Qt, Doom3, PhysX, ...

Note

Orbit is undergoing a major overhaul. The focus has now shifted to the Linux version. Windows local profiling is currently broken in the main branch. It is possible however to profile Linux executable from a Windows UI instance. For Windows local profiling, please use the released binaries. Windows development will resume in the coming months.

Build

Please have a look at the first three sections of our development documentation. It describes how to build Orbit and what Compilers, Platforms, and Tools are supported and needed.

Workflow

  1. Select a process in the list of currently running processes in the "Home" tab.
  2. The list of loaded modules will appear on the bottom of the "Home" tab. If debug symbols were found for a module, it will be highlighted in blue.
  3. Right click on the module(s) for which you want to load debug information and select "Load Symbols". The "Functions", "Types" and "Globals" tabs will get populated.
  4. Select functions you wish to profile in the "Functions" tab by right clicking and choosing "Hook".
  5. In the "Capture" tab, start profiling by pressing 'X'. To stop profiling, press 'X' again. You can zoom time using the scroll wheel. To zoom vertically, hold 'CTRL' while scrolling. You can also ctrl+right-click and drag to zoom time. Press 'SPACE' to Zoom the last 2 seconds of capture.
  6. When you select a function in the "Capture" view, the full callstack will be available in the "Callstack" tab. You can select functions to be profiled in the callstack tab as well. Also, if code is available on your machine, it will be displayed in the "Code" tab.
  7. You can select sections of the per-thread sampling event track to get a sampling report of your selection.

Sessions

Once you have loaded the debug information for your modules and have chosen functions of interest, you can save your profiling session so that you won't have to do this manually again. To save a session, go to "File"->"Save Session"

Feedback

Questions and comments are more than welcome, please open an issue.

About

Orbit was created by Pierric Gimmig but is now actively developed and maintained by a team of engineers at Google.

License (BSD 2-clause)

Copyright (c) 2020 Pierric Gimmig. All rights reserved.

https://github.com/pierricgimmig/orbitprofiler

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

   1. Redistributions of source code must retain the above copyright notice,
      this list of conditions and the following disclaimer.

   2. Redistributions in binary form must reproduce the above copyright
      notice, this list of conditions and the following disclaimer in the
      documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY COPYRIGHT HOLDER ``AS IS'' AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
EVENT SHALL COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Issues
  • Modernizing cmake

    Modernizing cmake

    Brace yourself for a large pull request.

    The idea behind this work is to standardize our build system to make it work on CI more easily. Recent versions of CMake brought a lot of new features which radically decrease the complexity of cmake based build systems.

    The following points have been tackled:

    • Properly separate external dependencies form internal libraries/modules.
    • Separation between compiler toolchain flags and "normal" compiler flags by introducing toolchain files.
    • Proper handling of private and public dependencies (this mainly applies to include directories, compiler flags and linking)

    Dependencies

    Dependencies in CMake are usually imported by a find_package-call. The result of find_package-call in modern CMake is an imported target (an enitity which bundles link libraries, include paths, compiler flags, etc.). A module in our project can refer to such an imported target by leveraging the target_link_libraries()-command.

    All 3rd party dependencies in ORBIT are now handled by a find_package-call and subsequent imports with target_link_libraries. For all dependencies which do not provide CMake support a FindXYZ.cmake package finding file was written (check the cmake/ folder).

    Furthermore, both on Windows and on Linux, all dependencies (except Qt) are pulled form vcpkg. For making CI happen, we should work towards having all dependencies in vcpkg and cross-compiling form source against the GGP SDK (at least for the headless part).

    Toolchain files

    Like I mentioned before, I removed all compiler flags from the build system which are not directly necessary for building the project (like -D options). All compiler flags (like optimization levels, enabled and disabled warnings, LTO, etc.) should be defined in a toolchain file. This way, concerns are separated and we make sure to compile the whole project with a unified set of compiler flags.

    The are several example toolchain files for both Windows and Linux in contrib/toolchains. Feel free to use them as a start.

    Deployment & Packaging

    There has already been some cmake code which made a deployment possible by collecting all the required libraries. I believe this was not completely up to date, but close. For now I removed theses parts (my apologies), just to reduce the scope of this pull request as much as possible. If you think that's a problem, please let me know. The idea is to bring this back soon. We will need that anyway.

    CMake formatting

    For alle the CMake files I used cmake-format (python pip package) to achieve a consistent style. The formatting is sometimes not perfect, but at least I don't need to worry about that.

    Testing

    I tried on Windows x64 debug and release and on Linux x64 debug and release. Daniel is currently checking the bootstraping on his windows machine.

    CMake version requirements

    Yes, I had to bump up the cmake version to a pretty recent version (3.15). The reason is, that CMake made quite some progress in the last two years and brought features which greatly simplify the CMakeLists.txt-files and allow a cleaner build configuration. I know, this complicates things, especially on Linux, where you usually use CMake from your package manager. But I still believe it is worth the hassle. If you don't agree, please let me know. (By the way, the easiest way to get a recent version of CMake on Linux is through pip: pip3 install --user cmake)

    @danielfenner Daniel, you wanted to make the code review for this. So be my guest. :-) @pierricgimmig I believe there is no way forward without you having a look. So thank you in advance.

    I hope, I haven't forgotten anything. In case, just let me know.

    opened by beckerhe 19
  • Package LinuxTracingIntegrationTests in Orbit.zip

    Package LinuxTracingIntegrationTests in Orbit.zip

    So that it can be used in YHITI.

    Bug: http://b/160756664

    Test: Manually triggered http://sponge2.corp.google.com/fa3b700a-d67d-4efb-a85d-4cc873eb2346 and http://sponge2.corp.google.com/38d9aa07-d985-4253-bad3-eff9bde40e55.

    opened by dpallotti 15
  • Choose the precision for the histogram ticks dynamically

    Choose the precision for the histogram ticks dynamically

    Instead of using the hard-coded number of decimals we choose the minimal number of decimals s.t. all the ticks have different values. We have to limit the maximal number of decimals due to space limitations.

    Further, the tick is now rendered at the position driven by the rounded value.

    After rounding some ticks may fall off to the right or to the left. Therefore, the maximal number of tics has been increased by 1.

    Test: Manual Bug: http://b/224967376

    opened by akopich 14
  • Set Callbacks in Fuzzer and Add CHECKS in App

    Set Callbacks in Fuzzer and Add CHECKS in App

    Recent changes from "if (...callback)" to "CHECK(...callback)" led to failed checks in the Fuzzers, as the callbacks were not explicitly set.

    This change sets the required callbacks in the Fuzzer. Also it replaces the remaining "if"s with "CHECK" to ensure that the callbacks are properly initialized.

    Bug: http://b/168770539 Test: Compile

    opened by florian-kuebler 13
  • Redraw capture window when TimeGraph::Zoom is called

    Redraw capture window when TimeGraph::Zoom is called

    The capture window was not redrawn when using the jump to first/min/max/last actions as TimeGraph::NeedsUpdate() would not actually cause a redraw of the capture window.

    This PR makes all changes so that "update needed" => "redraw needed" is now an invariant of the TimeGraph class. In particular, NeedsUpdate() now also sets m_NeedsRedraw to true.

    Clarifying comments are added.

    opened by ronaldfw 13
  • Enforce consistent formatting across different versions of clang-format

    Enforce consistent formatting across different versions of clang-format

    Each version of clang-format has its own definition of Google style. Recent fails in the presubmit check showed that there are differences in the latest version and the one from the CI (which is clang-format-9).

    This PR dumps the Google style definition from clang-format-9 into the .clang-format file instead of relying on what the version below has defined as such.

    opened by florian-kuebler 12
  • Add

    Add "Toggle capture" button and menu item, toggle capture with 'X' from everywhere

    Add "Toggle capture" button at the top of the "capture" tab

    Add and use QAction to toggle capture with 'X' from everywhere

    Also add such action to the "File" menu. Also add Ctrl+S and Ctrl+O shortcuts to save and open a capture.

    Bug: http://b/156245865


    A (somewhat) more sophisticated attempt than #543, that I closed.

    opened by dpallotti 12
  • Removal of global variable GOrbitApp

    Removal of global variable GOrbitApp

    This PR removes GOrbitApp from the code base.

    It has a lot of commits - mainly separated by class. Almost all of them a straight forward. They introduce a member variable OrbitApp* app_ which is initialized via the constructor and used in the class's implementation instead of GOrbitApp.

    All commits compile on its own and I recommend to review them one-by-one. It's a large PR, but the commits itself are rather small. Let me know if you think this needs to be split up into multiple PRs.

    The reason for doing this is mainly #1526. This PR needs to move some resource ownership (i.e. ProcessManager) from OrbitApp to OrbitMainWindow, which means OrbitMainWindow needs to control the lifetime of OrbitApp, otherwise OrbitApp might end up with a dangling pointer when OrbitMainWindow gets out of scope. So after removing all of GOrbitApp, there is a commit that hands ownership of OrbitApp to OrbitMainWindow.

    It did some extensive manual testing with the branch and I couldn't crash it or found any bug.

    Note: This does not solve the cyclic dependency problem that we have with OrbitApp ("OrbitApp owns X and X needs to access OrbitApp"). It can and has to be refactored independently. This is also the reason why this change introduces a lot of forward declarations of OrbitApp. They are needed due to cyclic dependencies.

    EDIT: Note that the license_headers presubmit check is expected to fail due to the known orbitcodeeditor-problem. b/163462463 for more details.

    EDIT: Bug added for tracking the progress of follow-up refactorings of the cyclic dependencies: http://b/175759190

    opened by beckerhe 11
  • Ubuntu build not working

    Ubuntu build not working

    With the latest Conan changes, running bootstrap-orbit.sh fails at the cmake "generate" step.

    I get:

    -- Configuring done
    CMake Error at OrbitGl/CMakeLists.txt:4 (add_library):
      Target "OrbitGl" links to target "OpenGL::OpenGL" but the target was not
      found.  Perhaps a find_package() call is missing for an IMPORTED target, or
      an ALIAS target is missing?
    

    I get the same when running "build.sh clang9_release" for example.

    opened by pierricgimmig 11
  • Add `Tydepef<Tag, T>` template

    Add `Tydepef` template

    To promote type-safety we introduce a type-safe wrapper generalizing the ideas behind Baseline and Comparison wrappers, which are only type aliases now.

    This also introduces a function Call that allows to write the client code in wrapper-agnostic way, yet make a call on wrapped arguments, preserving all the type checks.

    Tests: Compile, Unit, Manual Bug: http://b/236715501

    opened by akopich 10
  • Replace symbol loading CHECK with Error message

    Replace symbol loading CHECK with Error message

    b/178176772 The solution this change represents is in general not a good idea. But I don't have any clue why the Check fails in the first place and cannot reproduce it. Additionally this code will change with the upcoming #1752. Since #1752 wont make it into 1.59, I made this quick-n-dirty fix. If there are any better ideas, I would like to hear about it.

    opened by antonrohr 10
  • Add TID Typedef and use it in Mizar

    Add TID Typedef and use it in Mizar

    This is supposed to promote type-safety and redability.

    Also, this makes Typedef default-constructible.

    Bug: http://237786468 Tests: Compile, Manual, Unit

    opened by akopich 0
  • Avoid sending version comparison warning to UI

    Avoid sending version comparison warning to UI

    We changed to stop sending user the warning message that the capture is taken by a newer version.

    When we load a capture, we already compare the capture format version in OrbitApp::LoadCaptureFromFile (to be specific, when we call CaptureFile::OpenForReadWrite, it will check the capture file version while reading the header). This should be enough for comparing the version compatibility.

    Bug: http://b/237747877

    opened by vickyliu-go4it 0
  • Add thread state slice selection capabilities

    Add thread state slice selection capabilities

    Now, orbit app saves which thread state slice is selected by the user when the user clicks on a thread state slice and deselects it when pressing on the background.

    http://b/236944854

    opened by Mahmood-Darwish 1
  • Cache addresses for which not an epilog was successfully detected

    Cache addresses for which not an epilog was successfully detected

    While we cannot cache the addresses for which we detected an epilog, as we actually have to simulate the effects of the rest of that epilog, we can cache the addresses for which we detected that we are not in an epilog. These are the majority anyway, as most samples are not going to be in an epilog.

    In my usual experiments, this is a 15 to 20% performance improvement on the average time to unwind one frame, for example because it saves us from a lot of disassemblying.

    Bug: http://b/237625163

    Test:

    • Add unit test.
    • Capture a complex game running on Wine and verify no worsening of unwind error rate.
    • Verify performance gain with ad-hoc instrumentation.
    opened by dpallotti 1
Releases(v1.0.2)
Owner
Google
Google ❤️ Open Source
Google
Bytehound - a memory profiler for Linux

Bytehound - a memory profiler for Linux Features Can be used to analyze memory leaks, see where exactly the memory is being consumed, identify tempora

Koute 2.8k Jun 26, 2022
VMPImportFixer is a tool aimed to resolve import calls in a VMProtect'd (3.x) binary.

VMPImportFixer VMPImportFixer is a tool aimed to resolve import calls in a VMProtect'd (3.x) binary. Information VMPImportFixer attempts to resolve al

null 240 Jun 24, 2022
WinMerge is an Open Source differencing and merging tool for Windows.

WinMerge is an Open Source differencing and merging tool for Windows. WinMerge can compare both folders and files, presenting differences in a visual text format that is easy to understand and handle.

null 3k Jun 26, 2022
KeyScan is a C++ open source explanation tool targeting windows operating system.

KeyScan is a C++ open source explanation tool targeting windows operating system. it allows you to send keyboard events, mouse events and capture keystrokes (keylogger).!

null 9 Jun 12, 2022
A cross-platform OpenXR capabilities explorer and runtime switcher with a CLI and GUI.

OpenXR Explorer OpenXR Explorer is a handy debug tool for OpenXR developers. It allows for easy switching between OpenXR runtimes, shows lists of the

Nick Klingensmith 116 Jun 26, 2022
A cross platform C99 library to get cpu features at runtime.

cpu_features A cross-platform C library to retrieve CPU features (such as available instructions) at runtime. Table of Contents Design Rationale Code

Google 2k Jun 22, 2022
The most powerful and customizable binary pattern scanner written on modern C++

Sig The most powerful and customizable binary pattern scanner written on modern C++ ✔ Capabilities: Support for all common pattern formats: Pattern +

Александр 132 Jun 11, 2022
A combined suite of utilities for manipulating binary data files.

BinaryTools A combined suite of utilities for manipulating binary data files. It was developed for use on Windows but might compile on other systems.

David Walters 3 Sep 29, 2021
Translates binary information (images, fonts, shaders) into C++ source code.

Binary bakery ?? Translates binary files (images, fonts etc.) into C++ source code and gives access to that data at compile- or runtime. There are dif

Sebastian Werhausen 126 May 28, 2022
the checkra1n set of tools targeting bare metal, Linux and Windows

Universal toolchain Low-effort cross-compiling for the masses. What's Universal toolchain? It's a collection of sysroots and shell scripts in such a w

null 62 May 27, 2022
An asynchronous directory file change watcher module for Windows, macOS and Linux wrapped for V

A V module for asynchronously watching for file changes in a directory. The module is essentially a wrapper for septag/dmon. It works for Windows, macOS and Linux.

null 15 Jun 23, 2022
AlleyWind is an advanced Win32-based and open-sourced utility that helps you to manage system's windows

AlleyWind AlleyWind is an advanced Win32-based and open-sourced utility that helps you to manage system's windows. AlleyWind could: Displays a graphic

KNSoft 17 Jun 20, 2022
Windows user-land hooks manipulation tool.

MineSweeper Windows user-land hooks manipulation tool. Highlights Supports any x64/x86 Windows DLL (actually, any x64/x86 Windows PE for that matter)

Arsenii Pustovit 126 Jun 15, 2022
A windows tool for changing the start button logo

WinLogo About This project is used to modify the start button logo of windows 10 computers. The logos are precompiled into the binary, but the UI supp

null 14 Apr 16, 2022
Linux Kernel module-less implant (backdoor)

0 KOPYCAT - Linux Kernel module-less implant (backdoor) Usage $ make $ sudo insmod kopycat.ko insmod: ERROR: could not insert module kopycat.ko: Inapp

Ilya V. Matveychikov 41 Jun 18, 2022
Atomically exchange two files in Linux

Atomically exchange two files in Linux.

David Pape 9 May 28, 2022
A linux library to get the file path of the currently running shared library. Emulates use of Win32 GetModuleHandleEx/GetModuleFilename.

whereami A linux library to get the file path of the currently running shared library. Emulates use of Win32 GetModuleHandleEx/GetModuleFilename. usag

Blackle Morisanchetto 1 Nov 5, 2021
A tool for use with clang to analyze #includes in C and C++ source files

Include What You Use For more in-depth documentation, see docs. Instructions for Users "Include what you use" means this: for every symbol (type, func

null 2.9k Jul 2, 2022
A C library for parsing/normalizing street addresses around the world. Powered by statistical NLP and open geo data.

libpostal: international street address NLP libpostal is a C library for parsing/normalizing street addresses around the world using statistical NLP a

openvenues 3.5k Jun 29, 2022