All Projects → copy → Gdbprofiler

copy / Gdbprofiler

Rich man's profiler, a profiler for native OCaml and other executables

Programming Languages

ocaml
1615 projects

Projects that are alternatives of or similar to Gdbprofiler

lldbg
A lightweight native GUI for LLDB.
Stars: ✭ 83 (+10.67%)
Mutual labels:  gdb, lldb
Code Debug
Native debugging for VSCode
Stars: ✭ 232 (+209.33%)
Mutual labels:  gdb, lldb
gdbundle
Minimalist plugin manager for GDB and LLDB
Stars: ✭ 72 (-4%)
Mutual labels:  gdb, lldb
OpenImageDebugger
An advanced in-memory image visualization plugin for GDB and LLDB on Linux, MacOS and Windows (experimental). Previously known as gdb-imagewatch.
Stars: ✭ 115 (+53.33%)
Mutual labels:  gdb, lldb
Nvim Gdb
Neovim thin wrapper for GDB, LLDB, PDB/PDB++ and BashDB
Stars: ✭ 341 (+354.67%)
Mutual labels:  gdb, lldb
Voltron
A hacky debugger UI for hackers
Stars: ✭ 5,599 (+7365.33%)
Mutual labels:  gdb, lldb
Lldb
Project moved to: https://github.com/llvm/llvm-project
Stars: ✭ 412 (+449.33%)
Mutual labels:  gdb, lldb
Inspector
A drop-anywhere C++ REPL
Stars: ✭ 767 (+922.67%)
Mutual labels:  gdb, lldb
Vim Padre
Debugger plugin for VIM
Stars: ✭ 42 (-44%)
Mutual labels:  lldb
Gdbstub
A simple, dependency-free GDB stub that can be easily dropped in to your project.
Stars: ✭ 56 (-25.33%)
Mutual labels:  gdb
Eluaprofiler
Easy LuaProfiler
Stars: ✭ 38 (-49.33%)
Mutual labels:  profiler
Android Methods Profiler
Yet another Android Profiler for AOSP .trace files
Stars: ✭ 43 (-42.67%)
Mutual labels:  profiler
Dntprofiler
DNTProfiler is an EF 6.x and NH 4.x profiler.
Stars: ✭ 59 (-21.33%)
Mutual labels:  profiler
Ios debugger challenge
A playground for run-time iOS app inspection
Stars: ✭ 39 (-48%)
Mutual labels:  lldb
Devel Nytprof
Devel::NYTProf is a powerful feature-rich source code profiler for Perl. (Mostly in maintenance mode, so PRs are much more likely to be acted upon than Issues.)
Stars: ✭ 61 (-18.67%)
Mutual labels:  profiler
Pince
A reverse engineering tool that'll supply the place of Cheat Engine for linux
Stars: ✭ 987 (+1216%)
Mutual labels:  gdb
Php Spx
A simple & straight-to-the-point PHP profiling extension with its built-in web UI
Stars: ✭ 972 (+1196%)
Mutual labels:  profiler
Avalonstudio
Cross platform IDE and Shell
Stars: ✭ 1,132 (+1409.33%)
Mutual labels:  gdb
Vcprofiler
An accurate and simple tool uses KVO to measure the time cost of every view controller.
Stars: ✭ 61 (-18.67%)
Mutual labels:  profiler
Profimp
Python import profiler
Stars: ✭ 52 (-30.67%)
Mutual labels:  profiler

GDB profiler

This is a fork of Ygrek's ocaml-gdb, a gdb-based profiler for native OCaml programs. Support for writing cpuprofile files has been added, which can be viewed in Chromium's DevTools, which can be opened by pressing F12 or navigating to this page (you may need to open this page first). It also supports writing callgrind files, which can be viewed using kachegrind.

Additionally, support for lldb has been added (by passing the --use-lldb command line argument). This is experimental and requires the lldb-mi executable.

gdbprofiler works on OCaml 4.03.0 and higher.

Quick start

gdbprofiler doesn't require instrumentation. Compile your code to native binaries. Optionally, add -g in ocamlc or -tag debug in ocamlbuild to see source code locations.

Installation: opam install gdbprofiler

Usage: gdbprofiler -p <pid> [--use-lldb] [--debugger path] [--cpuprofile path] [--callgrind path]

Example: gdbprofiler -p `pidof my_example_program.native` --cpuprofile example.cpuprofile --callgrind callgrind.out

If you're getting a "not permitted" error on Linux, run the following: su -c 'sysctlkernel.yama.ptrace_scope=0' (more infos).

The output file must have a .cpuprofile extension, otherwise Chromium refuses to load it.

In recent versions of Chromium the profiler view has moved. It can be found in the ... menu on the top right -> More tools -> JavaScript Profiler.


Bottom Up

Bottom up view in Chromium.


Top Down

Top down view in Chromium.


Chart

Chart view in Chromium.


Tree Map

Tree Map in kcachegrind.


Call Graph

Call Graph in kcachegrind.

Introduction

RMP is a stack sampling profiler based on ocaml-gdb library for communication with GDB machine interface (GDB/MI).

Stack sampling profiler works by taking many stack traces of the profiled process and aggregating similar traces together, providing empirical evidence of program behaviour with statistical estimation of percentage of time spent in different code paths. This means, that profiler will show not only cpu-bound hotspots, but also all places where the code is waiting for the kernel call to finish (e.g. sleep, blocking IO, etc). One nice property of stack sampling approach is that the profiled program needn't be modified or restarted - profiler only needs the permission to attach to the running process and collect stack traces for the short period of time.

See http://poormansprofiler.org/ for general description of this technique.

Rationale

RMP attaches GDB to the profiled program once and then instructs it to probe the stack of the inferior process periodically. The traces are aggregated and displayed/updated immediately. It has access to all the information that GDB provides (static stack unwinding, debug symbols, etc). Interactive mode allows to stop/resume profiling at any time (e.g. when enough information is available or waiting for the process to engage into some specific activity).

RMP was devised to fill the gap between existing solutions :

  • gprof

    Instrumenting profiler, requires recompilation, instrumentation influences code behaviour significantly (inflating execution time for small functions).

  • pmp

    Poor man's profiler shell script works by calling gdb several times each time attaching to the process, collecting trace and detaching. This extremely simple approach works everywhere and yields tons of useful information. Unfortunately, it also incurs significant pauses in the profiled process and takes quite a bit of time to collect the traces, also doesn't have interactive mode.

  • linux perf

    Works only on linux, needs to be compiled with the matching version of kernel headers. Can profile both kernel and userland, but only the code that saves frame pointer on the stack. This is true for the majority of C code, but doesn't hold for the OCaml native code (in default mode).

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].