Git Product home page Git Product logo

orbit's Introduction

ORBIT

builds and tests Debian package OpenSSF Scorecard

ORBIT Logo

Orbit, the Open Runtime Binary Instrumentation Tool is a standalone native application profiler for Windows and Linux. It supports native applications written in languages such as C, C++, Rust, or Go. Its main purpose is to help developers identify the performance bottlenecks of a complex application. Orbit can be also used to visualize the execution flow of such applications.

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. Manual instrumentation markers can be added to the source code and further allows for value-tracking. Scheduling events are also shown to visualize when a thread was running and on what core. Furthermore, Orbit visualizes thread dependencies, showing which thread got blocked or unblocked by which other thread. For AMD GPUs, the submission, scheduling and hardware execution timings of a job is visualized. Additional GPU data, such as Vulkan debug markers can be retrieved using Orbit's Vulkan layer. Memory consumption and page-fault information is visualized as well.

An introduction to Orbit's key features can be found in the following YouTube video: Orbit Presentation

Features

  • Dynamic Instrumentation (no code change required)
  • Callstack Sampling
  • Wine/Proton Mixed-Callstack Profiling
  • Thread Scheduling and Dependency Tracing
  • Memory Tracing
  • GPU Driver Tracepoints (AMD only)
  • Vulkan Debug Label and Command Buffer Tracing (AMD only)
  • Manual Instrumentation
  • Source Code and Disassembly View
  • Remote Profiling
  • Debug Symbol Parsing (ELF, DWARF, PE and PDB)
  • Full Serialization of Captured Data

Note

Orbit's focus has shifted to the Linux version. Windows local profiling is currently only supported partially and major features, such as dynamic instrumentation, are not yet implemented. It is possible however to profile Linux executables from a Windows UI instance. For Windows local profiling, you can still use the released binaries, but please note that they are deprecated and mostly undocumented.

Build

Please have a look at the first three sections of our development documentation. It describes how to build Orbit and which compilers, platforms, and tools are supported and needed.

Workflow

Note An extensive documentation of the usage of Orbit can be found in our usage documentation.

The following describes the basic workflow of Orbit:

  1. Select a process in the list of currently running processes in the connection setup dialog, and click Start Session.
  2. The list of loaded modules will appear at the top of the Symbols tab.
  3. Orbit tries to automatically retrieve debug information of the modules. See here on how to load symbols for modules Orbit failed to load. For successfully loaded module symbols, the Functions tab will get populated.
  4. Select functions you wish to dynamically instrument in the Functions tab by Right-Click and choosing Hook.
  5. Start profiling by pressing F5. To stop profiling, press F5 again. You can either zoom time using W and S or Ctrl + the scroll wheel. You can also Ctrl+Right-Click and drag to zoom to a specific time range. To scale the UI, press Ctrl + +/-. Press SPACE to see the last 2 seconds of capture.
  6. You can select sections of the per-thread sampling event track to get a sampling report of your selection.

Presets

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

Feedback

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

About

Orbit was created by Pierric Gimmig, but is now developed and maintained by a team of engineers at Google. The current maintainers are:

License

License (BSD 2-clause)

OSI Approved License
Copyright (c) 2020 The Orbit Authors. All rights reserved.

BSD 2-Clause License

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

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

* 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 THE COPYRIGHT HOLDERS AND CONTRIBUTORS "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 THE 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.

orbit's People

Contributors

akopich avatar alexkalmuk avatar antonrohr avatar beckerhe avatar damienrg avatar danielfenner avatar danolivier avatar dependabot[bot] avatar dimitry- avatar dpallotti avatar florian-kuebler avatar gregorgall avatar illwieckz avatar irinashkviro avatar juanmitaboada avatar karupayun avatar mahmood-darwish avatar msandru avatar npcdoom avatar nputikhin avatar orbitprofiler-bot avatar pierricgimmig avatar pranav-yadav avatar radu-danciu avatar reichlfl avatar robbiesri avatar ronaldfw avatar thelta avatar vickyliu-go4it avatar vwbaker avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

orbit's Issues

Live Mode for Linux

On Windows, all events (samples, callstack, dynamically instrumented functions) are received and displayed live. This should also be possible on the Linux and remote version.

Port to Linux

Feature request.
I certainly need this awesome profiler on my Debian and I think I'm not alone. :) So I propose to port it to Linux together. For the beginning, I could add a CMake-based build.

Pdb::LoadPdb gets called when clicking on a process.

When selecting a process, Pdb::LoadPdb gets called even before "load symbols"/"load PDB" gets selected for a concrete binary. At these calls a_PdbName is empty and the subsequent calls to nm and bpftrace fails.

Crash on startup when you don't have a params file

Latest master (63f023d) crashes on startup when you don't have a params file because it then tries to save the file, which in turn triggers a notification to the UI which hasn't yet been initialized. Specifically
orbitmainwindow.cpp:44 calls OrbitApp::Init() which triggers the UI notification before it calls:

GOrbitApp->AddUiMessageCallback( [this]( const std::wstring & a_Message ) { this->OnReceiveMessage( a_Message ); } ); on line 59 to initialize the callback.

Since this callback has not been set, a std::bad_call exception is thrown from OrbitApp::SendToUiNow.

I built with VS2015 Release x64 and Qt 5.9.3.

Capture timeline should display thread names/ids, and color deterministically

Currently the capture timeline doesn't display the thread names or ids (normally shown on the left side regardless of timeline position). Nor does it have deterministic coloring; in most profilers this is either user-configured via some mapping mechanism, or deterministically generated via a hash of the name or id.

Handling long names in capture view

Sometimes, the instrumented functions have very long names (usually because of namespaces). Sometimes the long names don't fit in the instrumented function view, and sometimes they crowd out the time spent in the instrumented function.

Some ideas, not exclusive:

  • Multi-line display of instrumented functions. Could be tied to the vertical zoom feature.
  • Always show the time, and clip the function name
  • Full function-name pops up as hover text

Progress bar for symbol loading

Would be useful to get client-side feedback about server-side symbol querying and transport back to client.

Right now, this remote symbol load workflow is kinda ok because I can monitor the server-side service spewing output. But ideally, I'd only have to be looking at the client.

Expose Sampling Rate

The sampling profiler currently runs at 2KHz by default but can actually range from 1KHz to 8KHz. We should be able to tweak the rate.

Sending large messages does not finish.

This happens e.g. when trying to load symbols of a large binary. For my case there was a package of about 30mb in the message queue that was not send to the Windows client.

Add working directory option to launch program dialog.

First of all: Amazing work, this looks great and has been working flawlessly in my (limited) test runs!

While it's not absolutely necessary it would be nice to be able to set the working directory of a program you launch via Orbit.

Cheers, Dario

Capture controls are awkward

Currently there are no user interface elements for starting/stopping a capture, and the default commands are case-sensitive, which is awkward/confusing.

Automatic loading of PDB information

If we follow the workflow idiom described in the previous issue, it should be possible to support automatic loading of symbols from PDB, since the session will be "locked" to a particular executable.

Linux version randomly does not start anymore

After some runs of Orbit, I can not start it again until I reboot my system. The error message is the following:

QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
TcpEntity::TcpEntity() /usr/local/google/home/kuebler/Documents/develop/orbitprofiler/OrbitCore/TcpEntity.cpp(17) TID: 4018819904
TcpServer::TcpServer() /usr/local/google/home/kuebler/Documents/develop/orbitprofiler/OrbitCore/TcpServer.cpp(27) TID: 4018819904
virtual void TcpEntity::Start() /usr/local/google/home/kuebler/Documents/develop/orbitprofiler/OrbitCore/TcpEntity.cpp(31) TID: 4018819904
void TcpServer::Start(short unsigned int) /usr/local/google/home/kuebler/Documents/develop/orbitprofiler/OrbitCore/TcpServer.cpp(52) TID: 4018819904
terminate called after throwing an instance of 'std::system_error'
  what():  bind: Address already in use

can't profile my application

I would like to profile my project, but after loading my project and the pdb file nothing show up in the right hand side of the screen.

Trampolines dirty volatile registers resulting in crashes for some hooks

Visual Studio is happy to permit volatile registers to remain live across a call if it has full visibility into the descendant call chain. This can happen with translation-unit local functions that are not inlined into callers. The trampolines should probably save/restore all ABI volatiles.

Improved process workflow

Currently it is possible to flush all loaded symbols for the current session by selecting a new process in the process listing. Instead we suggest a workflow where each session is locked to a process once a selection is confirmed. This will also allow things such as auto-loading PDBs, recording/serializing data related to that process into the session, such as PDB references, exe/PDB hash agreements, etc.

Callstacks on Uprobes

On Windows you can right-click on a probe of a dynamically instrumented function and get the callstack of that call. This should be also possible in the Linux and remote version.

Statistics view of instrumented functions in a capture

Would be cool to get some capture-wide statistics of instrumented functions. The idea is that I might want to get a general idea of average characteristics of certain instrumented functions across an entire capture.

Possible statistics:

  • Total count per instrumented function
  • Average time per instrumented function
  • Min/Max per instrumented function
  • Std deviation per instrumented function

Support loading of PDB data from a symbol store/server

Currently you must manually select a PDB file to load per process module. It would be useful if you could instead point out a symbol store directly containing multiple PDB files and have Orbit locate the appropriate one for the module. Later, with automatic symbol load support, this could also operate via symbol stores, servers.

Orbit exits when selecting the capture tab in a HyperV VM

In my HyperV VM, running Windows 10 Professional as the guest OS, running Orbit and selecting the capture tab (and doing nothing else) causes Orbit to immediately exit.

The host OS is also Windows 10 professional, and running Orbit there works fine.

If you don't have access to HyperV, it might be easy to test this using a free Azure account.

Open PDB has non-intuitive behavior

If you use 'Open PDB' from the File menu to try to, say, load a PDB for kernel32.pdb, it seems to override all Module listings in the sampling view, for instance. If you re-select the process and then re-load the PDB through the Modules window, it seems to fix that. Find PDB from modules for kernel32.dll doesn't seem to cause this same issue. It seems Open PDB is a legacy static analysis entry-point, and can create confusion with the more typical process based workflow.

OrbitQt.vcxproj has references to D:\git\Orbit

Trying to build and ran into a few small problems:

The checked-in OrbitQt.vcxproj has absolute dir references to D:\git\Orbit, and D:/git/Orbit, as well as relative references to ..\..\Orbit -- doing a straight string replace of those in the vcxproj file with .. causes everything to build fine.

Also, external/glew-1.13.0/lib is missing -- glew needs to be rebuilt using the VS2015 toolchain from glew-1.13.0/build/vc12.

After fixing both of those, builds cleanly. Happy to provide a patch/PR for OrbitQt.vcxproj if that'd be easier.

Right-click to select range is an awkward UI idiom, especially without zoom shortcuts

It's very easy to attempt to get contextual information for a marker in the capture view and have the right-click behavior turn into a selection that zooms into a super tiny bit of the frame, and then you spend a long time zooming back out to see anything. Short cuts to zoom fully out would be useful if they don't exist (I suppose โ€˜Aโ€™ works but that also translates in time).

Export to csv

I would love to be able to export the sampling data to a csv file.

Verticle zoom on capture view has layout issues

When zooming in vertically and then zooming back out, the capture page data doesn't anchor at the top of the view so the contents will often scroll off the top of the viewable area. Without scroll-bars it's non-intuitive that you have to drag it back down.

Extracting the pdb name from the exe

We actually name our PDB something different from our exe

(sounds odd I know but we name the PDB to be the same as the final release name app.pdb) but the name of the exe we build during development contains other information in its name to allow side by side development

app.debug.x86.exe
app.release.x64.exe

This is because the PDB name and the exe are joined at birth so when after we release our code, other tools like crash handlers, debuggers can find PDB and exe (because we name app.release.x64.exe to be app.exe and now both app.exe and app.pdb have the same prefix)

But this means when users use orbit during development in their area, they are constantly having to rename the binary from app.release.x64.exe to app.exe in order to match the PDB

I believe (and you know I should have checked in the code here first!), but I believe you are using the .exe name to find the .pdb name rather than looking inside the .exe or .dll to extract the PDB name

If that is the case, then the following blog might help. (not by me!) because I believe the PDB name is embedded inside the .exe

http://geekswithblogs.net/vaibhavgaikwad/archive/2011/12/12/148010.aspx

If I've got that wrong you can reject this, but if that's the case it's not finding the PDB correctly ;-)

Refactor/Rename "Pdb" class for Linux.

There is a partial "Pdb" implementation on Linux that was temporarily put inside Module.cpp. We need to rename the class ("DebugInfo"?) and properly separate the Linux and Windows implementations.

Orbit 1.0.2 does not like recursive functions

I have the following code :

#include <iostream>
using namespace std;
int fib(int n)
{
	if (n <= 1)
		return n;
	return fib(n - 1) + fib(n - 2);
}

int main()
{
	for (auto i = 0; i < 10000000; i++) {
		int n = 20;
		cout << fib(n);
	}
	getchar();
	return 0;
}

(thanks https://www.geeksforgeeks.org/program-for-nth-fibonacci-number/)

If I hook main and fib, I would expect to waste all my time in main, I don't, if I checked the live tab the main function did consume any time.
Moreover orbit crashed my exe.

UI Lag when connected to headless service

When playing with the new headless mode, I found that there is a fair amount of UI lag from input to something happening on screen. It's not consistent, and most of the time, it's quite responsive. But quite regularly, input processing seems to hang for about a second.

After poking around, I found that this only happens when the UI client is connected to a remote service. If I start the client without an active connection, the UI is very snappy. If I have it connected to a remote service, without even having started any profiling actions, the UI will lag.

Video of issue: https://photos.app.goo.gl/CTj2UhbkoTtba4ou5

Source/line data missing in some windows

Callstack window, for instance, never seems to display file/line data, even though it is loaded when you select Visualize and see the dump in the output window.

Expose more information about context switches

ETW provides quite a bit of information about context switches that we can easily expose (NewThreadId, OldThreadId, NewThreadPriority, OldThreadPriority, PreviousCState, OldThreadWaitReason, OldThreadWaitMode, OldThreadState, OldThreadWaitIdealProcessor, NewThreadWaitTime).

Consider implicit span event stack or butterfly/tree view for sample data

Currently the sample data is listed in a flat manner similar to Very Sleepy, but it should be possible to build a tree based on recorded callstacks. A stretch goal might be to create an event stack also using implicit spans from the samples, although it would be inaccurate without correct prolog/epilog hooks.

Load symbols should be async

When selecting "Load Symbols", the UI freezes for over 10 seconds (mostly due to nm) for a ~ 16 mb binary. It would be desirable to have this async.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.