A dynamic binary tracing tool

Overview

Backlight

Backlight is a dynamic binary tracing tool.

Install

$ git clone [email protected]:JoshMcguigan/backlight.git

$ cd backlight

$ cargo install-backlight

Usage

# Trace all system calls, shared library function calls, etc
$ backlight /bin/ls
...
[lib] malloc
[sys] sys_brk
[sys] sys_brk
[lib] free
[sys] sys_openat
[sys] sys_newfstatat
[sys] sys_mmap
[sys] sys_close
[lib] malloc
...
--- Child process exited ---

# Trace specific system calls
$ backlight -s sys_openat -s sys_close /bin/ls 

# Trace specific shared library function calls
$ backlight -l malloc -l free /bin/ls

# Add args after `--` and backlight will pass them along to the tracee
$ backlight /bin/ls -- -a

# Trace specific system calls and all shared library function calls
$ backlight -s sys_openat --all-library-functions /bin/ls

# Trace specific shared library function calls and all system calls
$ backlight -l malloc --all-syscalls /bin/ls

I'm looking for feedback on the UX of backlight. Stop by #3 and share your opinions!

License

Licensed under either of

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Comments
  • Test suite depends on specific libc version

    Test suite depends on specific libc version

    The backlight test suite implicitly depends on implementation details of the libc version available in its environment. This needs to be corrected so the tests can pass when run in other environments.

    But I want to think carefully about how to do this while also allowing the tests to give high confidence that backlight is functional while tracing libc library calls.

    I'm certainly open to feedback on this. This feels like a problem that other tools of this nature would have had to solve before, but I'm not up to speed on the best practices here.

    help wanted 
    opened by JoshMcguigan 1
  • Improve test suite cross compatiblity

    Improve test suite cross compatiblity

    This PR improves the compatibility of the test suite across various environments.

    It's not a perfect/complete solution, but I think its enough for now to close #2.

    opened by JoshMcguigan 0
  • Provide static binaries

    Provide static binaries

    Hey, I want to try out backlight but don't have a rust toolchain setup atm, could you please provide release binaries (preferably musl / static linked)

    opened by dufferzafar 0
  • Function/syscall tracing should show function arguments and return values

    Function/syscall tracing should show function arguments and return values

    Backlight should show the function arguments and return values when tracing functions and syscalls, to the extent it is possible to infer this information.

    enhancement 
    opened by JoshMcguigan 1
  • Support tracing signals

    Support tracing signals

    Backlight should support tracing signals received by a process.

    This should be relatively easy to implement, since I think we are already breaking on any signals, so we'd just need to print out some message.

    enhancement good first issue 
    opened by JoshMcguigan 0
  • Support attaching to an existing process

    Support attaching to an existing process

    Currently backlight only supports tracing processes that it spawns. It should be expanded to support attaching to existing processes. I think this should mostly "just work", with the main new function being reading the existing mmap'd libraries and resolving symbols from them. As of now, since backlight is tracing a process from the very start, it assumes it will see the mmap system call for each library as it is loaded.

    enhancement 
    opened by JoshMcguigan 0
Owner
Josh Mcguigan
Josh Mcguigan
Error propagation tracing in Rust.

Propagate Error propagation tracing in Rust. Why Propagate? Being able to trace the cause of an error is critical for many types of software written i

Ben Reeves 10 Sep 23, 2021
This crate bridges between gstreamer and tracing ecosystems.

This crate provides a bridge between gstreamer and the tracing ecosystem. The goal is to allow Rust applications utilizing GStreamer to better integra

Standard Cognition OSS 17 Jun 7, 2022
A tracing profiler for the Sega MegaDrive/Genesis

md-profiler, a tracing profiler for the Sega MegaDrive/Genesis This program, meant to be used with this fork of BlastEm, helps you finding bottlenecks

null 15 Nov 3, 2022
A tracing layer for macOS/iOS's `oslog`

tracing_oslog This is a tracing layer for the Apple OS logging framework. Activities are used to handle spans, Example use tracing_oslog::OsLogger; l

Lucy 12 Dec 6, 2022
Emit ETW events in tracing-enabled Rust applications.

tracing-etw Emit ETW events in tracing-enabled Rust applications. This crate depends on rust_win_etw. There are four ETW events. fn NewSpan(span_id: u

Microsoft 11 Aug 10, 2022
A patch to fix tracing LocalTime problem.

tracing-local-time A patch to fix tracing LocalTime problem. Tracing-subscriber now has a bug in LocalTime, so build ourselves' to fix it. In this pat

Cris Liao 2 Dec 27, 2021
An example of a fairing for rocket to use tracing (as this pops up at many places in dicussions and questions)

Rocket Tracing Fairing Example This repository aims to give a short example of how you can add a Fairing to your Rocket for tracing and how to use it

Christof Weickhardt 9 Nov 23, 2022
Tracing layer to quickly inspect spans and events

tracing-texray First, a word of warning: This is alpha software. Don't run this in prod or anywhere where a panic would ruin your day. tracing-texray

Russell Cohen 23 Dec 3, 2022
tracing - a framework for instrumenting Rust programs to collect structured, event-based diagnostic information

tracing-appender Writers for logging events and spans Documentation | Chat Overview tracing is a framework for instrumenting Rust programs to collect

Cris Liao 1 Mar 9, 2022
Middlewares and tools to integrate axum + tracing + opentelemetry

axum-tracing-opentelemetry Middlewares and tools to integrate axum + tracing + opentelemetry. Read OpenTelemetry header from incoming request Start a

David Bernard 31 Jan 4, 2023
A rust `tracing` compatible framework inspired by log4rs.

trace4rs This crate allows users to configure output from tracing in the same way as you would configure the output of log4rs. Overview For a usage ex

Imperva 5 Oct 24, 2022
A convenient tracing config and init lib, with symlinking and local timezone.

clia-tracing-config A convenient tracing config and init lib, with symlinking and local timezone. Use these formats default, and can be configured: pr

Cris Liao 5 Jan 3, 2023
AWS Cloudwatch layer for tracing-subscriber

tracing-cloudwatch tracing-cloudwatch is a custom tracing-subscriber layer that sends your application's tracing events(logs) to AWS CloudWatch Logs.

ymgyt 7 May 14, 2023
A crate providing a tracing-subscriber layer for formatting events so Datadog can parse them

Datadog Formatting Layer A crate providing a tracing-subscriber layer for formatting events so Datadog can parse them. Features Provides a layer for t

Open Schnick 4 Jun 22, 2023
High-performance QEMU memory and instruction tracing

Cannoli Cannoli is a high-performance tracing engine for qemu-user. It can record a trace of both PCs executed, as well as memory operations. It consi

Margin Research 412 Oct 18, 2023
Utilities for integrating Datadog with opentelemetry + tracing in rust

Non-official datadog tracing and log correlation for Rust services. This crate contains the necessary glue to bridge the gap between OpenTelemetry, tr

willbank 5 Oct 31, 2023
An example app in Rust for CircleCI's Dynamic Config demo

circleci-dynamic-config-example An example app in Rust for CircleCI's dynamic config demo. Dynamic config allows you to dynamically generate CircleCI'

yujiosaka 2 Oct 6, 2022
A dynamic image generator.

dynimgen A dynamic image generator. How to use step 1: The designers export the design drawing as an svg file <svg> <rect /> <image src="img.png"

null 29 Jun 14, 2023
A tiling window manager for Windows 10 based on binary space partitioning

yatta BSP Tiling Window Manager for Windows 10 Getting Started This project is still heavily under development and there are no prebuilt binaries avai

Jade 143 Nov 12, 2022