Skip to content

An extended version of libunwind to support Xen domain unwinding, targeted at unikernel stack-based profiling

License

MIT, MIT licenses found

Licenses found

MIT
LICENSE
MIT
COPYING
Notifications You must be signed in to change notification settings

sysml/libunwind

This branch is 22 commits ahead of, 634 commits behind libunwind/libunwind:master.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

f78e09a · Mar 29, 2017
Jul 15, 2004
Sep 15, 2012
Nov 4, 2016
Jul 26, 2006
Mar 29, 2017
Mar 22, 2015
Aug 21, 2012
Nov 14, 2007
Nov 16, 2002
Jul 26, 2006
Jul 28, 2006
Sep 13, 2016
Oct 6, 2012
Jun 7, 2015
Nov 4, 2016
Aug 17, 2004
Nov 16, 2004
Dec 4, 2014
Sep 13, 2016

Repository files navigation

Libunwind with Patches for Xen Unikernel Unwinding

(Note: the original, upstream readme can be found in README.)

This is a fork of libunwind (http://www.nongnu.org/libunwind/), a library to unwind the stack and create a callchain. This fork is extended by support for Xen virtual machines. This is especially useful for Unikernels, in which the kernel and application form a single binary sharing a common address space. By using libunwind-xen, a unikernel's (or, in theory, any other VM's) stack can be unwound from the outside. One of the main uses for this is the sampling of call chains at runtime as a profiling tool.

The way libunwind does this is by using the .eh_frame information created by a compiler at compile time. By comparing the stack addresses in the running VM to those in the ELF's .eh_frame section, it can assess the size of the currently running function's frame on the stack, unroll it to retrieve the prveious instruction pointer, and iterate over this until the end of the stack is reached. This means that you need compiler support to create an .eh_frame, but the good news is that this is almost universally supported out-of-the-box and by default. It also means that you do not need a frame pointer, so you can produce stack traces on binaries compiles with -fomit-frame-pointer for higher performance, or on architectures that do not provide a frame pointer register.

This current implementation is quite bare-bones and does not support functionality that isn't required for stack walking. For example, there is no support for writing memory or registers, only reading. It currently also only supports the x86 version of Xen. Extensions of this starting point should be easy though, if more is required at any point in the future.

Build and Install

  1. ./autogen.sh
  2. ./configure
  3. make
  4. make install

Use

For tracing Xen virtual machines, link your application against libunwind-generic and libunwind-xen.

About

An extended version of libunwind to support Xen domain unwinding, targeted at unikernel stack-based profiling

Topics

Resources

License

MIT, MIT licenses found

Licenses found

MIT
LICENSE
MIT
COPYING

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C 83.9%
  • Shell 7.8%
  • Assembly 4.6%
  • Makefile 1.9%
  • C++ 1.1%
  • M4 0.7%