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

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.
Owner
Comments
  • 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.

  • 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.

  • 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

  • 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

  • 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.

  • 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.

  • 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.

  • 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

  • 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.

  • 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

  • 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.

  • Does orbit support arm64 platform?

    Does orbit support arm64 platform?

    I want to use this tool to analyze arm64 linux and android. I tried to build orbit on arm64 linux, it failed with the following error.

        g++-9: error: unrecognized command line option '-m64’
    make[1]: *** [CMakeFiles/cmTC_d5ce4.dir/build.make:66: CMakeFiles/cmTC_d5ce4.dir/testCXXCompiler.cxx.o] Error 1
    make[1]: Leaving directory
    '/home/xxx/.conan/data/abseil/20220623.0/_/_/build/6eeea3904f53d9f7311f5a5b447089286767e0b4/build/RelWithDebInfo/CMakeFiles/CMakeTmp'
    
  • Fix GraphTrack arrow boxes being too height

    Fix GraphTrack arrow boxes being too height

    In this PR we are fixing arrow boxes in GraphTrack. After investigating, seems to be that before we were calculating the height of the text manually (because GetStringHeight() didn't count multi-lines).

    Since now GetStringHeight() is returning the correct height, the visible height was the square, and then the box was incredible big.

    New Screenshot: http://screenshot/4B4n4ZggDKau4Ga

  • Add CaptureWindowDebugWidget

    Add CaptureWindowDebugWidget

    This widget is combining all the debug information for a single CaptureWindow (either the general capture window or the introspection window).

    It integrates the controls to change time graph layout values and it shows debug output, similar to how the ImGui based debug UI did it.\

    This is how the demo looks: http://screenshot/AP9CCKWc7YhisaY

  • Fix capture window flickering when loading a new font

    Fix capture window flickering when loading a new font

    In this PR we are fixing the flickering that appeared when QT-TextRenderer was introduced and that was noticeable at the beginning of a session.

    After an investigation, turned to be that the cause was that when QT loaded a new font, it messes the openGL state and nothing else was being drawn in that frame.

    So, in this PR:

    • We are calling CleanupGlState() & PrepareGlState() in between QT-TextRendering and native GL-ShadeRendering (for each layer).
    • Including these lines in PrepareGlState():
      • glBindTexture(GL_TEXTURE_2D, 0); -> This line fixed the issue.
      • glUseProgram(0); They were called before at the beginning anyways, but not in between QT and native GL rendering and they should be part of PrepareGLState().

    Screenshot of the flickering: http://screenshot/7StjuKsDojuyS7j. Nothing after kZValueTrackText was rendered in native GL.

    Test: Loaded a capture, everything works. Take a capture, no flickering either.

  • Can't compile Windows - C++ 20

    Can't compile Windows - C++ 20

    C:\git\orbit\src\ConfigWidgets\PropertyConfigWidgetTest.cpp(17,8): error C7555: use of designated initializers requires at least '/s
    td:c++20' [C:\git\orbit\build_msvc2019_relwithdebinfo\src\ConfigWidgets\ConfigWidgetsTests.vcxproj]
    C:\git\orbit\src\ConfigWidgets\PropertyConfigWidgetTest.cpp(29,8): error C7555: use of designated initializers requires at least '/s
    td:c++20' [C:\git\orbit\build_msvc2019_relwithdebinfo\src\ConfigWidgets\ConfigWidgetsTests.vcxproj]
    

    @beckerhe , is the CI not building Windows anymore? The Windows build is impossible to compile due to many sources of error.

Bytehound - a memory profiler for Linux
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

Nov 21, 2022
VMPImportFixer is a tool aimed to resolve import calls in a VMProtect'd (3.x) binary.
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

Nov 11, 2022
WinMerge is an Open Source differencing and merging tool for Windows.
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.

Nov 16, 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.

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).!

Sep 21, 2022
A cross-platform OpenXR capabilities explorer and runtime switcher with a CLI and GUI.
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

Nov 24, 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 +

Nov 11, 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

Nov 19, 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.

Oct 1, 2022
Translates binary information (images, fonts, shaders) into C++ source code.
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

Oct 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

Nov 21, 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.

Aug 24, 2022
AlleyWind is an advanced Win32-based and open-sourced utility that helps you to manage system's windows
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

Oct 20, 2022
Windows user-land hooks manipulation tool.
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)

Oct 18, 2022
A windows tool for changing the start button logo
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

Nov 15, 2022
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

Nov 22, 2022
A C library for parsing/normalizing street addresses around the world. Powered by statistical NLP and open geo data.
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

Nov 23, 2022
This project aims to facilitate debugging a kernel driver in windows by adding support for a code change on the fly without reboot/unload, and more!
This project aims to facilitate debugging a kernel driver in windows by adding support for a code change on the fly without reboot/unload, and more!

BSOD Survivor Tired of always telling yourself when you got a BSOD that what if I could just return to the caller function which caused the BSOD, and

Nov 12, 2022
GSmartControl - Hard disk drive and SSD health inspection tool

GSmartControl Hard disk drive and SSD health inspection tool GSmartControl is a graphical user interface for smartctl (from smartmontools package), wh

Nov 17, 2022
Find patterns of vulnerabilities on Windows in order to find 0-day and write exploits of 1-days. We use Microsoft security updates in order to find the patterns.
Find patterns of vulnerabilities on Windows in order to find 0-day and write exploits of 1-days. We use Microsoft security updates in order to find the patterns.

Back 2 the Future Find patterns of vulnerabilities on Windows in order to find 0-day and write exploits of 1-days. We use Microsoft security updates i

Nov 13, 2022